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"
40 #include "transport-testing.h"
42 #define VERBOSE GNUNET_NO
44 #define VERBOSE_ARM GNUNET_NO
46 #define START_ARM GNUNET_YES
49 * Note that this value must not significantly exceed
50 * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise
51 * messages may be dropped even for a reliable transport.
53 #define TOTAL_MSGS (1024 * 3) /* Total messages should be divisible by 8, so we can make a nice bitmap */
56 * How long until we give up on transmitting the message?
58 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1500)
60 #define UNRELIABLE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 1)
64 static struct PeerContext p1;
66 static struct PeerContext p2;
72 static int is_tcp_nat;
86 static unsigned long long total_bytes;
88 static struct GNUNET_TIME_Absolute start_time;
90 static GNUNET_SCHEDULER_TaskIdentifier die_task;
92 static GNUNET_SCHEDULER_TaskIdentifier tct;
94 struct GNUNET_TRANSPORT_TransmitHandle * th_p2;
96 static char *key_file_p1;
97 static char *cert_file_p1;
99 static char *key_file_p2;
100 static char *cert_file_p2;
102 static char *test_name;
104 static char bitmap[TOTAL_MSGS / 8];
106 static int msg_scheduled;
108 static int msg_recv_expected;
111 static int p1_hello_canceled;
112 static int p2_hello_canceled;
114 static int test_failed;
117 * Sets a bit active in the bitmap.
119 * @param bitIdx which bit to set
122 set_bit (unsigned int bitIdx)
125 unsigned int targetBit;
126 if (bitIdx >= sizeof(bitmap) * 8)
128 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "tried to set bit %d of %d(!?!?)\n", bitIdx, sizeof(bitmap) * 8);
131 arraySlot = bitIdx / 8;
132 targetBit = (1L << (bitIdx % 8));
133 bitmap[arraySlot] |= targetBit;
137 * Obtain a bit from bitmap.
138 * @param map the bitmap
139 * @param bit index from bitmap
141 * @return Bit \a bit from hashcode \a code
144 get_bit (const char *map, unsigned int bit)
146 if (bit >= TOTAL_MSGS)
148 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "get bit %d of %d(!?!?)\n", bit, sizeof(bitmap) * 8);
151 return ((map)[bit >> 3] & (1 << (bit & 7))) > 0;
157 unsigned long long delta;
163 for (i = 0; i < TOTAL_MSGS; i++)
165 if (get_bit(bitmap, i) == 0)
167 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Did not receive message %d\n", i);
172 if (GNUNET_SCHEDULER_NO_TASK != die_task)
173 GNUNET_SCHEDULER_cancel (die_task);
174 die_task = GNUNET_SCHEDULER_NO_TASK;
176 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
179 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
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");
221 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
223 GNUNET_TRANSPORT_disconnect (p1.th);
224 GNUNET_TRANSPORT_disconnect (p2.th);
226 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
227 "Transports disconnected, returning success!\n");
229 delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value;
231 "\nThroughput was %llu kb/s\n",
232 total_bytes * 1000 / 1024 / delta);
233 GNUNET_asprintf(&value_name, "unreliable_%s", test_name);
234 GAUGER ("TRANSPORT", value_name, (int)(total_bytes * 1000 / 1024 /delta), "kb/s");
235 GNUNET_free(value_name);
236 GNUNET_asprintf(&value_name, "unreliable_failed_%s", test_name);
237 GAUGER ("TRANSPORT", value_name, (int)num_failed, "msgs");
238 GNUNET_free(value_name);
239 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Had %d failed messages!\n", num_failed);
247 stop_arm (struct PeerContext *p)
250 if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM))
251 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
252 GNUNET_OS_process_wait (p->arm_proc);
253 GNUNET_OS_process_close (p->arm_proc);
256 GNUNET_CONFIGURATION_destroy (p->cfg);
262 exchange_hello_last (void *cls,
263 const struct GNUNET_MessageHeader *message)
265 struct PeerContext *me = cls;
267 GNUNET_assert (message != NULL);
268 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
269 "Exchanging HELLO of size %d with peer (%s)!\n",
270 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message),
271 GNUNET_i2s (&me->id));
272 GNUNET_assert (GNUNET_OK ==
273 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
275 GNUNET_TRANSPORT_offer_hello (p1.th, message, NULL, NULL);
281 exchange_hello (void *cls,
282 const struct GNUNET_MessageHeader *message)
284 struct PeerContext *me = cls;
286 GNUNET_assert (message != NULL);
287 GNUNET_assert (GNUNET_OK ==
288 GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *)
290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
291 "Exchanging HELLO of size %d from peer %s!\n",
292 (int) GNUNET_HELLO_size((const struct GNUNET_HELLO_Message *)message),
293 GNUNET_i2s (&me->id));
294 GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
300 end_badly (void *cls,
301 const struct GNUNET_SCHEDULER_TaskContext *tc)
303 if (test_failed == GNUNET_NO)
304 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
305 "Testcase timeout\n");
307 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
308 "Reliability failed: Last message sent %u, Next message scheduled %u, Last message received %u, Message expected %u\n",
317 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
320 if (p2_hello_canceled == GNUNET_NO)
322 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2);
323 p2_hello_canceled = GNUNET_YES;
325 if (p1_hello_canceled == GNUNET_NO)
327 GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1);
328 p1_hello_canceled = GNUNET_YES;
330 GNUNET_TRANSPORT_disconnect (p1.th);
331 GNUNET_TRANSPORT_disconnect (p2.th);
332 if (GNUNET_SCHEDULER_NO_TASK != tct)
334 GNUNET_SCHEDULER_cancel (tct);
335 tct = GNUNET_SCHEDULER_NO_TASK;
344 struct GNUNET_MessageHeader header;
350 get_size (unsigned int iter)
354 ret = (iter * iter * iter);
355 return sizeof (struct TestMessage) + (ret % 60000);
360 notify_receive (void *cls,
361 const struct GNUNET_PeerIdentity *peer,
362 const struct GNUNET_MessageHeader *message,
363 const struct GNUNET_TRANSPORT_ATS_Information *ats,
368 char cbuf[GNUNET_SERVER_MAX_MESSAGE_SIZE - 1];
369 const struct TestMessage *hdr;
371 hdr = (const struct TestMessage*) message;
373 if (MTYPE != ntohs (message->type))
375 msg_recv_expected = n;
376 msg_recv = ntohl(hdr->num);
377 s = get_size (ntohl(hdr->num));
379 if (ntohs (message->size) != s)
381 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
382 "Expected message %u of size %u, got %u bytes of message %u\n",
384 ntohs (message->size),
386 if (GNUNET_SCHEDULER_NO_TASK != die_task)
387 GNUNET_SCHEDULER_cancel (die_task);
388 test_failed = GNUNET_YES;
389 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
393 memset (cbuf, ntohl(hdr->num), s - sizeof (struct TestMessage));
394 if (0 != memcmp (cbuf,
396 s - sizeof (struct TestMessage)))
398 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
399 "Expected message %u with bits %u, but body did not match\n",
400 ntohl(hdr->num), (unsigned char) n);
401 if (GNUNET_SCHEDULER_NO_TASK != die_task)
402 GNUNET_SCHEDULER_cancel (die_task);
403 test_failed = GNUNET_YES;
404 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
408 if (ntohl(hdr->num) % 5 == 0)
410 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
411 "Got message %u of size %u\n",
413 ntohs (message->size));
417 set_bit(ntohl(hdr->num));
418 if (0 == (n % (TOTAL_MSGS / 100)))
420 fprintf (stderr, ".");
421 if (GNUNET_SCHEDULER_NO_TASK != die_task)
422 GNUNET_SCHEDULER_cancel (die_task);
423 test_failed = GNUNET_YES;
424 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
434 notify_ready (void *cls, size_t size, void *buf)
438 struct TestMessage hdr;
452 GNUNET_assert (size >= s);
453 GNUNET_assert (buf != NULL);
457 hdr.header.size = htons (s);
458 hdr.header.type = htons (MTYPE);
461 memcpy (&cbuf[ret], &hdr, sizeof (struct TestMessage));
462 ret += sizeof (struct TestMessage);
463 memset (&cbuf[ret], n, s - sizeof (struct TestMessage));
464 ret += s - sizeof (struct TestMessage);
468 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
469 "Sending message %u of size %u\n",
476 if (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16))
477 break; /* sometimes pack buffer full, sometimes not */
479 while (size - ret >= s);
482 th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
491 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent!!\n");
492 if (GNUNET_SCHEDULER_NO_TASK != die_task)
493 GNUNET_SCHEDULER_cancel(die_task);
494 die_task = GNUNET_SCHEDULER_add_delayed (UNRELIABLE_TIMEOUT, &end_unreliably, NULL);
498 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
499 "Returning total message block of size %u\n",
509 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
513 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
514 "Peer `%4s' disconnected (%p)!\n",
515 GNUNET_i2s (peer), cls);
519 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th_p2);
527 notify_connect (void *cls,
528 const struct GNUNET_PeerIdentity *peer,
529 const struct GNUNET_TRANSPORT_ATS_Information *ats,
532 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
533 "Peer `%4s' connected to us (%p)!\n",
538 GNUNET_TRANSPORT_set_quota (p1.th,
540 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
541 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
542 start_time = GNUNET_TIME_absolute_get ();
547 GNUNET_TRANSPORT_set_quota (p2.th,
549 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024),
550 GNUNET_BANDWIDTH_value_init (1024 * 1024 * 1024));
555 if (GNUNET_SCHEDULER_NO_TASK != die_task)
557 GNUNET_SCHEDULER_cancel (die_task);
559 if (GNUNET_SCHEDULER_NO_TASK != tct)
561 GNUNET_SCHEDULER_cancel (tct);
562 tct = GNUNET_SCHEDULER_NO_TASK;
564 if (p2_hello_canceled == GNUNET_NO)
566 GNUNET_TRANSPORT_get_hello_cancel (p2.th, &exchange_hello_last, &p2);
567 p2_hello_canceled = GNUNET_YES;
569 if (p1_hello_canceled == GNUNET_NO)
571 GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1);
572 p1_hello_canceled = GNUNET_YES;
575 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
577 GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
579 get_size (0), 0, TIMEOUT,
588 setup_peer (struct PeerContext *p, const char *cfgname)
590 p->cfg = GNUNET_CONFIGURATION_create ();
592 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
593 if (GNUNET_CONFIGURATION_have_value (p->cfg,"PATHS", "SERVICEHOME"))
594 GNUNET_CONFIGURATION_get_value_string (p->cfg, "PATHS", "SERVICEHOME", &p->servicehome);
595 GNUNET_DISK_directory_remove (p->servicehome);
599 p->arm_proc = GNUNET_OS_start_process (NULL, NULL,
600 "gnunet-service-arm",
601 "gnunet-service-arm",
605 "-c", cfgname, NULL);
608 p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL,
613 GNUNET_assert (p->th != NULL);
618 * Return the actual path to a file found in the current
619 * PATH environment variable.
621 * @param binary the name of the file to find
624 get_path_from_PATH (char *binary)
635 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
636 _("PATH environment variable is unset.\n"));
639 path = GNUNET_strdup (p); /* because we write on it */
640 buf = GNUNET_malloc (strlen (path) + 20);
643 while (NULL != (end = strchr (pos, PATH_SEPARATOR)))
646 sprintf (buf, "%s/%s", pos, binary);
647 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
654 sprintf (buf, "%s/%s", pos, binary);
655 if (GNUNET_DISK_file_test (buf) == GNUNET_YES)
666 * Check whether the suid bit is set on a file.
667 * Attempts to find the file using the current
668 * PATH environment variable as a search path.
670 * @param binary the name of the file to check
672 * @return GNUNET_YES if the binary is found and
673 * can be run properly, GNUNET_NO otherwise
676 check_gnunet_nat_binary(char *binary)
686 GNUNET_asprintf (&binaryexe, "%s.exe", binary);
687 p = get_path_from_PATH (binaryexe);
690 p = get_path_from_PATH (binary);
694 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
695 _("Could not find binary `%s' in PATH!\n"),
699 if (0 != STAT (p, &statbuf))
701 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
702 _("stat (%s) failed: %s\n"),
706 return GNUNET_SYSERR;
710 if ( (0 != (statbuf.st_mode & S_ISUID)) &&
711 (statbuf.st_uid == 0) )
715 rawsock = socket (AF_INET, SOCK_RAW, IPPROTO_ICMP);
716 if (INVALID_SOCKET == rawsock)
718 DWORD err = GetLastError ();
719 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
720 "socket (AF_INET, SOCK_RAW, IPPROTO_ICMP) have failed! GLE = %d\n", err);
721 return GNUNET_NO; /* not running as administrator */
723 closesocket (rawsock);
730 try_connect (void *cls,
731 const struct GNUNET_SCHEDULER_TaskContext *tc)
733 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
734 "Asking peers to connect...\n");
735 GNUNET_TRANSPORT_try_connect (p2.th,
737 GNUNET_TRANSPORT_try_connect (p1.th,
739 tct = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
749 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
751 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
756 setup_peer (&p1, "test_transport_api_tcp_peer1.conf");
757 setup_peer (&p2, "test_transport_api_tcp_peer2.conf");
761 setup_peer (&p1, "test_transport_api_rel_http_peer1.conf");
762 setup_peer (&p2, "test_transport_api_rel_http_peer2.conf");
766 setup_peer (&p1, "test_transport_api_rel_https_peer1.conf");
767 setup_peer (&p2, "test_transport_api_rel_https_peer2.conf");
771 setup_peer (&p1, "test_transport_api_udp_peer1.conf");
772 setup_peer (&p2, "test_transport_api_udp_peer2.conf");
776 setup_peer (&p1, "test_transport_api_unix_peer1.conf");
777 setup_peer (&p2, "test_transport_api_unix_peer2.conf");
781 setup_peer (&p1, "test_transport_api_tcp_nat_peer1.conf");
782 setup_peer (&p2, "test_transport_api_tcp_nat_peer2.conf");
786 setup_peer (&p1, "test_transport_api_wlan_peer1.conf");
787 setup_peer (&p2, "test_transport_api_wlan_peer2.conf");
791 GNUNET_assert(p1.th != NULL);
792 GNUNET_assert(p2.th != NULL);
793 GNUNET_TRANSPORT_get_hello (p1.th, &exchange_hello, &p1);
794 p1_hello_canceled = GNUNET_NO;
795 GNUNET_TRANSPORT_get_hello (p2.th, &exchange_hello_last, &p2);
796 p2_hello_canceled = GNUNET_NO;
797 tct = GNUNET_SCHEDULER_add_now (&try_connect, NULL);
804 char *const argv[] = { "test-transport-api-unreliability",
806 "test_transport_api_data.conf",
812 struct GNUNET_GETOPT_CommandLineOption options[] = {
813 GNUNET_GETOPT_OPTION_END
817 setTransportOptions("test_transport_api_data.conf");
821 if ((GNUNET_YES == is_tcp_nat) && (check_gnunet_nat_binary("gnunet-nat-server") != GNUNET_YES))
823 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, "Not running NAT test case, binaries not properly installed.\n");
827 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
828 argv, "test-transport-api-unreliability", "nohelp",
836 if (0 == stat (cert_file_p1, &sbuf ))
838 if (0 == remove(cert_file_p1))
839 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p1);
841 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p1);
844 if (0 == stat (key_file_p1, &sbuf ))
846 if (0 == remove(key_file_p1))
847 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p1);
849 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p1);
852 if (0 == stat (cert_file_p2, &sbuf ))
854 if (0 == remove(cert_file_p2))
855 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed existing certificate file `%s'\n",cert_file_p2);
857 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to remove certfile `%s'\n",cert_file_p2);
860 if (0 == stat (key_file_p2, &sbuf ))
862 if (0 == remove(key_file_p2))
863 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Successfully removed private key file `%s'\n",key_file_p2);
865 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to private key file `%s'\n",key_file_p2);
867 GNUNET_free(key_file_p1);
868 GNUNET_free(key_file_p2);
869 GNUNET_free(cert_file_p1);
870 GNUNET_free(cert_file_p2);
873 if ((p1.servicehome != NULL) && (p2.servicehome != NULL))
875 GNUNET_DISK_directory_remove (p1.servicehome);
876 GNUNET_DISK_directory_remove (p2.servicehome);
877 GNUNET_free(p1.servicehome);
878 GNUNET_free(p2.servicehome);
887 main (int argc, char *argv[])
891 return GNUNET_SYSERR;
894 test_failed = GNUNET_NO;
896 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1");
897 GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2");
899 if (strstr(argv[0], "tcp_nat") != NULL)
901 is_tcp_nat = GNUNET_YES;
902 GNUNET_asprintf(&test_name, "tcp_nat");
904 else if (strstr(argv[0], "tcp") != NULL)
907 GNUNET_asprintf(&test_name, "tcp");
909 else if (strstr(argv[0], "https") != NULL)
911 is_https = GNUNET_YES;
912 GNUNET_asprintf(&test_name, "https");
914 else if (strstr(argv[0], "http") != NULL)
916 is_http = GNUNET_YES;
917 GNUNET_asprintf(&test_name, "http");
919 else if (strstr(argv[0], "udp") != NULL)
922 GNUNET_asprintf(&test_name, "udp");
924 else if (strstr(argv[0], "unix") != NULL)
926 is_unix = GNUNET_YES;
927 GNUNET_asprintf(&test_name, "unix");
929 else if (strstr(argv[0], "wlan") != NULL)
931 is_wlan = GNUNET_YES;
933 GNUNET_log_setup ("test-transport-api-unreliability",
942 GNUNET_free_non_null(test_name);
946 /* end of test_transport_api_unreliability.c */