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_ERROR, "setting bit %d of %d(!)\n", bitIdx, sizeof(bitmap) * 8);
136 GNUNET_assert(bitIdx < sizeof(bitmap) * 8);
137 arraySlot = bitIdx / 8;
138 targetBit = (1L << (bitIdx % 8));
139 bitmap[arraySlot] |= targetBit;
143 * Obtain a bit from bitmap.
144 * @param map the bitmap
145 * @param bit index from bitmap
147 * @return Bit \a bit from hashcode \a code
150 get_bit (const char *map, unsigned int bit)
152 if (bit >= TOTAL_MSGS)
154 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "get bit %d of %d(!?!?)\n", bit, sizeof(bitmap) * 8);
157 return ((map)[bit >> 3] & (1 << (bit & 7))) > 0;
163 unsigned long long delta;
169 for (i = 0; i < TOTAL_MSGS; i++)
171 if (get_bit(bitmap, i) == 0)
173 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Did not receive message %d\n", i);
178 GNUNET_SCHEDULER_cancel (die_task);
179 die_task = GNUNET_SCHEDULER_NO_TASK;
181 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
183 GNUNET_TRANSPORT_disconnect (p1.th);
184 GNUNET_TRANSPORT_disconnect (p2.th);
186 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
187 "Transports disconnected, returning success!\n");
189 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
190 GNUNET_asprintf(&value_name, "unreliable_kbs_%s", test_name);
191 GAUGER (value_name, (int)(total_bytes * 1000 / 1024 /delta));
192 GNUNET_free(value_name);
194 "\nThroughput was %llu kb/s\n",
195 total_bytes * 1000 / 1024 / delta);
203 unsigned long long delta;
208 for (i = 0; i < TOTAL_MSGS; i++)
210 if (get_bit(bitmap, i) == 0)
212 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Did not receive message %d\n", i);
217 die_task = GNUNET_SCHEDULER_NO_TASK;
219 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
221 GNUNET_TRANSPORT_disconnect (p1.th);
222 GNUNET_TRANSPORT_disconnect (p2.th);
224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
225 "Transports disconnected, returning success!\n");
227 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
229 "\nThroughput was %llu kb/s\n",
230 total_bytes * 1000 / 1024 / delta);
231 GNUNET_asprintf(&value_name, "unreliable_kbs_%s", test_name);
232 GAUGER (value_name, (int)(total_bytes * 1000 / 1024 /delta));
233 GNUNET_free(value_name);
234 GNUNET_asprintf(&value_name, "unreliable_failed_%s", test_name);
235 GAUGER (value_name, (int)num_failed);
236 GNUNET_free(value_name);
237 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Had %d failed messages!\n", num_failed);
245 stop_arm (struct PeerContext *p)
248 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
249 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
250 GNUNET_OS_process_wait (p->arm_proc);
251 GNUNET_OS_process_close (p->arm_proc);
254 GNUNET_CONFIGURATION_destroy (p->cfg);
259 end_badly (void *cls,
260 const struct GNUNET_SCHEDULER_TaskContext *tc)
262 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
263 "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);
265 GNUNET_TRANSPORT_disconnect (p1.th);
266 GNUNET_TRANSPORT_disconnect (p2.th);
273 struct GNUNET_MessageHeader header;
279 get_size (unsigned int iter)
284 return iter + sizeof (struct TestMessage);
285 ret = (iter * iter * iter);
286 return sizeof (struct TestMessage) + (ret % 60000);
291 notify_receive (void *cls,
292 const struct GNUNET_PeerIdentity *peer,
293 const struct GNUNET_MessageHeader *message,
294 const struct GNUNET_TRANSPORT_ATS_Information *ats,
299 char cbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
300 const struct TestMessage *hdr;
302 hdr = (const struct TestMessage*) message;
304 if (MTYPE != ntohs (message->type))
306 msg_recv_expected = n;
307 msg_recv = ntohl(hdr->num);
308 s = get_size (ntohl(hdr->num));
310 if (ntohs (message->size) != s)
312 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
313 "Expected message %u of size %u, got %u bytes of message %u\n",
315 ntohs (message->size),
317 GNUNET_SCHEDULER_cancel (die_task);
318 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
322 memset (cbuf, ntohl(hdr->num), s - sizeof (struct TestMessage));
323 if (0 != memcmp (cbuf,
325 s - sizeof (struct TestMessage)))
327 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
328 "Expected message %u with bits %u, but body did not match\n",
329 ntohl(hdr->num), (unsigned char) n);
330 GNUNET_SCHEDULER_cancel (die_task);
331 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
335 if (ntohl(hdr->num) % 5 == 0)
337 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
338 "Got message %u of size %u\n",
340 ntohs (message->size));
344 set_bit(ntohl(hdr->num));
345 if (0 == (n % (5000)))
347 fprintf (stderr, ".");
348 GNUNET_SCHEDULER_cancel (die_task);
349 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
359 notify_ready (void *cls, size_t size, void *buf)
363 struct TestMessage hdr;
375 GNUNET_assert (size >= s);
376 GNUNET_assert (buf != NULL);
380 hdr.header.size = htons (s);
381 hdr.header.type = htons (MTYPE);
384 memcpy (&cbuf[ret], &hdr, sizeof (struct TestMessage));
385 ret += sizeof (struct TestMessage);
386 memset (&cbuf[ret], n, s - sizeof (struct TestMessage));
387 ret += s - sizeof (struct TestMessage);
391 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
392 "Sending message %u of size %u\n",
399 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
400 break; /* sometimes pack buffer full, sometimes not */
402 while (size - ret >= s);
405 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
414 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent!!\n");
415 GNUNET_SCHEDULER_cancel(die_task);
416 die_task = GNUNET_SCHEDULER_add_delayed (UNRELIABLE_TIMEOUT, &end_unreliably, NULL);
420 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
421 "Returning total message block of size %u\n",
430 notify_connect (void *cls,
431 const struct GNUNET_PeerIdentity *peer,
432 const struct GNUNET_TRANSPORT_ATS_Information *ats,
437 GNUNET_TRANSPORT_set_quota (p1.th,
439 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
440 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
441 GNUNET_TIME_UNIT_FOREVER_REL,
443 start_time = GNUNET_TIME_absolute_get ();
448 GNUNET_TRANSPORT_set_quota (p2.th,
450 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
451 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
452 GNUNET_TIME_UNIT_FOREVER_REL,
460 if ((transmit_handle!=NULL) && (cls == NULL))
461 GNUNET_TRANSPORT_notify_transmit_ready_cancel(transmit_handle);
462 if ((transmit_handle!=NULL) && (cls == &transmit_handle))
463 transmit_handle=NULL;
464 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
466 get_size (0), 0, TIMEOUT,
471 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
472 "Peer `%4s' connected to us (%p)!\n", GNUNET_i2s (peer), cls);
478 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
481 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
482 "Peer `%4s' disconnected (%p)!\n",
483 GNUNET_i2s (peer), cls);
489 setup_peer (struct PeerContext *p, const char *cfgname)
491 p->cfg = GNUNET_CONFIGURATION_create ();
493 p->arm_proc = GNUNET_OS_start_process (NULL, NULL,
494 "gnunet-service-arm",
495 "gnunet-service-arm",
499 "-c", cfgname, NULL);
501 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
508 if (GNUNET_CONFIGURATION_have_value (p->cfg,
509 "transport-https", "KEY_FILE"))
510 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p1);
511 if (key_file_p1 == NULL)
512 GNUNET_asprintf(&key_file_p1,"https_p1.key");
513 if (0 == stat (key_file_p1, &sbuf ))
515 if (0 == remove(key_file_p1))
516 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p1);
518 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p1);
520 if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
521 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p1);
522 if (cert_file_p1 == NULL)
523 GNUNET_asprintf(&cert_file_p1,"https_p1.cert");
524 if (0 == stat (cert_file_p1, &sbuf ))
526 if (0 == remove(cert_file_p1))
527 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
529 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p1);
534 if (GNUNET_CONFIGURATION_have_value (p->cfg,
535 "transport-https", "KEY_FILE"))
536 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "KEY_FILE", &key_file_p2);
537 if (key_file_p2 == NULL)
538 GNUNET_asprintf(&key_file_p2,"https_p2.key");
539 if (0 == stat (key_file_p2, &sbuf ))
541 if (0 == remove(key_file_p2))
542 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing private key file `%s'\n",key_file_p2);
544 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove private key file `%s'\n",key_file_p2);
546 if (GNUNET_CONFIGURATION_have_value (p->cfg,"transport-https", "CERT_FILE"))
547 GNUNET_CONFIGURATION_get_value_string (p->cfg, "transport-https", "CERT_FILE", &cert_file_p2);
548 if (cert_file_p2 == NULL)
549 GNUNET_asprintf(&cert_file_p2,"https_p2.cert");
550 if (0 == stat (cert_file_p2, &sbuf ))
552 if (0 == remove(cert_file_p2))
553 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
555 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove existing certificate file `%s'\n",cert_file_p2);
560 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL,
565 GNUNET_assert (p->th != NULL);
569 notify_ready_connect (void *cls, size_t size, void *buf)
575 exchange_hello_last (void *cls,
576 const struct GNUNET_MessageHeader *message)
578 struct PeerContext *me = cls;
579 transmit_handle = NULL;
580 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, me);
582 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
583 "Exchanging HELLO with peer (%p)!\n", cls);
585 GNUNET_assert (ok >= 3);
587 GNUNET_assert (message != NULL);
588 GNUNET_assert (GNUNET_OK ==
589 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
592 GNUNET_assert(NULL != (transmit_handle = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
594 sizeof (struct GNUNET_MessageHeader), 0,
596 ¬ify_ready_connect,
599 /* both HELLOs exchanged, get ready to test transmission! */
600 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
601 "Finished exchanging HELLOs, now waiting for transmission!\n");
606 exchange_hello (void *cls,
607 const struct GNUNET_MessageHeader *message)
609 struct PeerContext *me = cls;
611 GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, me);
613 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
614 "Exchanging HELLO with peer (%p)!\n", cls);
616 GNUNET_assert (ok >= 2);
618 GNUNET_assert (message != NULL);
619 GNUNET_assert (GNUNET_OK ==
620 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
624 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
625 "Received HELLO size %d\n",
626 GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message));
628 GNUNET_TRANSPORT_offer_hello (p2.th, message);
629 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
633 * Return the actual path to a file found in the current
634 * PATH environment variable.
636 * @param binary the name of the file to find
639 get_path_from_PATH (char *binary)
650 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
651 _("PATH environment variable is unset.\n"));
654 path = GNUNET_strdup (p); /* because we write on it */
655 buf = GNUNET_malloc (strlen (path) + 20);
658 while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
661 sprintf (buf, "%s/%s", pos, binary);
662 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
669 sprintf (buf, "%s/%s", pos, binary);
670 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
681 * Check whether the suid bit is set on a file.
682 * Attempts to find the file using the current
683 * PATH environment variable as a search path.
685 * @param binary the name of the file to check
687 * @return GNUNET_YES if the binary is found and
688 * can be run properly, GNUNET_NO otherwise
691 check_gnunet_nat_binary(char *binary)
701 GNUNET_asprintf (&binaryexe, "%s.exe", binary);
702 p = get_path_from_PATH (binaryexe);
705 p = get_path_from_PATH (binary);
709 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
710 _("Could not find binary `%s' in PATH!\n"),
714 if (0 != STAT (p, &statbuf))
716 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
717 _("stat (%s) failed: %s\n"),
721 return GNUNET_SYSERR;
725 if ( (0 != (statbuf.st_mode & S_ISUID)) &&
726 (statbuf.st_uid == 0) )
730 rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);
731 if (INVALID_SOCKET == rawsock)
733 DWORD err = GetLastError ();
734 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
735 "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err);
736 return GNUNET_NO; /* not running as administrator */
738 closesocket (rawsock);
746 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
748 GNUNET_assert (ok == 1);
750 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
755 setup_peer (&p1, "test_transport_api_tcp_peer1.conf");
756 setup_peer (&p2, "test_transport_api_tcp_peer2.conf");
760 setup_peer (&p1, "test_transport_api_rel_http_peer1.conf");
761 setup_peer (&p2, "test_transport_api_rel_http_peer2.conf");
765 setup_peer (&p1, "test_transport_api_rel_https_peer1.conf");
766 setup_peer (&p2, "test_transport_api_rel_https_peer2.conf");
770 setup_peer (&p1, "test_transport_api_udp_peer1.conf");
771 setup_peer (&p2, "test_transport_api_udp_peer2.conf");
775 setup_peer (&p1, "test_transport_api_unix_peer1.conf");
776 setup_peer (&p2, "test_transport_api_unix_peer2.conf");
780 setup_peer (&p1, "test_transport_api_tcp_nat_peer1.conf");
781 setup_peer (&p2, "test_transport_api_tcp_nat_peer2.conf");
785 GNUNET_assert(p1.th != NULL);
786 GNUNET_assert(p2.th != NULL);
787 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
794 char *const argv[] = { "test-transport-api-reliability",
796 "test_transport_api_data.conf",
802 struct GNUNET_GETOPT_CommandLineOption options[] = {
803 GNUNET_GETOPT_OPTION_END
807 setTransportOptions("test_transport_api_data.conf");
811 if ((GNUNET_YES == is_tcp_nat) && (check_gnunet_nat_binary("gnunet-nat-server") != GNUNET_YES))
813 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Not running NAT test case, binaries not properly installed.\n");
817 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
818 argv, "test-transport-api-reliability", "nohelp",
826 if (0 == stat (cert_file_p1, &sbuf ))
828 if (0 == remove(cert_file_p1))
829 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
831 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p1);
834 if (0 == stat (key_file_p1, &sbuf ))
836 if (0 == remove(key_file_p1))
837 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p1);
839 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p1);
842 if (0 == stat (cert_file_p2, &sbuf ))
844 if (0 == remove(cert_file_p2))
845 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
847 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p2);
850 if (0 == stat (key_file_p2, &sbuf ))
852 if (0 == remove(key_file_p2))
853 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p2);
855 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p2);
857 GNUNET_free(key_file_p1);
858 GNUNET_free(key_file_p2);
859 GNUNET_free(cert_file_p1);
860 GNUNET_free(cert_file_p2);
868 main (int argc, char *argv[])
872 return GNUNET_SYSERR;
875 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
876 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
878 if (strstr(argv[0], "tcp_nat") != NULL)
880 is_tcp_nat = GNUNET_YES;
881 GNUNET_asprintf(&test_name, "tcp_nat");
883 else if (strstr(argv[0], "tcp") != NULL)
886 GNUNET_asprintf(&test_name, "tcp");
888 else if (strstr(argv[0], "https") != NULL)
890 is_https = GNUNET_YES;
891 GNUNET_asprintf(&test_name, "https");
893 else if (strstr(argv[0], "http") != NULL)
895 is_http = GNUNET_YES;
896 GNUNET_asprintf(&test_name, "http");
898 else if (strstr(argv[0], "udp") != NULL)
901 GNUNET_asprintf(&test_name, "udp");
903 else if (strstr(argv[0], "unix") != NULL)
905 is_unix = GNUNET_YES;
906 GNUNET_asprintf(&test_name, "unix");
908 GNUNET_log_setup ("test-transport-api-reliability",
916 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
917 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
918 GNUNET_free_non_null(test_name);
922 /* end of test_transport_api_reliability.c */