wlan changes
[oweals/gnunet.git] / src / transport / test_transport_api.c
1 /*
2      This file is part of GNUnet.
3      (C) 2009, 2010 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 transport/test_transport_api.c
22  * @brief base test case for transport implementations
23  *
24  * This test case serves as a base for tcp, udp, and udp-nat
25  * transport test cases.  Based on the executable being run
26  * the correct test case will be performed.  Conservation of
27  * C code apparently.
28  */
29 #include "platform.h"
30 #include "gnunet_common.h"
31 #include "gnunet_hello_lib.h"
32 #include "gnunet_getopt_lib.h"
33 #include "gnunet_os_lib.h"
34 #include "gnunet_program_lib.h"
35 #include "gnunet_scheduler_lib.h"
36 #include "gnunet_transport_service.h"
37 #include "transport.h"
38
39 #define VERBOSE GNUNET_YES
40
41 #define VERBOSE_ARM GNUNET_NO
42
43 #define START_ARM GNUNET_YES
44
45 /**
46  * How long until we give up on transmitting the message?
47  */
48 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 300)
49
50 /**
51  * How long until we give up on transmitting the message?
52  */
53 #define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
54
55 #define MTYPE 12345
56
57 struct PeerContext
58 {
59   struct GNUNET_CONFIGURATION_Handle *cfg;
60   struct GNUNET_TRANSPORT_Handle *th;
61   struct GNUNET_PeerIdentity id;
62 #if START_ARM
63   struct GNUNET_OS_Process *arm_proc;
64 #endif
65 };
66
67 static struct PeerContext p1;
68
69 static struct PeerContext p2;
70
71 static int ok;
72
73 static int is_tcp;
74
75 static int is_tcp_nat;
76
77 static int is_udp;
78
79 static int is_udp_nat;
80
81 static int is_http;
82
83 static int is_https;
84
85 static int is_multi_protocol;
86
87 static int is_wlan;
88
89 static  GNUNET_SCHEDULER_TaskIdentifier die_task;
90
91 static char * key_file_p1;
92 static char * cert_file_p1;
93
94 static char * key_file_p2;
95 static char * cert_file_p2;
96
97 #if VERBOSE
98 #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
99 #else
100 #define OKPP do { ok++; } while (0)
101 #endif
102
103
104 static void
105 end ()
106 {
107   /* do work here */
108   GNUNET_assert (ok == 6);
109   GNUNET_SCHEDULER_cancel (die_task);
110   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
111   GNUNET_TRANSPORT_disconnect (p1.th);
112   GNUNET_TRANSPORT_disconnect (p2.th);
113
114   die_task = GNUNET_SCHEDULER_NO_TASK;
115   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transports disconnected, returning success!\n");
116   ok = 0;
117 }
118
119 static void
120 stop_arm (struct PeerContext *p)
121 {
122 #if START_ARM
123   if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
124     GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
125   GNUNET_OS_process_wait (p->arm_proc);
126   GNUNET_OS_process_close (p->arm_proc);
127   p->arm_proc = NULL;
128 #endif
129   GNUNET_CONFIGURATION_destroy (p->cfg);
130 }
131
132
133 static void
134 end_badly ()
135 {
136   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
137   GNUNET_break (0);
138   GNUNET_TRANSPORT_disconnect (p1.th);
139   GNUNET_TRANSPORT_disconnect (p2.th);
140   ok = 1;
141 }
142
143 static void
144 notify_receive (void *cls,
145                 const struct GNUNET_PeerIdentity *peer,
146                 const struct GNUNET_MessageHeader *message,
147                 const struct GNUNET_TRANSPORT_ATS_Information *ats,
148                 uint32_t ats_count)
149 {
150   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok is (%d)!\n",
151               ok);
152
153   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %d from peer (%p)!\n",
154                 ntohs(message->type), cls);
155
156   GNUNET_assert (ok == 5);
157   OKPP;
158
159   GNUNET_assert (MTYPE == ntohs (message->type));
160   GNUNET_assert (sizeof (struct GNUNET_MessageHeader) ==
161                  ntohs (message->size));
162   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from peer (%p)!\n",
163               cls);
164   end ();
165 }
166
167
168 static size_t
169 notify_ready (void *cls, size_t size, void *buf)
170 {
171   struct GNUNET_MessageHeader *hdr;
172
173   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
174               "Transmitting message to peer (%p) - %u!\n", cls, sizeof (struct GNUNET_MessageHeader));
175   GNUNET_assert (size >= 256);
176   GNUNET_assert (ok == 4);
177   OKPP;
178
179   if (buf != NULL)
180   {
181     hdr = buf;
182     hdr->size = htons (sizeof (struct GNUNET_MessageHeader));
183     hdr->type = htons (MTYPE);
184   }
185
186   return sizeof (struct GNUNET_MessageHeader);
187 }
188
189 static size_t
190 notify_ready_connect (void *cls, size_t size, void *buf)
191 {
192   return 0;
193 }
194
195
196 static void
197 notify_connect (void *cls,
198                 const struct GNUNET_PeerIdentity *peer,
199                 const struct GNUNET_TRANSPORT_ATS_Information *ats,
200                 uint32_t ats_count)
201 {
202   if (cls == &p1)
203     {
204       GNUNET_SCHEDULER_cancel (die_task);
205       die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT_TRANSMIT,
206                                                &end_badly, NULL);
207
208       GNUNET_TRANSPORT_notify_transmit_ready (p1.th,
209                                               &p2.id,
210                                               256, 0, TIMEOUT, &notify_ready,
211                                               &p1);
212     }
213   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
214               "Peer `%4s' connected to us (%p)!\n", GNUNET_i2s (peer), cls);
215 }
216
217
218 static void
219 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
220 {
221   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
222               "Peer `%4s' disconnected (%p)!\n",
223               GNUNET_i2s (peer), cls);
224 }
225
226
227 static void
228 setup_peer (struct PeerContext *p, const char *cfgname)
229 {
230   p->cfg = GNUNET_CONFIGURATION_create ();
231 #if START_ARM
232   p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
233                                         "gnunet-service-arm",
234 #if VERBOSE_ARM
235                                         "-L", "DEBUG",
236 #endif
237                                         "-c", cfgname, NULL);
238 #endif
239   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
240
241   if (is_https)
242   {
243           struct stat sbuf;
244           if (p==&p1)
245           {
246                   if (GNUNET_CONFIGURATION_have_value (p->cfg,
247                                                                                            "transport-https", "KEY_FILE"))
248                                 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p1);
249                   if (key_file_p1==NULL)
250                           GNUNET_asprintf(&key_file_p1,"https.key");
251                   if (0 == stat (key_file_p1, &sbuf ))
252                   {
253                           if (0 == remove(key_file_p1))
254                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p1);
255                           else
256                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p1);
257                   }
258                   if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
259                           GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p1);
260                   if (cert_file_p1==NULL)
261                           GNUNET_asprintf(&cert_file_p1,"https.cert");
262                   if (0 == stat (cert_file_p1, &sbuf ))
263                   {
264                           if (0 == remove(cert_file_p1))
265                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
266                           else
267                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p1);
268                   }
269           }
270           else if (p==&p2)
271           {
272                   if (GNUNET_CONFIGURATION_have_value (p->cfg,
273                                                                                            "transport-https", "KEY_FILE"))
274                                 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p2);
275                   if (key_file_p2==NULL)
276                           GNUNET_asprintf(&key_file_p2,"https.key");
277                   if (0 == stat (key_file_p2, &sbuf ))
278                   {
279                           if (0 == remove(key_file_p2))
280                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p2);
281                           else
282                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p2);
283                   }
284                   if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
285                           GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p2);
286                   if (cert_file_p2==NULL)
287                           GNUNET_asprintf(&cert_file_p2,"https.cert");
288                   if (0 == stat (cert_file_p2, &sbuf ))
289                   {
290                           if (0 == remove(cert_file_p2))
291                               GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
292                           else
293                                   GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p2);
294                   }
295           }
296   }
297
298   p->th = GNUNET_TRANSPORT_connect (p->cfg,
299                                     NULL, p,
300                                     &notify_receive,
301                                     &notify_connect, &notify_disconnect);
302   GNUNET_assert (p->th != NULL);
303 }
304
305
306 static void
307 exchange_hello_last (void *cls,
308                      const struct GNUNET_MessageHeader *message)
309 {
310   struct PeerContext *me = cls;
311
312   GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me);
313   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
314               "Exchanging HELLO with peer (%p)!\n", cls);
315   GNUNET_assert (ok >= 3);
316   OKPP;
317   GNUNET_assert (message != NULL);
318   GNUNET_assert (GNUNET_OK ==
319                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
320                                       message, &me->id));
321
322   GNUNET_assert(NULL != GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
323                                           &p1.id,
324                                           sizeof (struct GNUNET_MessageHeader), 0,
325                                           TIMEOUT,
326                                           &notify_ready_connect,
327                                           NULL));
328
329   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
330               "Finished exchanging HELLOs, now waiting for transmission!\n");
331 }
332
333 static void
334 exchange_hello (void *cls,
335                 const struct GNUNET_MessageHeader *message)
336 {
337   struct PeerContext *me = cls;
338
339   GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, me);
340   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
341               "Exchanging HELLO with peer (%p)!\n", cls);
342   GNUNET_assert (ok >= 2);
343   OKPP;
344   GNUNET_assert (message != NULL);
345   GNUNET_assert (GNUNET_OK ==
346                  GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
347                                       message, &me->id));
348
349   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
350               "Received HELLO size %d\n", GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message));
351
352   GNUNET_TRANSPORT_offer_hello (p2.th, message);
353   GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
354 }
355
356
357 static void
358 run (void *cls,
359      char *const *args,
360      const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
361 {
362   GNUNET_assert (ok == 1);
363   OKPP;
364   die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
365                                            &end_badly, NULL);
366
367   if (is_udp)
368     {
369       setup_peer (&p1, "test_transport_api_udp_peer1.conf");
370       setup_peer (&p2, "test_transport_api_udp_peer2.conf");
371     }
372   if (is_multi_protocol)
373     {
374       setup_peer (&p1, "test_transport_api_multi_peer1.conf");
375       setup_peer (&p2, "test_transport_api_multi_peer2.conf");
376     }
377   else if (is_tcp)
378     {
379       setup_peer (&p1, "test_transport_api_tcp_peer1.conf");
380       setup_peer (&p2, "test_transport_api_tcp_peer2.conf");
381     }
382   else if (is_tcp_nat)
383     {
384       setup_peer (&p1, "test_transport_api_tcp_nat_peer1.conf");
385       setup_peer (&p2, "test_transport_api_tcp_nat_peer2.conf");
386     }
387   else if (is_udp_nat)
388     {
389       setup_peer (&p1, "test_transport_api_udp_nat_peer1.conf");
390       setup_peer (&p2, "test_transport_api_udp_nat_peer2.conf");
391     }
392   else if (is_http)
393     {
394       setup_peer (&p1, "test_transport_api_http_peer1.conf");
395       setup_peer (&p2, "test_transport_api_http_peer2.conf");
396     }
397   else if (is_https)
398     {
399       setup_peer (&p1, "test_transport_api_https_peer1.conf");
400       setup_peer (&p2, "test_transport_api_https_peer2.conf");
401     }
402   else if (is_wlan)
403     {
404       setup_peer (&p1, "test_transport_api_wlan_peer1.conf");
405       setup_peer (&p2, "test_transport_api_wlan_peer2.conf");
406     }
407   GNUNET_assert(p1.th != NULL);
408   GNUNET_assert(p2.th != NULL);
409
410   GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
411 }
412
413 static int
414 check ()
415 {
416   static char *const argv[] = { "test-transport-api",
417     "-c",
418     "test_transport_api_data.conf",
419 #if VERBOSE
420     "-L", "DEBUG",
421 #endif
422     NULL
423   };
424   static struct GNUNET_GETOPT_CommandLineOption options[] = {
425     GNUNET_GETOPT_OPTION_END
426   };
427
428 #if WRITECONFIG
429   setTransportOptions("test_transport_api_data.conf");
430 #endif
431   ok = 1;
432   GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
433                       argv, "test-transport-api", "nohelp",
434                       options, &run, &ok);
435   stop_arm (&p1);
436   stop_arm (&p2);
437
438   if (is_https)
439   {
440           struct stat sbuf;
441           if (0 == stat (cert_file_p1, &sbuf ))
442           {
443                   if (0 == remove(cert_file_p1))
444                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
445                   else
446                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p1);
447           }
448
449           if (0 == stat (key_file_p1, &sbuf ))
450           {
451                   if (0 == remove(key_file_p1))
452                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p1);
453                   else
454                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p1);
455           }
456
457           if (0 == stat (cert_file_p2, &sbuf ))
458           {
459                   if (0 == remove(cert_file_p2))
460                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
461                   else
462                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p2);
463           }
464
465           if (0 == stat (key_file_p2, &sbuf ))
466           {
467                   if (0 == remove(key_file_p2))
468                           GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p2);
469                   else
470                           GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p2);
471           }
472           GNUNET_free(key_file_p1);
473           GNUNET_free(key_file_p2);
474           GNUNET_free(cert_file_p1);
475           GNUNET_free(cert_file_p2);
476   }
477   return ok;
478 }
479
480 /**
481  * Return the actual path to a file found in the current
482  * PATH environment variable.
483  *
484  * @param binary the name of the file to find
485  */
486 static char *
487 get_path_from_PATH (char *binary)
488 {
489   char *path;
490   char *pos;
491   char *end;
492   char *buf;
493   const char *p;
494
495   p = getenv ("PATH");
496   if (p == NULL)
497     {
498       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
499                   _("PATH environment variable is unset.\n"));
500       return NULL;
501     }
502   path = GNUNET_strdup (p);     /* because we write on it */
503   buf = GNUNET_malloc (strlen (path) + 20);
504   pos = path;
505
506   while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
507     {
508       *end = '\0';
509       sprintf (buf, "%s/%s", pos, binary);
510       if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
511         {
512           GNUNET_free (path);
513           return buf;
514         }
515       pos = end + 1;
516     }
517   sprintf (buf, "%s/%s", pos, binary);
518   if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
519     {
520       GNUNET_free (path);
521       return buf;
522     }
523   GNUNET_free (buf);
524   GNUNET_free (path);
525   return NULL;
526 }
527
528 /**
529  * Check whether the suid bit is set on a file.
530  * Attempts to find the file using the current
531  * PATH environment variable as a search path.
532  *
533  * @param binary the name of the file to check
534  *
535  * @return GNUNET_YES if the binary is found and
536  *         can be run properly, GNUNET_NO otherwise
537  */
538 static int
539 check_gnunet_nat_binary(char *binary)
540 {
541   struct stat statbuf;
542   char *p;
543 #ifdef MINGW
544   SOCKET rawsock;
545 #endif
546
547 #ifdef MINGW
548   char *binaryexe;
549   GNUNET_asprintf (&binaryexe, "%s.exe", binary);
550   p = get_path_from_PATH (binaryexe);
551   free (binaryexe);
552 #else
553   p = get_path_from_PATH (binary);
554 #endif
555   if (p == NULL)
556     {
557       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
558                   _("Could not find binary `%s' in PATH!\n"),
559                   binary);
560       return GNUNET_NO;
561     }
562   if (0 != STAT (p, &statbuf))
563     {
564       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
565                   _("stat (%s) failed: %s\n"),
566                   p,
567                   STRERROR (errno));
568       GNUNET_free (p);
569       return GNUNET_SYSERR;
570     }
571   GNUNET_free (p);
572 #ifndef MINGW
573   if ( (0 != (statbuf.st_mode & S_ISUID)) &&
574        (statbuf.st_uid == 0) )
575     return GNUNET_YES;
576   return GNUNET_NO;
577 #else
578   rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);
579   if (INVALID_SOCKET == rawsock)
580     {
581       DWORD err = GetLastError ();
582       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
583                   "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err);
584       return GNUNET_NO; /* not running as administrator */
585     }
586   closesocket (rawsock);
587   return GNUNET_YES;
588 #endif
589 }
590
591 int
592 main (int argc, char *argv[])
593 {
594   int ret;
595 #ifdef MINGW
596   return GNUNET_SYSERR;
597 #endif
598
599   GNUNET_log_setup ("test-transport-api",
600 #if VERBOSE
601                     "DEBUG",
602 #else
603                     "WARNING",
604 #endif
605                     NULL);
606
607   if (strstr(argv[0], "tcp_nat") != NULL)
608     {
609       is_tcp_nat = GNUNET_YES;
610       if (GNUNET_YES != check_gnunet_nat_binary("gnunet-nat-server"))
611         {
612           GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
613                       "`%s' not properly installed, cannot run NAT test!\n",
614                       "gnunet-nat-server");
615           return 0;
616         }
617     }
618   else if (strstr(argv[0], "tcp") != NULL)
619     {
620       is_tcp = GNUNET_YES;
621     }
622   else if (strstr(argv[0], "udp_nat") != NULL)
623     {
624       is_udp_nat = GNUNET_YES;
625       if (GNUNET_YES != check_gnunet_nat_binary("gnunet-nat-server"))
626         {
627           GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
628                       "`%s' not properly installed, cannot run NAT test!\n",
629                       "gnunet-nat-server");
630           return 0;
631         }
632     }
633   else if (strstr(argv[0], "udp") != NULL)
634     {
635       is_udp = GNUNET_YES;
636     }
637   else if (strstr(argv[0], "https") != NULL)
638     {
639       is_https = GNUNET_YES;
640     }
641   else if (strstr(argv[0], "http") != NULL)
642     {
643       is_http = GNUNET_YES;
644     }
645   else if (strstr(argv[0], "wlan") != NULL)
646     {
647        is_wlan = GNUNET_YES;
648     }
649   else if (strstr(argv[0], "multi") != NULL)
650     {
651        is_multi_protocol = GNUNET_YES;
652     }
653
654   ret = check ();
655   if (is_multi_protocol)
656   {
657          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-1/");
658          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-2/");
659   }
660   else
661   {
662          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
663          GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
664   }
665
666   return ret;
667 }
668
669 /* end of test_transport_api.c */