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;
93 static unsigned long long total_bytes;
95 static struct GNUNET_TIME_Absolute start_time;
97 static GNUNET_SCHEDULER_TaskIdentifier die_task;
99 static char *key_file_p1;
100 static char *cert_file_p1;
102 static char *key_file_p2;
103 static char *cert_file_p2;
105 static char *test_name;
107 static char bitmap[TOTAL_MSGS / 8];
109 static int msg_scheduled;
111 static int msg_recv_expected;
113 static struct GNUNET_TRANSPORT_TransmitHandle * transmit_handle;
116 #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
118 #define OKPP do { ok++; } while (0)
122 * Sets a bit active in the bitmap.
124 * @param bitIdx which bit to set
127 set_bit (unsigned int bitIdx)
130 unsigned int targetBit;
131 if (bitIdx >= sizeof(bitmap) * 8)
133 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "tried to set bit %d of %d(!?!?)\n", bitIdx, sizeof(bitmap) * 8);
136 arraySlot = bitIdx / 8;
137 targetBit = (1L << (bitIdx % 8));
138 bitmap[arraySlot] |= targetBit;
142 * Obtain a bit from bitmap.
143 * @param map the bitmap
144 * @param bit index from bitmap
146 * @return Bit \a bit from hashcode \a code
149 get_bit (const char *map, unsigned int bit)
151 if (bit >= TOTAL_MSGS)
153 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "get bit %d of %d(!?!?)\n", bit, sizeof(bitmap) * 8);
156 return ((map)[bit >> 3] & (1 << (bit & 7))) > 0;
162 unsigned long long delta;
168 for (i = 0; i < TOTAL_MSGS; i++)
170 if (get_bit(bitmap, i) == 0)
172 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Did not receive message %d\n", i);
177 GNUNET_SCHEDULER_cancel (die_task);
178 die_task = GNUNET_SCHEDULER_NO_TASK;
180 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
182 GNUNET_TRANSPORT_disconnect (p1.th);
183 GNUNET_TRANSPORT_disconnect (p2.th);
185 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
186 "Transports disconnected, returning success!\n");
188 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
189 GNUNET_asprintf(&value_name, "unreliable_%s", test_name);
190 GAUGER ("TRANSPORT", value_name, (int)(total_bytes * 1000 / 1024 /delta), "kb/s");
191 GNUNET_free(value_name);
193 "\nThroughput was %llu kb/s\n",
194 total_bytes * 1000 / 1024 / delta);
202 unsigned long long delta;
207 for (i = 0; i < TOTAL_MSGS; i++)
209 if (get_bit(bitmap, i) == 0)
211 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Did not receive message %d\n", i);
216 die_task = GNUNET_SCHEDULER_NO_TASK;
218 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
220 GNUNET_TRANSPORT_disconnect (p1.th);
221 GNUNET_TRANSPORT_disconnect (p2.th);
223 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
224 "Transports disconnected, returning success!\n");
226 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
228 "\nThroughput was %llu kb/s\n",
229 total_bytes * 1000 / 1024 / delta);
230 GNUNET_asprintf(&value_name, "unreliable_%s", test_name);
231 GAUGER ("TRANSPORT", value_name, (int)(total_bytes * 1000 / 1024 /delta), "kb/s");
232 GNUNET_free(value_name);
233 GNUNET_asprintf(&value_name, "unreliable_failed_%s", test_name);
234 GAUGER ("TRANSPORT", value_name, (int)num_failed, "msgs");
235 GNUNET_free(value_name);
236 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Had %d failed messages!\n", num_failed);
244 stop_arm (struct PeerContext *p)
247 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
248 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
249 GNUNET_OS_process_wait (p->arm_proc);
250 GNUNET_OS_process_close (p->arm_proc);
253 GNUNET_CONFIGURATION_destroy (p->cfg);
258 end_badly (void *cls,
259 const struct GNUNET_SCHEDULER_TaskContext *tc)
261 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
262 "Reliability failed: \nLast message sent %u \nNext message scheduled %u\nLast message received %u\nMessage expected %u \n ", msg_sent, msg_scheduled, msg_recv, msg_recv_expected);
264 GNUNET_TRANSPORT_disconnect (p1.th);
265 GNUNET_TRANSPORT_disconnect (p2.th);
272 struct GNUNET_MessageHeader header;
278 get_size (unsigned int iter)
283 return iter + sizeof (struct TestMessage);
284 ret = (iter * iter * iter);
285 return sizeof (struct TestMessage) + (ret % 60000);
290 notify_receive (void *cls,
291 const struct GNUNET_PeerIdentity *peer,
292 const struct GNUNET_MessageHeader *message,
293 const struct GNUNET_TRANSPORT_ATS_Information *ats,
298 char cbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
299 const struct TestMessage *hdr;
301 hdr = (const struct TestMessage*) message;
303 if (MTYPE != ntohs (message->type))
305 msg_recv_expected = n;
306 msg_recv = ntohl(hdr->num);
307 s = get_size (ntohl(hdr->num));
309 if (ntohs (message->size) != s)
311 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
312 "Expected message %u of size %u, got %u bytes of message %u\n",
314 ntohs (message->size),
316 GNUNET_SCHEDULER_cancel (die_task);
317 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
321 memset (cbuf, ntohl(hdr->num), s - sizeof (struct TestMessage));
322 if (0 != memcmp (cbuf,
324 s - sizeof (struct TestMessage)))
326 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
327 "Expected message %u with bits %u, but body did not match\n",
328 ntohl(hdr->num), (unsigned char) n);
329 GNUNET_SCHEDULER_cancel (die_task);
330 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
334 if (ntohl(hdr->num) % 5 == 0)
336 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
337 "Got message %u of size %u\n",
339 ntohs (message->size));
343 set_bit(ntohl(hdr->num));
344 if (0 == (n % (5000)))
346 fprintf (stderr, ".");
347 GNUNET_SCHEDULER_cancel (die_task);
348 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
358 notify_ready (void *cls, size_t size, void *buf)
362 struct TestMessage hdr;
374 GNUNET_assert (size >= s);
375 GNUNET_assert (buf != NULL);
379 hdr.header.size = htons (s);
380 hdr.header.type = htons (MTYPE);
383 memcpy (&cbuf[ret], &hdr, sizeof (struct TestMessage));
384 ret += sizeof (struct TestMessage);
385 memset (&cbuf[ret], n, s - sizeof (struct TestMessage));
386 ret += s - sizeof (struct TestMessage);
390 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
391 "Sending message %u of size %u\n",
398 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
399 break; /* sometimes pack buffer full, sometimes not */
401 while (size - ret >= s);
404 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
413 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent!!\n");
414 GNUNET_SCHEDULER_cancel(die_task);
415 die_task = GNUNET_SCHEDULER_add_delayed (UNRELIABLE_TIMEOUT, &end_unreliably, NULL);
419 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
420 "Returning total message block of size %u\n",
429 notify_connect (void *cls,
430 const struct GNUNET_PeerIdentity *peer,
431 const struct GNUNET_TRANSPORT_ATS_Information *ats,
436 GNUNET_TRANSPORT_set_quota (p1.th,
438 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
439 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
440 GNUNET_TIME_UNIT_FOREVER_REL,
442 start_time = GNUNET_TIME_absolute_get ();
447 GNUNET_TRANSPORT_set_quota (p2.th,
449 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
450 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
451 GNUNET_TIME_UNIT_FOREVER_REL,
459 if ((transmit_handle!=NULL) && (cls == NULL))
460 GNUNET_TRANSPORT_notify_transmit_ready_cancel(transmit_handle);
461 if ((transmit_handle!=NULL) && (cls == &transmit_handle))
462 transmit_handle=NULL;
463 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
465 get_size (0), 0, TIMEOUT,
470 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
471 "Peer `%4s' connected to us (%p)!\n", GNUNET_i2s (peer), cls);
477 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
480 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
481 "Peer `%4s' disconnected (%p)!\n",
482 GNUNET_i2s (peer), cls);
488 setup_peer (struct PeerContext *p, const char *cfgname)
490 p->cfg = GNUNET_CONFIGURATION_create ();
492 p->arm_proc = GNUNET_OS_start_process (NULL, NULL,
493 "gnunet-service-arm",
494 "gnunet-service-arm",
498 "-c", cfgname, NULL);
500 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
507 if (GNUNET_CONFIGURATION_have_value (p->cfg,
508 "transport-https", "KEY_FILE"))
509 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p1);
510 if (key_file_p1 == NULL)
511 GNUNET_asprintf(&key_file_p1,"https_p1.key");
512 if (0 == stat (key_file_p1, &sbuf ))
514 if (0 == remove(key_file_p1))
515 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p1);
517 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p1);
519 if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
520 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p1);
521 if (cert_file_p1 == NULL)
522 GNUNET_asprintf(&cert_file_p1,"https_p1.cert");
523 if (0 == stat (cert_file_p1, &sbuf ))
525 if (0 == remove(cert_file_p1))
526 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
528 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p1);
533 if (GNUNET_CONFIGURATION_have_value (p->cfg,
534 "transport-https", "KEY_FILE"))
535 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p2);
536 if (key_file_p2 == NULL)
537 GNUNET_asprintf(&key_file_p2,"https_p2.key");
538 if (0 == stat (key_file_p2, &sbuf ))
540 if (0 == remove(key_file_p2))
541 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p2);
543 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p2);
545 if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
546 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p2);
547 if (cert_file_p2 == NULL)
548 GNUNET_asprintf(&cert_file_p2,"https_p2.cert");
549 if (0 == stat (cert_file_p2, &sbuf ))
551 if (0 == remove(cert_file_p2))
552 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
554 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p2);
559 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL,
564 GNUNET_assert (p->th != NULL);
568 notify_ready_connect (void *cls, size_t size, void *buf)
574 exchange_hello_last (void *cls,
575 const struct GNUNET_MessageHeader *message)
577 struct PeerContext *me = cls;
578 transmit_handle = NULL;
579 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me);
581 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
582 "Exchanging HELLO with peer (%p)!\n", cls);
584 GNUNET_assert (ok >= 3);
586 GNUNET_assert (message != NULL);
587 GNUNET_assert (GNUNET_OK ==
588 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
591 GNUNET_assert(NULL != (transmit_handle = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
593 sizeof (struct GNUNET_MessageHeader), 0,
595 ¬ify_ready_connect,
598 /* both HELLOs exchanged, get ready to test transmission! */
599 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
600 "Finished exchanging HELLOs, now waiting for transmission!\n");
605 exchange_hello (void *cls,
606 const struct GNUNET_MessageHeader *message)
608 struct PeerContext *me = cls;
610 GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, me);
612 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
613 "Exchanging HELLO with peer (%p)!\n", cls);
615 GNUNET_assert (ok >= 2);
617 GNUNET_assert (message != NULL);
618 GNUNET_assert (GNUNET_OK ==
619 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
623 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
624 "Received HELLO size %d\n",
625 GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message));
627 GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
628 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
632 * Return the actual path to a file found in the current
633 * PATH environment variable.
635 * @param binary the name of the file to find
638 get_path_from_PATH (char *binary)
649 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
650 _("PATH environment variable is unset.\n"));
653 path = GNUNET_strdup (p); /* because we write on it */
654 buf = GNUNET_malloc (strlen (path) + 20);
657 while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
660 sprintf (buf, "%s/%s", pos, binary);
661 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
668 sprintf (buf, "%s/%s", pos, binary);
669 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
680 * Check whether the suid bit is set on a file.
681 * Attempts to find the file using the current
682 * PATH environment variable as a search path.
684 * @param binary the name of the file to check
686 * @return GNUNET_YES if the binary is found and
687 * can be run properly, GNUNET_NO otherwise
690 check_gnunet_nat_binary(char *binary)
700 GNUNET_asprintf (&binaryexe, "%s.exe", binary);
701 p = get_path_from_PATH (binaryexe);
704 p = get_path_from_PATH (binary);
708 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
709 _("Could not find binary `%s' in PATH!\n"),
713 if (0 != STAT (p, &statbuf))
715 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
716 _("stat (%s) failed: %s\n"),
720 return GNUNET_SYSERR;
724 if ( (0 != (statbuf.st_mode & S_ISUID)) &&
725 (statbuf.st_uid == 0) )
729 rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);
730 if (INVALID_SOCKET == rawsock)
732 DWORD err = GetLastError ();
733 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
734 "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err);
735 return GNUNET_NO; /* not running as administrator */
737 closesocket (rawsock);
745 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
747 GNUNET_assert (ok == 1);
749 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
754 setup_peer (&p1, "test_transport_api_tcp_peer1.conf");
755 setup_peer (&p2, "test_transport_api_tcp_peer2.conf");
759 setup_peer (&p1, "test_transport_api_rel_http_peer1.conf");
760 setup_peer (&p2, "test_transport_api_rel_http_peer2.conf");
764 setup_peer (&p1, "test_transport_api_rel_https_peer1.conf");
765 setup_peer (&p2, "test_transport_api_rel_https_peer2.conf");
769 setup_peer (&p1, "test_transport_api_udp_peer1.conf");
770 setup_peer (&p2, "test_transport_api_udp_peer2.conf");
774 setup_peer (&p1, "test_transport_api_unix_peer1.conf");
775 setup_peer (&p2, "test_transport_api_unix_peer2.conf");
779 setup_peer (&p1, "test_transport_api_tcp_nat_peer1.conf");
780 setup_peer (&p2, "test_transport_api_tcp_nat_peer2.conf");
784 GNUNET_assert(p1.th != NULL);
785 GNUNET_assert(p2.th != NULL);
786 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
793 char *const argv[] = { "test-transport-api-reliability",
795 "test_transport_api_data.conf",
801 struct GNUNET_GETOPT_CommandLineOption options[] = {
802 GNUNET_GETOPT_OPTION_END
806 setTransportOptions("test_transport_api_data.conf");
810 if ((GNUNET_YES == is_tcp_nat) && (check_gnunet_nat_binary("gnunet-nat-server") != GNUNET_YES))
812 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Not running NAT test case, binaries not properly installed.\n");
816 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
817 argv, "test-transport-api-reliability", "nohelp",
825 if (0 == stat (cert_file_p1, &sbuf ))
827 if (0 == remove(cert_file_p1))
828 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
830 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p1);
833 if (0 == stat (key_file_p1, &sbuf ))
835 if (0 == remove(key_file_p1))
836 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p1);
838 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p1);
841 if (0 == stat (cert_file_p2, &sbuf ))
843 if (0 == remove(cert_file_p2))
844 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
846 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p2);
849 if (0 == stat (key_file_p2, &sbuf ))
851 if (0 == remove(key_file_p2))
852 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p2);
854 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p2);
856 GNUNET_free(key_file_p1);
857 GNUNET_free(key_file_p2);
858 GNUNET_free(cert_file_p1);
859 GNUNET_free(cert_file_p2);
867 main (int argc, char *argv[])
871 return GNUNET_SYSERR;
874 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
875 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
877 if (strstr(argv[0], "tcp_nat") != NULL)
879 is_tcp_nat = GNUNET_YES;
880 GNUNET_asprintf(&test_name, "tcp_nat");
882 else if (strstr(argv[0], "tcp") != NULL)
885 GNUNET_asprintf(&test_name, "tcp");
887 else if (strstr(argv[0], "https") != NULL)
889 is_https = GNUNET_YES;
890 GNUNET_asprintf(&test_name, "https");
892 else if (strstr(argv[0], "http") != NULL)
894 is_http = GNUNET_YES;
895 GNUNET_asprintf(&test_name, "http");
897 else if (strstr(argv[0], "udp") != NULL)
900 GNUNET_asprintf(&test_name, "udp");
902 else if (strstr(argv[0], "unix") != NULL)
904 is_unix = GNUNET_YES;
905 GNUNET_asprintf(&test_name, "unix");
907 GNUNET_log_setup ("test-transport-api-reliability",
915 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
916 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
917 GNUNET_free_non_null(test_name);
921 /* end of test_transport_api_reliability.c */