2 This file is part of GNUnet.
3 (C) 2009, 2010 Christian Grothoff (and other contributing authors)
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.
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.
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.
21 * @file transport/test_transport_api_unreliability.c
22 * @brief test case for transports; ensures messages get
23 * through, regardless of order
25 * This test case serves as a base for unreliable
26 * transport test cases to check that the transports
27 * achieve reliable message delivery.
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_server_lib.h"
37 #include "gnunet_transport_service.h"
39 #include "transport.h"
41 #define VERBOSE GNUNET_NO
43 #define VERBOSE_ARM GNUNET_NO
45 #define START_ARM GNUNET_YES
48 * Note that this value must not significantly exceed
49 * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise
50 * messages may be dropped even for a reliable transport.
52 #define TOTAL_MSGS (80000 * 3) /* Total messages should be divisible by 8, so we can make a nice bitmap */
55 * How long until we give up on transmitting the message?
57 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1500)
59 #define UNRELIABLE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
65 struct GNUNET_CONFIGURATION_Handle *cfg;
66 struct GNUNET_TRANSPORT_Handle *th;
67 struct GNUNET_PeerIdentity id;
69 struct GNUNET_OS_Process *arm_proc;
73 static struct PeerContext p1;
75 static struct PeerContext p2;
81 static int is_tcp_nat;
95 static unsigned long long total_bytes;
97 static struct GNUNET_TIME_Absolute start_time;
99 static GNUNET_SCHEDULER_TaskIdentifier die_task;
101 static GNUNET_SCHEDULER_TaskIdentifier tct;
103 static char *key_file_p1;
104 static char *cert_file_p1;
106 static char *key_file_p2;
107 static char *cert_file_p2;
109 static char *test_name;
111 static char bitmap[TOTAL_MSGS / 8];
113 static int msg_scheduled;
115 static int msg_recv_expected;
119 * Sets a bit active in the bitmap.
121 * @param bitIdx which bit to set
124 set_bit (unsigned int bitIdx)
127 unsigned int targetBit;
128 if (bitIdx >= sizeof(bitmap) * 8)
130 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "tried to set bit %d of %d(!?!?)\n", bitIdx, sizeof(bitmap) * 8);
133 arraySlot = bitIdx / 8;
134 targetBit = (1L << (bitIdx % 8));
135 bitmap[arraySlot] |= targetBit;
139 * Obtain a bit from bitmap.
140 * @param map the bitmap
141 * @param bit index from bitmap
143 * @return Bit \a bit from hashcode \a code
146 get_bit (const char *map, unsigned int bit)
148 if (bit >= TOTAL_MSGS)
150 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "get bit %d of %d(!?!?)\n", bit, sizeof(bitmap) * 8);
153 return ((map)[bit >> 3] & (1 << (bit & 7))) > 0;
159 unsigned long long delta;
165 for (i = 0; i < TOTAL_MSGS; i++)
167 if (get_bit(bitmap, i) == 0)
169 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Did not receive message %d\n", i);
174 GNUNET_SCHEDULER_cancel (die_task);
175 die_task = GNUNET_SCHEDULER_NO_TASK;
177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
179 GNUNET_TRANSPORT_disconnect (p1.th);
180 GNUNET_TRANSPORT_disconnect (p2.th);
182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
183 "Transports disconnected, returning success!\n");
185 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
186 GNUNET_asprintf(&value_name, "unreliable_%s", test_name);
187 GAUGER ("TRANSPORT", value_name, (int)(total_bytes * 1000 / 1024 /delta), "kb/s");
188 GNUNET_free(value_name);
190 "\nThroughput was %llu kb/s\n",
191 total_bytes * 1000 / 1024 / delta);
199 unsigned long long delta;
204 for (i = 0; i < TOTAL_MSGS; i++)
206 if (get_bit(bitmap, i) == 0)
208 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Did not receive message %d\n", i);
213 die_task = GNUNET_SCHEDULER_NO_TASK;
215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
217 GNUNET_TRANSPORT_disconnect (p1.th);
218 GNUNET_TRANSPORT_disconnect (p2.th);
220 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
221 "Transports disconnected, returning success!\n");
223 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
225 "\nThroughput was %llu kb/s\n",
226 total_bytes * 1000 / 1024 / delta);
227 GNUNET_asprintf(&value_name, "unreliable_%s", test_name);
228 GAUGER ("TRANSPORT", value_name, (int)(total_bytes * 1000 / 1024 /delta), "kb/s");
229 GNUNET_free(value_name);
230 GNUNET_asprintf(&value_name, "unreliable_failed_%s", test_name);
231 GAUGER ("TRANSPORT", value_name, (int)num_failed, "msgs");
232 GNUNET_free(value_name);
233 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Had %d failed messages!\n", num_failed);
241 stop_arm (struct PeerContext *p)
244 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
245 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
246 GNUNET_OS_process_wait (p->arm_proc);
247 GNUNET_OS_process_close (p->arm_proc);
250 GNUNET_CONFIGURATION_destroy (p->cfg);
255 end_badly (void *cls,
256 const struct GNUNET_SCHEDULER_TaskContext *tc)
258 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
259 "Reliability failed: Last message sent %u Next message scheduled %u Last message received %u Message expected %u\n",
265 GNUNET_TRANSPORT_disconnect (p1.th);
266 GNUNET_TRANSPORT_disconnect (p2.th);
268 if (GNUNET_SCHEDULER_NO_TASK != tct)
270 GNUNET_SCHEDULER_cancel (tct);
271 tct = GNUNET_SCHEDULER_NO_TASK;
279 struct GNUNET_MessageHeader header;
285 get_size (unsigned int iter)
290 return iter + sizeof (struct TestMessage);
291 ret = (iter * iter * iter);
292 return sizeof (struct TestMessage) + (ret % 60000);
297 notify_receive (void *cls,
298 const struct GNUNET_PeerIdentity *peer,
299 const struct GNUNET_MessageHeader *message,
300 const struct GNUNET_TRANSPORT_ATS_Information *ats,
305 char cbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
306 const struct TestMessage *hdr;
308 hdr = (const struct TestMessage*) message;
310 if (MTYPE != ntohs (message->type))
312 msg_recv_expected = n;
313 msg_recv = ntohl(hdr->num);
314 s = get_size (ntohl(hdr->num));
316 if (ntohs (message->size) != s)
318 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
319 "Expected message %u of size %u, got %u bytes of message %u\n",
321 ntohs (message->size),
323 GNUNET_SCHEDULER_cancel (die_task);
324 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
328 memset (cbuf, ntohl(hdr->num), s - sizeof (struct TestMessage));
329 if (0 != memcmp (cbuf,
331 s - sizeof (struct TestMessage)))
333 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
334 "Expected message %u with bits %u, but body did not match\n",
335 ntohl(hdr->num), (unsigned char) n);
336 GNUNET_SCHEDULER_cancel (die_task);
337 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
341 if (ntohl(hdr->num) % 5 == 0)
343 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
344 "Got message %u of size %u\n",
346 ntohs (message->size));
350 set_bit(ntohl(hdr->num));
351 if (0 == (n % (5000)))
353 fprintf (stderr, ".");
354 GNUNET_SCHEDULER_cancel (die_task);
355 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
365 notify_ready (void *cls, size_t size, void *buf)
369 struct TestMessage hdr;
381 GNUNET_assert (size >= s);
382 GNUNET_assert (buf != NULL);
386 hdr.header.size = htons (s);
387 hdr.header.type = htons (MTYPE);
390 memcpy (&cbuf[ret], &hdr, sizeof (struct TestMessage));
391 ret += sizeof (struct TestMessage);
392 memset (&cbuf[ret], n, s - sizeof (struct TestMessage));
393 ret += s - sizeof (struct TestMessage);
397 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
398 "Sending message %u of size %u\n",
405 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
406 break; /* sometimes pack buffer full, sometimes not */
408 while (size - ret >= s);
411 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
420 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent!!\n");
421 GNUNET_SCHEDULER_cancel(die_task);
422 die_task = GNUNET_SCHEDULER_add_delayed (UNRELIABLE_TIMEOUT, &end_unreliably, NULL);
426 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
427 "Returning total message block of size %u\n",
437 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
441 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
442 "Peer `%4s' disconnected (%p)!\n",
443 GNUNET_i2s (peer), cls);
450 exchange_hello_last (void *cls,
451 const struct GNUNET_MessageHeader *message)
453 struct PeerContext *me = cls;
455 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
456 "Exchanging HELLO of size %d with peer (%s)!\n",
457 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message),
458 GNUNET_i2s (&me->id));
459 GNUNET_assert (message != NULL);
460 GNUNET_assert (GNUNET_OK ==
461 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
463 GNUNET_TRANSPORT_offer_hello (p1.th, message, NULL, NULL);
469 exchange_hello (void *cls,
470 const struct GNUNET_MessageHeader *message)
472 struct PeerContext *me = cls;
474 GNUNET_assert (message != NULL);
475 GNUNET_assert (GNUNET_OK ==
476 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
478 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
479 "Exchanging HELLO of size %d from peer %s!\n",
480 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message),
481 GNUNET_i2s (&me->id));
482 GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
487 notify_connect (void *cls,
488 const struct GNUNET_PeerIdentity *peer,
489 const struct GNUNET_TRANSPORT_ATS_Information *ats,
492 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
493 "Peer `%4s' connected to us (%p)!\n",
498 GNUNET_TRANSPORT_set_quota (p1.th,
500 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
501 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
502 start_time = GNUNET_TIME_absolute_get ();
507 GNUNET_TRANSPORT_set_quota (p2.th,
509 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
510 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
515 GNUNET_SCHEDULER_cancel (die_task);
516 GNUNET_SCHEDULER_cancel (tct);
517 tct = GNUNET_SCHEDULER_NO_TASK;
518 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2);
519 GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1);
520 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
522 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
524 get_size (0), 0, TIMEOUT,
533 setup_peer (struct PeerContext *p, const char *cfgname)
535 p->cfg = GNUNET_CONFIGURATION_create ();
537 p->arm_proc = GNUNET_OS_start_process (NULL, NULL,
538 "gnunet-service-arm",
539 "gnunet-service-arm",
543 "-c", cfgname, NULL);
545 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
552 if (GNUNET_CONFIGURATION_have_value (p->cfg,
553 "transport-https", "KEY_FILE"))
554 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p1);
555 if (key_file_p1 == NULL)
556 GNUNET_asprintf(&key_file_p1,"https_p1.key");
557 if (0 == stat (key_file_p1, &sbuf ))
559 if (0 == remove(key_file_p1))
560 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p1);
562 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p1);
564 if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
565 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p1);
566 if (cert_file_p1 == NULL)
567 GNUNET_asprintf(&cert_file_p1,"https_p1.cert");
568 if (0 == stat (cert_file_p1, &sbuf ))
570 if (0 == remove(cert_file_p1))
571 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
573 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p1);
578 if (GNUNET_CONFIGURATION_have_value (p->cfg,
579 "transport-https", "KEY_FILE"))
580 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p2);
581 if (key_file_p2 == NULL)
582 GNUNET_asprintf(&key_file_p2,"https_p2.key");
583 if (0 == stat (key_file_p2, &sbuf ))
585 if (0 == remove(key_file_p2))
586 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p2);
588 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p2);
590 if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
591 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p2);
592 if (cert_file_p2 == NULL)
593 GNUNET_asprintf(&cert_file_p2,"https_p2.cert");
594 if (0 == stat (cert_file_p2, &sbuf ))
596 if (0 == remove(cert_file_p2))
597 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
599 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p2);
604 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL,
609 GNUNET_assert (p->th != NULL);
614 * Return the actual path to a file found in the current
615 * PATH environment variable.
617 * @param binary the name of the file to find
620 get_path_from_PATH (char *binary)
631 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
632 _("PATH environment variable is unset.\n"));
635 path = GNUNET_strdup (p); /* because we write on it */
636 buf = GNUNET_malloc (strlen (path) + 20);
639 while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
642 sprintf (buf, "%s/%s", pos, binary);
643 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
650 sprintf (buf, "%s/%s", pos, binary);
651 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
662 * Check whether the suid bit is set on a file.
663 * Attempts to find the file using the current
664 * PATH environment variable as a search path.
666 * @param binary the name of the file to check
668 * @return GNUNET_YES if the binary is found and
669 * can be run properly, GNUNET_NO otherwise
672 check_gnunet_nat_binary(char *binary)
682 GNUNET_asprintf (&binaryexe, "%s.exe", binary);
683 p = get_path_from_PATH (binaryexe);
686 p = get_path_from_PATH (binary);
690 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
691 _("Could not find binary `%s' in PATH!\n"),
695 if (0 != STAT (p, &statbuf))
697 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
698 _("stat (%s) failed: %s\n"),
702 return GNUNET_SYSERR;
706 if ( (0 != (statbuf.st_mode & S_ISUID)) &&
707 (statbuf.st_uid == 0) )
711 rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);
712 if (INVALID_SOCKET == rawsock)
714 DWORD err = GetLastError ();
715 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
716 "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err);
717 return GNUNET_NO; /* not running as administrator */
719 closesocket (rawsock);
726 try_connect (void *cls,
727 const struct GNUNET_SCHEDULER_TaskContext *tc)
729 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
730 "Asking peers to connect...\n");
731 GNUNET_TRANSPORT_try_connect (p2.th,
733 GNUNET_TRANSPORT_try_connect (p1.th,
735 tct = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
745 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
747 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
752 setup_peer (&p1, "test_transport_api_tcp_peer1.conf");
753 setup_peer (&p2, "test_transport_api_tcp_peer2.conf");
757 setup_peer (&p1, "test_transport_api_rel_http_peer1.conf");
758 setup_peer (&p2, "test_transport_api_rel_http_peer2.conf");
762 setup_peer (&p1, "test_transport_api_rel_https_peer1.conf");
763 setup_peer (&p2, "test_transport_api_rel_https_peer2.conf");
767 setup_peer (&p1, "test_transport_api_udp_peer1.conf");
768 setup_peer (&p2, "test_transport_api_udp_peer2.conf");
772 setup_peer (&p1, "test_transport_api_unix_peer1.conf");
773 setup_peer (&p2, "test_transport_api_unix_peer2.conf");
777 setup_peer (&p1, "test_transport_api_tcp_nat_peer1.conf");
778 setup_peer (&p2, "test_transport_api_tcp_nat_peer2.conf");
782 setup_peer (&p1, "test_transport_api_wlan_peer1.conf");
783 setup_peer (&p2, "test_transport_api_wlan_peer2.conf");
787 GNUNET_assert(p1.th != NULL);
788 GNUNET_assert(p2.th != NULL);
789 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
790 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
791 tct = GNUNET_SCHEDULER_add_now (&try_connect, NULL);
798 char *const argv[] = { "test-transport-api-reliability",
800 "test_transport_api_data.conf",
806 struct GNUNET_GETOPT_CommandLineOption options[] = {
807 GNUNET_GETOPT_OPTION_END
811 setTransportOptions("test_transport_api_data.conf");
815 if ((GNUNET_YES == is_tcp_nat) && (check_gnunet_nat_binary("gnunet-nat-server") != GNUNET_YES))
817 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Not running NAT test case, binaries not properly installed.\n");
821 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
822 argv, "test-transport-api-reliability", "nohelp",
830 if (0 == stat (cert_file_p1, &sbuf ))
832 if (0 == remove(cert_file_p1))
833 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
835 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p1);
838 if (0 == stat (key_file_p1, &sbuf ))
840 if (0 == remove(key_file_p1))
841 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p1);
843 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p1);
846 if (0 == stat (cert_file_p2, &sbuf ))
848 if (0 == remove(cert_file_p2))
849 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
851 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p2);
854 if (0 == stat (key_file_p2, &sbuf ))
856 if (0 == remove(key_file_p2))
857 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p2);
859 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p2);
861 GNUNET_free(key_file_p1);
862 GNUNET_free(key_file_p2);
863 GNUNET_free(cert_file_p1);
864 GNUNET_free(cert_file_p2);
872 main (int argc, char *argv[])
876 return GNUNET_SYSERR;
879 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
880 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
882 if (strstr(argv[0], "tcp_nat") != NULL)
884 is_tcp_nat = GNUNET_YES;
885 GNUNET_asprintf(&test_name, "tcp_nat");
887 else if (strstr(argv[0], "tcp") != NULL)
890 GNUNET_asprintf(&test_name, "tcp");
892 else if (strstr(argv[0], "https") != NULL)
894 is_https = GNUNET_YES;
895 GNUNET_asprintf(&test_name, "https");
897 else if (strstr(argv[0], "http") != NULL)
899 is_http = GNUNET_YES;
900 GNUNET_asprintf(&test_name, "http");
902 else if (strstr(argv[0], "udp") != NULL)
905 GNUNET_asprintf(&test_name, "udp");
907 else if (strstr(argv[0], "unix") != NULL)
909 is_unix = GNUNET_YES;
910 GNUNET_asprintf(&test_name, "unix");
912 else if (strstr(argv[0], "wlan") != NULL)
914 is_wlan = GNUNET_YES;
916 GNUNET_log_setup ("test-transport-api-reliability",
924 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
925 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
926 GNUNET_free_non_null(test_name);
930 /* end of test_transport_api_reliability.c */