-modify timeout values further
[oweals/gnunet.git] / src / dht / test_dht_monitor.c
1 /*
2      This file is part of GNUnet.
3      (C) 2011 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 dht/test_dht_monitor.c
22  *
23  * @brief Test for the dht service: store, retrieve and monitor in a line.
24  * TODO: update this description
25  * Each peer stores it own ID in the DHT and then a different peer tries to
26  * retrieve that key from it. The GET starts after a first round of PUTS has
27  * been made. Periodically, each peer stores its ID into the DHT. If after
28  * a timeout no result has been returned, the test fails.
29  */
30 #include "platform.h"
31 #include "gnunet_testing_lib.h"
32 #include "gnunet_dht_service.h"
33
34 #define REMOVE_DIR GNUNET_YES
35
36
37 /**
38  * How long until we give up on connecting the peers?
39  */
40 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1500)
41
42 #define GET_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120)
43
44 #define PUT_FREQUENCY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
45
46 static int ok;
47
48 /**
49  * Be verbose
50  */
51 static int verbose;
52
53 /**
54  * Total number of peers in the test.
55  */
56 static unsigned long long num_peers;
57
58 /**
59  * Global configuration file
60  */
61 static struct GNUNET_CONFIGURATION_Handle *testing_cfg;
62
63 /**
64  * Total number of currently running peers.
65  */
66 static unsigned long long peers_running;
67
68 /**
69  * Total number of connections in the whole network.
70  */
71 static unsigned int total_connections;
72
73 /**
74  * The currently running peer group.
75  */
76 static struct GNUNET_TESTING_PeerGroup *pg;
77
78 /**
79  * File to report results to.
80  */
81 static struct GNUNET_DISK_FileHandle *output_file;
82
83 /**
84  * File to log connection info, statistics to.
85  */
86 static struct GNUNET_DISK_FileHandle *data_file;
87
88 /**
89  * Task called to disconnect peers.
90  */
91 static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
92
93 /**
94  * Task To perform tests
95  */
96 static GNUNET_SCHEDULER_TaskIdentifier test_task;
97
98 /**
99  * Task to do DHT_puts
100  */
101 static GNUNET_SCHEDULER_TaskIdentifier put_task;
102
103 /**
104  * Task called to shutdown test.
105  */
106 static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
107
108 static char *topology_file;
109
110 struct GNUNET_TESTING_Daemon *d1;
111
112 struct GNUNET_TESTING_Daemon *d2;
113
114 struct GNUNET_DHT_Handle **hs;
115
116 struct GNUNET_DHT_MonitorHandle **mhs;
117
118 struct GNUNET_DHT_GetHandle *get_h_far;
119
120 const char *id_origin = "FC74";
121 const char *id_far = "2UVH";
122
123 struct GNUNET_TESTING_Daemon *d_far;
124 struct GNUNET_TESTING_Daemon *o;
125
126 unsigned int monitor_counter;
127
128 int in_test;
129
130 /**
131  * Check whether peers successfully shut down.
132  */
133 static void
134 shutdown_callback (void *cls, const char *emsg)
135 {
136   if (emsg != NULL)
137   {
138     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: Shutdown of peers failed: %s\n",
139                 emsg);
140     ok++;
141   }
142   else
143   {
144     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
145                 "test: All peers successfully shut down!\n");
146   }
147   GNUNET_CONFIGURATION_destroy (testing_cfg);
148 }
149
150
151 static void
152 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
153 {
154   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n");
155   if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
156   {
157     GNUNET_SCHEDULER_cancel (disconnect_task);
158     disconnect_task = GNUNET_SCHEDULER_NO_TASK;
159   }
160   if (data_file != NULL)
161     GNUNET_DISK_file_close (data_file);
162   GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
163 }
164
165
166 static void
167 disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
168 {
169   unsigned int i;
170
171   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: disconnecting peers\n");
172   disconnect_task = GNUNET_SCHEDULER_NO_TASK;
173   GNUNET_SCHEDULER_cancel (put_task);
174   if (NULL != get_h_far)
175     GNUNET_DHT_get_stop (get_h_far);
176   for (i = 0; i < num_peers; i++)
177   {
178     GNUNET_DHT_monitor_stop(mhs[i]);
179     GNUNET_DHT_disconnect (hs[i]);
180   }
181   GNUNET_SCHEDULER_cancel (shutdown_handle);
182   shutdown_handle = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
183 }
184
185
186 static void
187 dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
188                     const struct GNUNET_HashCode * key,
189                     const struct GNUNET_PeerIdentity *get_path,
190                     unsigned int get_path_length,
191                     const struct GNUNET_PeerIdentity *put_path,
192                     unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
193                     size_t size, const void *data)
194 {
195   int i;
196
197   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
198               "test: ************* FOUND!!! ***********\n");
199   if (sizeof (struct GNUNET_HashCode) == size)
200   {
201     const struct GNUNET_HashCode *h = data;
202
203     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test:   Contents: %s\n",
204                 GNUNET_h2s_full (h));
205
206   }
207   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: PATH: (get %u, put %u)\n",
208               get_path_length, put_path_length);
209   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test:   LOCAL\n");
210   for (i = get_path_length - 1; i >= 0; i--)
211   {
212     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test:   %s\n",
213                 GNUNET_i2s (&get_path[i]));
214   }
215   for (i = put_path_length - 1; i >= 0; i--)
216   {
217     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test:   %s\n",
218                 GNUNET_i2s (&put_path[i]));
219   }
220   if (monitor_counter >= get_path_length + put_path_length)
221   {
222     ok = 0;
223     GNUNET_log (GNUNET_ERROR_TYPE_INFO, "expected at least %u hops, got %u\n",
224                 get_path_length + put_path_length, monitor_counter);
225   }
226   else
227     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "expected at least %u hops, got %u\n",
228                 get_path_length + put_path_length, monitor_counter);
229   GNUNET_SCHEDULER_cancel (disconnect_task);
230   disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL);
231 }
232
233
234 /**
235  * Start test: start GET request from the first node in the line looking for
236  * the ID of the last node in the line.
237  * 
238  * @param cls Closure (not used).
239  * @param tc Task context.
240  */
241 static void
242 do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
243 {
244   if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
245   {
246     return;
247   }
248   
249   in_test = GNUNET_YES;
250   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: test_task\n");
251   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: looking for %s\n",
252               GNUNET_h2s_full (&d_far->id.hashPubKey));
253   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test:        from %s\n",
254               GNUNET_h2s_full (&o->id.hashPubKey));
255   get_h_far = GNUNET_DHT_get_start (hs[0], 
256                                     GNUNET_BLOCK_TYPE_TEST,     /* type */
257                                     &d_far->id.hashPubKey,      /*key to search */
258                                     4U, /* replication level */
259                                     GNUNET_DHT_RO_RECORD_ROUTE | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, NULL,    /* xquery */
260                                     0,  /* xquery bits */
261                                     &dht_get_id_handler, NULL);
262   GNUNET_SCHEDULER_cancel (disconnect_task);
263   disconnect_task =
264       GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &disconnect_peers, NULL);
265 }
266
267
268 /**
269  * Periodic function used to put the ID of the far peer in the DHT.
270  * 
271  * @param cls Closure (not used).
272  * @param tc Task context.
273  */
274 static void
275 put_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
276 {
277   struct GNUNET_TESTING_Daemon *d;
278
279   if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
280   {
281     put_task = GNUNET_SCHEDULER_NO_TASK;
282     return;
283   }
284
285   d = GNUNET_TESTING_daemon_get (pg, 4);
286   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: putting into DHT: %s\n",
287               GNUNET_h2s_full (&d->id.hashPubKey));
288   GNUNET_DHT_put (hs[4], &d->id.hashPubKey, 10U,
289                   GNUNET_DHT_RO_RECORD_ROUTE |
290                   GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE,
291                   GNUNET_BLOCK_TYPE_TEST, sizeof (struct GNUNET_PeerIdentity),
292                   (const char *) &d->id, GNUNET_TIME_UNIT_FOREVER_ABS,
293                   GNUNET_TIME_UNIT_FOREVER_REL, NULL, NULL);
294
295   put_task = GNUNET_SCHEDULER_add_delayed (PUT_FREQUENCY, &put_id, NULL);
296 }
297
298
299 /**
300  * Callback called on each GET request going through the DHT.
301  * Prints the info about the intercepted packet and increments a counter.
302  *
303  * @param cls Closure.
304  * @param options Options, for instance RecordRoute, DemultiplexEverywhere.
305  * @param type The type of data in the request.
306  * @param hop_count Hop count so far.
307  * @param path_length number of entries in path (or 0 if not recorded).
308  * @param path peers on the GET path (or NULL if not recorded).
309  * @param desired_replication_level Desired replication level.
310  * @param key Key of the requested data.
311  */
312 static void
313 monitor_get_cb (void *cls,
314                 enum GNUNET_DHT_RouteOption options,
315                 enum GNUNET_BLOCK_Type type,
316                 uint32_t hop_count,
317                 uint32_t desired_replication_level,
318                 unsigned int path_length,
319                 const struct GNUNET_PeerIdentity *path,
320                 const struct GNUNET_HashCode * key)
321 {
322   const char *s_key;
323   unsigned int i;
324
325   i = (unsigned int) (long) cls;
326   s_key = GNUNET_h2s(key);
327   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
328               "%u got a GET message for key %s\n",
329               i, s_key);
330
331   if (strncmp (s_key, id_far, 4) == 0 && in_test == GNUNET_YES)
332     monitor_counter++;
333 }
334
335
336 /**
337  * Callback called on each PUT request going through the DHT.
338  * Prints the info about the intercepted packet and increments a counter.
339  *
340  * @param cls Closure.
341  * @param options Options, for instance RecordRoute, DemultiplexEverywhere.
342  * @param type The type of data in the request.
343  * @param hop_count Hop count so far.
344  * @param path_length number of entries in path (or 0 if not recorded).
345  * @param path peers on the PUT path (or NULL if not recorded).
346  * @param desired_replication_level Desired replication level.
347  * @param exp Expiration time of the data.
348  * @param key Key under which data is to be stored.
349  * @param data Pointer to the data carried.
350  * @param size Number of bytes in data.
351  */
352 static void
353 monitor_put_cb (void *cls,
354                 enum GNUNET_DHT_RouteOption options,
355                 enum GNUNET_BLOCK_Type type,
356                 uint32_t hop_count,
357                 uint32_t desired_replication_level,
358                 unsigned int path_length,
359                 const struct GNUNET_PeerIdentity *path,
360                 struct GNUNET_TIME_Absolute exp,
361                 const struct GNUNET_HashCode * key,
362                 const void *data,
363                 size_t size)
364 {
365   const char *s_key;
366   unsigned int i;
367
368   i = (unsigned int) (long) cls;
369   s_key = GNUNET_h2s(key);
370
371   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
372               "%u got a PUT message for key %s with %u bytes\n",
373               i, s_key, size);
374
375   if (strncmp (s_key, id_far, 4) == 0 && in_test == GNUNET_YES)
376     monitor_counter++;
377 }
378
379
380 /**
381  * Callback called on each GET reply going through the DHT.
382  * Prints the info about the intercepted packet and increments a counter.
383  *
384  * @param cls Closure.
385  * @param type The type of data in the result.
386  * @param get_path Peers on GET path (or NULL if not recorded).
387  * @param get_path_length number of entries in get_path.
388  * @param put_path peers on the PUT path (or NULL if not recorded).
389  * @param put_path_length number of entries in get_path.
390  * @param exp Expiration time of the data.
391  * @param key Key of the data.
392  * @param data Pointer to the result data.
393  * @param size Number of bytes in data.
394  */
395 static void
396 monitor_res_cb (void *cls,
397                 enum GNUNET_BLOCK_Type type,
398                 const struct GNUNET_PeerIdentity *get_path,
399                 unsigned int get_path_length,
400                 const struct GNUNET_PeerIdentity *put_path,
401                 unsigned int put_path_length,
402                 struct GNUNET_TIME_Absolute exp,
403                 const struct GNUNET_HashCode * key,
404                 const void *data,
405                 size_t size)
406 {
407   const char *s_key;
408   unsigned int i;
409
410   i = (unsigned int) (long) cls;
411   s_key = GNUNET_h2s(key);
412   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
413               "%u got a REPLY message for key %s with %u bytes\n",
414               i, s_key, size);
415
416   if (strncmp (s_key, id_far, 4) == 0 && in_test == GNUNET_YES)
417     monitor_counter++;
418 }
419
420
421 /**
422  * peergroup_ready: start test when all peers are connected
423  *
424  * @param cls closure
425  * @param emsg error message
426  */
427 static void
428 peergroup_ready (void *cls, const char *emsg)
429 {
430   struct GNUNET_TESTING_Daemon *d;
431   char *buf;
432   int buf_len;
433   unsigned int i;
434
435   if (emsg != NULL)
436   {
437     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
438                 "test: Peergroup callback called with error, aborting test!\n");
439     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Error from testing: `%s'\n",
440                 emsg);
441     ok++;
442     GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
443     return;
444   }
445   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
446               "test: Peer Group started successfully with %u connections\n",
447               total_connections);
448   if (data_file != NULL)
449   {
450     buf = NULL;
451     buf_len = GNUNET_asprintf (&buf, "CONNECTIONS_0: %u\n", total_connections);
452     if (buf_len > 0)
453       GNUNET_DISK_file_write (data_file, buf, buf_len);
454     GNUNET_free (buf);
455   }
456   peers_running = GNUNET_TESTING_daemons_running (pg);
457
458   GNUNET_assert (peers_running == num_peers);
459   hs = GNUNET_malloc (num_peers * sizeof (struct GNUNET_DHT_Handle *));
460   mhs = GNUNET_malloc (num_peers * sizeof (struct GNUNET_DHT_MonitorHandle *));
461   d_far = o = NULL;
462   o = GNUNET_TESTING_daemon_get (pg, 0);
463   d_far = GNUNET_TESTING_daemon_get (pg, 4);
464
465   for (i = 0; i < num_peers; i++)
466   {
467     d = GNUNET_TESTING_daemon_get (pg, i);
468     hs[i] = GNUNET_DHT_connect (d->cfg, 32);
469     mhs[i] = GNUNET_DHT_monitor_start(hs[i],
470                                       GNUNET_BLOCK_TYPE_ANY,
471                                       NULL,
472                                       &monitor_get_cb,
473                                       &monitor_res_cb,
474                                       &monitor_put_cb,
475                                       (void *)(long)i);
476   }
477
478   if ((NULL == o) || (NULL == d_far))
479   {
480     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
481                 "test: Error getting daemons from pg\n");
482     GNUNET_SCHEDULER_cancel (disconnect_task);
483     disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL);
484     return;
485   }
486   monitor_counter = 0;
487   put_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
488                                            (GNUNET_TIME_UNIT_SECONDS, 3),
489                                            &put_id, NULL);
490   test_task =
491       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
492                                     (GNUNET_TIME_UNIT_SECONDS, 6), &do_test,
493                                     NULL);
494   disconnect_task =
495       GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &disconnect_peers, NULL);
496
497 }
498
499
500 /**
501  * Function that will be called whenever two daemons are connected by
502  * the testing library.
503  *
504  * @param cls closure
505  * @param first peer id for first daemon
506  * @param second peer id for the second daemon
507  * @param distance distance between the connected peers
508  * @param first_cfg config for the first daemon
509  * @param second_cfg config for the second daemon
510  * @param first_daemon handle for the first daemon
511  * @param second_daemon handle for the second daemon
512  * @param emsg error message (NULL on success)
513  */
514 static void
515 connect_cb (void *cls, const struct GNUNET_PeerIdentity *first,
516             const struct GNUNET_PeerIdentity *second, uint32_t distance,
517             const struct GNUNET_CONFIGURATION_Handle *first_cfg,
518             const struct GNUNET_CONFIGURATION_Handle *second_cfg,
519             struct GNUNET_TESTING_Daemon *first_daemon,
520             struct GNUNET_TESTING_Daemon *second_daemon, const char *emsg)
521 {
522
523   if (emsg == NULL)
524   {
525     total_connections++;
526     GNUNET_PEER_intern (first);
527     GNUNET_PEER_intern (second);
528   }
529   else
530   {
531     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
532                 "test: Problem with new connection (%s)\n", emsg);
533   }
534
535 }
536
537
538 /**
539  * run: load configuration options and schedule test to run (start peergroup)
540  * @param cls closure
541  * @param args argv
542  * @param cfgfile configuration file name (can be NULL)
543  * @param cfg configuration handle
544  */
545 static void
546 run (void *cls, char *const *args, const char *cfgfile,
547      const struct GNUNET_CONFIGURATION_Handle *cfg)
548 {
549   char *temp_str;
550   struct GNUNET_TESTING_Host *hosts;
551   char *data_filename;
552
553   ok = 1;
554   testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
555
556   GNUNET_log_setup ("test_dht_monitor",
557                     "WARNING",
558                     NULL);
559
560   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n");
561   GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing_old",
562                                          "use_progressbars", "YES");
563   if (GNUNET_OK !=
564       GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing_old",
565                                              "num_peers", &num_peers))
566   {
567     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
568                 "Option TESTING:NUM_PEERS is required!\n");
569     return;
570   }
571
572   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (testing_cfg, "testing_old",
573                                              "topology_output_file",
574                                              &topology_file))
575   {
576     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
577                 "Option test_dht_monitor:topology_output_file is required!\n");
578     return;
579   }
580
581   if (GNUNET_OK ==
582       GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_dht_topo",
583                                              "data_output_file",
584                                              &data_filename))
585   {
586     data_file =
587         GNUNET_DISK_file_open (data_filename,
588                                GNUNET_DISK_OPEN_READWRITE |
589                                GNUNET_DISK_OPEN_CREATE,
590                                GNUNET_DISK_PERM_USER_READ |
591                                GNUNET_DISK_PERM_USER_WRITE);
592     if (data_file == NULL)
593     {
594       GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
595                   data_filename);
596       GNUNET_free (data_filename);
597     }
598   }
599
600   if (GNUNET_YES ==
601       GNUNET_CONFIGURATION_get_value_string (cfg, "test_dht_topo",
602                                              "output_file", &temp_str))
603   {
604     output_file =
605         GNUNET_DISK_file_open (temp_str,
606                                GNUNET_DISK_OPEN_READWRITE |
607                                GNUNET_DISK_OPEN_CREATE,
608                                GNUNET_DISK_PERM_USER_READ |
609                                GNUNET_DISK_PERM_USER_WRITE);
610     if (output_file == NULL)
611       GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
612                   temp_str);
613   }
614   GNUNET_free_non_null (temp_str);
615
616   hosts = GNUNET_TESTING_hosts_load (testing_cfg);
617
618   pg = GNUNET_TESTING_peergroup_start (testing_cfg, num_peers, TIMEOUT,
619                                        &connect_cb, &peergroup_ready, NULL,
620                                        hosts);
621   GNUNET_assert (pg != NULL);
622   shutdown_handle =
623       GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
624                                     &shutdown_task, NULL);
625 }
626
627
628
629 /**
630  * test_dht_monitor command line options
631  */
632 static struct GNUNET_GETOPT_CommandLineOption options[] = {
633   {'V', "verbose", NULL,
634    gettext_noop ("be verbose (print progress information)"),
635    0, &GNUNET_GETOPT_set_one, &verbose},
636   GNUNET_GETOPT_OPTION_END
637 };
638
639
640 /**
641  * Main: start test
642  */
643 int
644 main (int xargc, char *xargv[])
645 {
646   char *const argv[] = { "test-dht-monitor",
647     "-c",
648     "test_dht_line.conf",
649     NULL
650   };
651
652   in_test = GNUNET_NO;
653   GNUNET_PROGRAM_run (sizeof (argv) / sizeof (char *) - 1, argv,
654                       "test_dht_monitor",
655                       gettext_noop ("Test dht monitoring in a line."),
656                       options, &run, NULL);
657 #if REMOVE_DIR
658   GNUNET_DISK_directory_remove ("/tmp/test_dht_monitor");
659 #endif
660   if (0 != ok)
661   {
662     GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED!\n");
663   }
664   return ok;
665 }
666
667 /* end of test_dht_monitor.c */