-eliminate consensus warnings
[oweals/gnunet.git] / src / gns / test_gns_dht_three_peers.c
1 /*
2      This file is part of GNUnet.
3      (C) 2009 Christian Grothoff (and other contributing authors)
4
5      GNUnet is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published
7      by the Free Software Foundation; either version 3, or (at your
8      option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      General Public License for more details.
14
15      You should have received a copy of the GNU General Public License
16      along with GNUnet; see the file COPYING.  If not, write to the
17      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18      Boston, MA 02111-1307, USA.
19 */
20 /**
21  * @file gns/test_gns_dht_threepeer.c
22  * @brief tests dht lookup over 3 peers
23  *
24  * topology:
25  * alice <----> bob <-----> dave
26  *
27  * alice queries for www.buddy.bob.gads
28  *
29  */
30 #include "platform.h"
31 #include "gnunet_common.h"
32 #include "gnunet_disk_lib.h"
33 #include "gnunet_testing_lib-new.h"
34 #include "gnunet_testbed_service.h"
35 #include "gnunet_core_service.h"
36 #include "gnunet_dht_service.h"
37 #include "block_dns.h"
38 #include "gnunet_signatures.h"
39 #include "gnunet_namestore_service.h"
40 #include "gnunet_dnsparser_lib.h"
41 #include "gnunet_gns_service.h"
42
43 #define ZONE_PUT_WAIT_TIME GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 10)
44
45 #define TEST_DOMAIN "www.buddy.bob.gads"
46 #define TEST_IP "1.1.1.1"
47 #define TEST_DAVE_PSEU "hagbard"
48
49
50 /* Timeout for entire testcase */
51 #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 60)
52
53 /* Global return value (0 for success, anything else for failure) */
54 static int ok;
55
56 /* Task handle to use to schedule test failure */
57 static GNUNET_SCHEDULER_TaskIdentifier die_task;
58
59 static GNUNET_SCHEDULER_TaskIdentifier wait_task;
60
61 static struct GNUNET_CRYPTO_ShortHashCode dave_hash;
62
63 static struct GNUNET_CRYPTO_ShortHashCode bob_hash;
64
65 static struct GNUNET_TESTBED_Peer **cpeers;
66
67 static struct GNUNET_GNS_Handle *gh;
68 static struct GNUNET_GNS_LookupRequest *lookup_handle;
69
70 static struct GNUNET_TESTBED_Operation *get_cfg_ops[3];
71 static struct GNUNET_TESTBED_Operation *connect_ops[3];
72 static struct GNUNET_CONFIGURATION_Handle *cfg_handles[3];
73 static struct GNUNET_NAMESTORE_Handle *nh[3];
74
75 static int dave_is_setup;
76 static int bob_is_setup;
77 static int alice_is_setup;
78
79 /**
80  * Check if the get_handle is being used, if so stop the request.  Either
81  * way, schedule the end_badly_cont function which actually shuts down the
82  * test.
83  */
84 static void
85 end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86 {
87   die_task = GNUNET_SCHEDULER_NO_TASK;
88   int c;
89
90   if (GNUNET_SCHEDULER_NO_TASK != wait_task)
91   {
92       GNUNET_SCHEDULER_cancel (wait_task);
93       wait_task = GNUNET_SCHEDULER_NO_TASK;
94   }
95
96   for (c = 0; c < 3; c++)
97   {
98     if (NULL != nh[c])
99     {
100       GNUNET_NAMESTORE_disconnect(nh[c]);
101       nh[c] = NULL;
102     }
103
104     if (NULL != get_cfg_ops[c])
105     {
106         GNUNET_TESTBED_operation_done(get_cfg_ops[c]);
107         get_cfg_ops[c] = NULL;
108     }
109     if (NULL != connect_ops[c])
110     {
111         GNUNET_TESTBED_operation_done(connect_ops[c]);
112         connect_ops[c] = NULL;
113     }
114     if (NULL != cfg_handles[c])
115     {
116       GNUNET_CONFIGURATION_destroy (cfg_handles[c]);
117       cfg_handles[c] = NULL;
118     }
119   }
120   
121   if (NULL != lookup_handle)
122   {
123     GNUNET_GNS_cancel_lookup_request (lookup_handle);
124     lookup_handle = NULL;
125   }
126   if (NULL != gh)
127   {
128     GNUNET_GNS_disconnect(gh);
129     gh = NULL;
130   }
131   
132   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Test failed \n");
133   GNUNET_SCHEDULER_shutdown ();
134   ok = 1;
135 }
136
137 static void
138 end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
139 {
140   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Finished\n");
141   int c;
142   if (GNUNET_SCHEDULER_NO_TASK != die_task)
143   {
144       GNUNET_SCHEDULER_cancel (die_task);
145       die_task = GNUNET_SCHEDULER_NO_TASK;
146   }
147
148   for (c = 0; c < 3; c++)
149   {
150     if (NULL != nh[c])
151     {
152       GNUNET_NAMESTORE_disconnect(nh[c]);
153       nh[c] = NULL;
154     }
155     if (NULL != cfg_handles[c])
156     {
157       GNUNET_CONFIGURATION_destroy (cfg_handles[c]);
158       cfg_handles[c] = NULL;
159     }
160   }
161
162   if (NULL != gh)
163   {
164     GNUNET_GNS_disconnect(gh);
165     gh = NULL;
166   }
167
168   if (0 == ok)
169     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Test ended successful\n");
170   else
171     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Test failed\n");
172   GNUNET_SCHEDULER_shutdown ();
173 }
174
175 static void
176 end_now ()
177 {
178   GNUNET_SCHEDULER_add_now (&end, NULL);
179 }
180
181
182 static void
183 disconnect_ns (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
184 {
185
186   GNUNET_NAMESTORE_disconnect (cls);
187   if (cls == nh[0])
188     nh[0] = NULL;
189   if (cls == nh[1])
190     nh[1] = NULL;
191   if (cls == nh[2])
192     nh[2] = NULL;
193 }
194
195
196 static void
197 cont_ns (void* cls, int32_t s, const char* emsg)
198 {
199   GNUNET_SCHEDULER_add_now (&disconnect_ns, cls);
200 }
201
202 static void
203 on_lookup_result(void *cls, uint32_t rd_count,
204                  const struct GNUNET_NAMESTORE_RecordData *rd)
205 {
206   int i;
207   char* string_val;
208
209   if (rd_count == 0)
210   {
211     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
212                 "Lookup failed!\n");
213     ok = 2;
214   }
215   else
216   {
217     ok = 1;
218     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "name: %s\n", (char*)cls);
219     for (i=0; i<rd_count; i++)
220     {
221       string_val = GNUNET_NAMESTORE_value_to_string(rd[i].record_type,
222                                                     rd[i].data,
223                                                     rd[i].data_size);
224       if (0 == strcmp(string_val, TEST_IP))
225       {
226         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
227                     "%s correctly resolved to %s!\n", TEST_DOMAIN, string_val);
228         ok = 0;
229       }
230       GNUNET_free (string_val);
231     }
232   }
233   end_now ();
234 }
235
236 static void
237 commence_testing(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
238 {
239   static int wait = 0;
240   wait++;
241   if ((ZONE_PUT_WAIT_TIME.rel_value / 1000) == wait)
242   {
243     fprintf (stderr, "\n");
244     wait_task = GNUNET_SCHEDULER_NO_TASK;
245     lookup_handle = GNUNET_GNS_lookup(gh, TEST_DOMAIN, GNUNET_GNS_RECORD_A,
246                       GNUNET_NO,
247                       NULL,
248                       &on_lookup_result, TEST_DOMAIN);
249     if (GNUNET_SCHEDULER_NO_TASK != die_task)
250       GNUNET_SCHEDULER_cancel(die_task);
251     die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from lookup");
252   }
253   else
254   {
255       fprintf (stderr, ".");
256       wait_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &commence_testing, NULL);
257   }
258 }
259
260 void
261 all_connected ()
262 {
263   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Created all connections! Waiting for PUTs\n");
264   wait_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &commence_testing, NULL);
265 }
266
267
268 static void connect_peers ()
269 {
270   static int started;
271   started ++;
272   if (3 == started)
273   {
274       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers started\n");
275
276       connect_ops[0] = GNUNET_TESTBED_overlay_connect (NULL, NULL, NULL,
277                                                        cpeers[0],
278                                                        cpeers[1]);
279
280       connect_ops[1] = GNUNET_TESTBED_overlay_connect (NULL, NULL, NULL,
281                                                        cpeers[1],
282                                                        cpeers[2]);
283
284       connect_ops[2] = GNUNET_TESTBED_overlay_connect (NULL, NULL, NULL,
285                                                        cpeers[0],
286                                                        cpeers[2]);
287   }
288 }
289
290 static int
291 setup_dave (const struct GNUNET_CONFIGURATION_Handle * cfg)
292 {
293   char* keyfile;
294   struct GNUNET_CRYPTO_RsaPrivateKey *key;
295   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey;
296   struct in_addr *web;
297   struct GNUNET_NAMESTORE_RecordData rd;
298
299   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up dave\n");
300   cfg_handles[0] = GNUNET_CONFIGURATION_dup (cfg);
301   GNUNET_assert (NULL != cfg_handles[0]);
302   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
303                                                             "ZONEKEY",
304                                                             &keyfile))
305   {
306     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
307     return GNUNET_SYSERR;
308   }
309
310   key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
311   if (NULL == key)
312   {
313
314     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
315     GNUNET_free (keyfile);
316     return GNUNET_SYSERR;
317   }
318   nh[0] = GNUNET_NAMESTORE_connect (cfg_handles[0]);
319   if (NULL == nh[0])
320   {
321     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
322     GNUNET_CRYPTO_rsa_key_free (key);
323     GNUNET_free (keyfile);
324     return GNUNET_SYSERR;
325   }
326
327   GNUNET_CRYPTO_rsa_key_get_public (key, &pkey);
328   GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &dave_hash);
329
330   rd.expiration_time = UINT64_MAX;
331
332   web = GNUNET_malloc(sizeof(struct in_addr));
333   GNUNET_assert(1 == inet_pton (AF_INET, TEST_IP, web));
334   rd.data_size = sizeof(struct in_addr);
335   rd.data = web;
336   rd.record_type = GNUNET_GNS_RECORD_A;
337   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
338
339   GNUNET_NAMESTORE_record_create (nh[0], key, "www", &rd, NULL, NULL);
340
341   rd.data_size = strlen(TEST_DAVE_PSEU);
342   rd.data = TEST_DAVE_PSEU;
343   rd.record_type = GNUNET_GNS_RECORD_PSEU;
344
345
346   GNUNET_NAMESTORE_record_create (nh[0], key, GNUNET_GNS_MASTERZONE_STR, &rd, &cont_ns, nh[0]);
347
348   GNUNET_CRYPTO_rsa_key_free(key);
349   GNUNET_free(keyfile);
350   GNUNET_free(web);
351   dave_is_setup = GNUNET_YES;
352   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up dave done\n");
353   return GNUNET_OK;
354 }
355
356 static int
357 setup_bob (const struct GNUNET_CONFIGURATION_Handle * cfg)
358 {
359   char* keyfile;
360   struct GNUNET_CRYPTO_RsaPrivateKey *key;
361   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey;
362   struct GNUNET_NAMESTORE_RecordData rd;
363
364   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob\n");
365   cfg_handles[1] = GNUNET_CONFIGURATION_dup (cfg);
366   GNUNET_assert (NULL != cfg_handles[1]);
367   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
368                                                             "ZONEKEY",
369                                                             &keyfile))
370   {
371     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
372     return GNUNET_SYSERR;
373   }
374
375   key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
376   if (NULL == key)
377   {
378
379     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
380     GNUNET_free (keyfile);
381     return GNUNET_SYSERR;
382   }
383
384   nh[1] = GNUNET_NAMESTORE_connect (cfg_handles[1]);
385   if (NULL == nh[1])
386   {
387     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
388     GNUNET_CRYPTO_rsa_key_free (key);
389     GNUNET_free (keyfile);
390     return GNUNET_SYSERR;
391   }
392   
393   GNUNET_CRYPTO_rsa_key_get_public (key, &pkey);
394   GNUNET_CRYPTO_short_hash(&pkey, sizeof(pkey), &bob_hash);
395
396   rd.expiration_time = UINT64_MAX;
397   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
398   rd.data = &dave_hash;
399   rd.record_type = GNUNET_GNS_RECORD_PKEY;
400   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
401
402   GNUNET_NAMESTORE_record_create (nh[1], key, "buddy", &rd, &cont_ns, nh[1]);
403
404   GNUNET_CRYPTO_rsa_key_free(key);
405   GNUNET_free(keyfile);
406   bob_is_setup = GNUNET_YES;
407   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up bob done\n");
408   return GNUNET_OK;
409 }
410
411 static int
412 setup_alice (const struct GNUNET_CONFIGURATION_Handle * cfg)
413 {
414   char* keyfile;
415   struct GNUNET_CRYPTO_RsaPrivateKey *key;
416   struct GNUNET_NAMESTORE_RecordData rd;
417
418   cfg_handles[2] = GNUNET_CONFIGURATION_dup (cfg);
419   GNUNET_assert (NULL != cfg);
420   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (cfg, "gns",
421                                                             "ZONEKEY",
422                                                             &keyfile))
423   {
424     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
425     return GNUNET_SYSERR;
426   }
427
428   key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
429   if (NULL == key)
430   {
431
432     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to get key from cfg\n");
433     GNUNET_free (keyfile);
434     return GNUNET_SYSERR;
435   }
436
437   nh[2] = GNUNET_NAMESTORE_connect (cfg_handles[2]);
438   if (NULL == nh[2])
439   {
440     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to namestore\n");
441     GNUNET_CRYPTO_rsa_key_free (key);
442     GNUNET_free (keyfile);
443     return GNUNET_SYSERR;
444   }
445
446   rd.expiration_time = UINT64_MAX;
447   rd.data_size = sizeof(struct GNUNET_CRYPTO_ShortHashCode);
448   rd.data = &bob_hash;
449   rd.record_type = GNUNET_GNS_RECORD_PKEY;
450   rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
451
452   GNUNET_NAMESTORE_record_create (nh[2], key, "bob", &rd, &cont_ns, nh[2]);
453
454   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up alice gns\n");
455   gh = GNUNET_GNS_connect (cfg_handles[2]);
456   if (NULL == gh)
457   {
458     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Failed to connect to gns\n");
459     GNUNET_CRYPTO_rsa_key_free (key);
460     GNUNET_free (keyfile);
461     return GNUNET_SYSERR;
462   }
463
464   GNUNET_CRYPTO_rsa_key_free (key);
465   GNUNET_free (keyfile);
466   alice_is_setup = GNUNET_YES;
467   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up alice  done\n");
468   return GNUNET_OK;
469 }
470
471 static void
472 end_badly_now ()
473 {
474   if (GNUNET_SCHEDULER_NO_TASK != die_task)
475     GNUNET_SCHEDULER_cancel (die_task);
476   die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
477 }
478
479
480 /**
481  * Callback to be called when the requested peer information is available
482  *
483  * @param cb_cls the closure from GNUNET_TETSBED_peer_get_information()
484  * @param op the operation this callback corresponds to
485  * @param pinfo the result; will be NULL if the operation has failed
486  * @param emsg error message if the operation has failed; will be NULL if the
487  *          operation is successfull
488  */
489 static void 
490 peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
491              const struct GNUNET_TESTBED_PeerInformation *pinfo,
492              const char *emsg)
493 {
494   int res;
495   GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit);
496   if (GNUNET_NO == dave_is_setup)
497     res = setup_dave (pinfo->result.cfg);
498   else if (GNUNET_NO == bob_is_setup)
499     res = setup_bob (pinfo->result.cfg);
500   else
501     res = setup_alice (pinfo->result.cfg);
502   
503   if (get_cfg_ops[0] == op)
504     get_cfg_ops[0] = NULL;
505   else if (get_cfg_ops[1] == op)
506     get_cfg_ops[1] = NULL;
507   else
508     get_cfg_ops[2] = NULL;
509   GNUNET_TESTBED_operation_done (op);
510   op = NULL;
511   if (GNUNET_SYSERR == res)
512   {
513     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup peer \n");
514     end_badly_now();
515   }
516   else
517     connect_peers ();
518   /*if (get_cfg_ops[0] == op)
519   {
520     GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit);
521     res = setup_dave (pinfo->result.cfg);
522     GNUNET_TESTBED_operation_done (get_cfg_ops[0]);
523     get_cfg_ops[0] = NULL;
524     if (GNUNET_SYSERR == res)
525     {
526       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup dave \n");
527       end_badly_now();
528     }
529     else
530     {
531       connect_peers ();
532     }
533   }
534   else if (get_cfg_ops[1] == op)
535   {
536     GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit);
537     res = setup_bob (pinfo->result.cfg);
538     GNUNET_TESTBED_operation_done (get_cfg_ops[1]);
539     get_cfg_ops[1] = NULL;
540     if (GNUNET_SYSERR == res)
541     {
542       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup dave \n");
543       end_badly_now();
544     }
545     else
546     {
547       connect_peers ();
548     }
549   }
550   else if (get_cfg_ops[2] == op)
551   {
552     GNUNET_assert (GNUNET_TESTBED_PIT_CONFIGURATION == pinfo->pit);
553     res = setup_alice (pinfo->result.cfg);
554     GNUNET_TESTBED_operation_done (get_cfg_ops[2]);
555     get_cfg_ops[2] = NULL;
556     if (GNUNET_SYSERR == res)
557     {
558       GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to setup dave \n");
559       end_badly_now();
560     }
561     else
562     {
563       connect_peers ();
564     }
565   }*/
566 }
567
568
569 void testbed_master (void *cls,
570                      unsigned int num_peers,
571                      struct GNUNET_TESTBED_Peer **peers)
572 {
573   GNUNET_assert (NULL != peers);
574   cpeers = peers;
575
576   /* peer 0: dave */
577   GNUNET_assert (NULL != peers[0]);
578   get_cfg_ops[0] = GNUNET_TESTBED_peer_get_information (peers[0],
579                                                         GNUNET_TESTBED_PIT_CONFIGURATION,
580                                                         &peerinfo_cb, NULL);
581
582   /* peer 1: bob */
583   GNUNET_assert (NULL != peers[1]);
584   get_cfg_ops[1] = GNUNET_TESTBED_peer_get_information (peers[1],
585                                                         GNUNET_TESTBED_PIT_CONFIGURATION,
586                                                         &peerinfo_cb, NULL );
587
588   /* peer 2: alice */
589   GNUNET_assert (NULL != peers[2]);
590   get_cfg_ops[2] = GNUNET_TESTBED_peer_get_information (peers[2],
591                                                         GNUNET_TESTBED_PIT_CONFIGURATION,
592                                                         &peerinfo_cb, NULL);
593
594 }
595
596 void testbed_controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
597 {
598   static int connections = 0;
599
600   switch (event->type)
601   {
602     case GNUNET_TESTBED_ET_OPERATION_FINISHED:
603       /* This part will still be called when
604          GNUNET_TESTBED_peer_get_information() succeeds. However, the code is
605          now more relevant in operation completion callback */
606       break;
607     case GNUNET_TESTBED_ET_CONNECT:
608       connections ++;
609       if (connections == 3)
610       {
611           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers connected\n");
612           GNUNET_TESTBED_operation_done (connect_ops[0]);
613           connect_ops[0] = NULL;
614           GNUNET_TESTBED_operation_done (connect_ops[1]);
615           connect_ops[1] = NULL;
616           GNUNET_TESTBED_operation_done (connect_ops[2]);
617           connect_ops[2] = NULL;
618           all_connected ();
619       }
620       break;
621     default:
622       /* whatever ... */
623       break;
624   }
625 }
626
627 int
628 main (int argc, char *argv[])
629 {
630   uint64_t event_mask;
631   ok = 0;
632   event_mask = 0;
633   event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
634   event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
635   (void) GNUNET_TESTBED_test_run ("test_gns_dht_three_peers", "test_gns_dht_default.conf",
636                                   3, event_mask,
637                                   &testbed_controller_cb, NULL,
638                                   &testbed_master, NULL);
639   if (GNUNET_SYSERR == ok)
640     return 1;
641   return 0;
642 }
643
644 /* end of test_gns_dht_three_peers.c */
645