get_address_latency also does not use session
[oweals/gnunet.git] / src / transport / test_transport_address_switch.c
1 /*
2  This file is part of GNUnet.
3  (C) 2009, 2010, 2011 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_address_switch.c
22  * @brief base test case for transport implementations
23  *
24  * This test case tests if peers can successfully switch address when connected
25  * connected by monitoring statistic values
26  */
27 #include "platform.h"
28 #include "gnunet_transport_service.h"
29 #include "gnunet_ats_service.h"
30 #include "gauger.h"
31 #include "transport-testing.h"
32
33 /*
34  * Testcase specific declarations
35  */
36
37 GNUNET_NETWORK_STRUCT_BEGIN
38 struct TestMessage
39 {
40   struct GNUNET_MessageHeader header;
41   uint32_t num;
42 };
43 GNUNET_NETWORK_STRUCT_END
44
45 /**
46  * Message type for test messages
47  */
48 #define MTYPE 12345
49
50 /**
51  * Message size for test messages
52  */
53 #define MSIZE 2048
54
55 /**
56  * Testcase timeout
57  */
58 #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120)
59
60 /**
61  * How long until we give up on transmitting the message?
62  */
63 #define TIMEOUT_TRANSMIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60)
64
65 #define DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
66 #define DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
67
68 /**
69  * Timeout task to send messages
70  */
71 static struct GNUNET_SCHEDULER_Task *die_task;
72
73
74 static struct GNUNET_SCHEDULER_Task *delayed_end_task;
75
76 /**
77  * Measurement task to send messages
78  */
79 static struct GNUNET_SCHEDULER_Task *measure_task;
80
81
82 struct PeerContext *p1;
83 char *cfg_file_p1;
84 struct GNUNET_STATISTICS_Handle *p1_stat;
85
86 struct PeerContext *p2;
87 char *cfg_file_p2;
88 struct GNUNET_STATISTICS_Handle *p2_stat;
89
90 struct PeerContext *sender;
91
92 struct PeerContext *receiver;
93
94 struct GNUNET_TRANSPORT_TransmitHandle *th;
95
96 struct GNUNET_TRANSPORT_TESTING_handle *tth;
97
98 static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
99
100 static int test_connected;
101
102 static int res;
103
104
105 /**
106  * Statistics about peer 1
107  */
108 static unsigned int p1_addresses_avail;
109 static unsigned int p1_switch_attempts;
110 static unsigned int p1_switch_success;
111 static unsigned int p1_switch_fail;
112
113
114 /**
115  * Statistics about peer 2
116  */
117 static unsigned int p2_switch_attempts;
118 static unsigned int p2_switch_success;
119 static unsigned int p2_switch_fail;
120 static unsigned int p2_addresses_avail;
121
122 /**
123  * Transmission statistics
124  */
125
126 /* Amount of data transfered since last switch attempt */
127 static unsigned long long bytes_sent_after_switch;
128 static unsigned long long bytes_recv_after_switch;
129
130 /*
131  * END Testcase specific declarations
132  */
133
134 #if VERBOSE
135 #define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
136 #else
137 #define OKPP do { ok++; } while (0)
138 #endif
139
140 static void end ();
141
142 static int
143 stat_start_attempt_cb (void *cls, const char *subsystem, const char *name,
144     uint64_t value, int is_persistent)
145 {
146   if (cls == p1)
147   {
148     p1_switch_attempts++;
149     FPRINTF (stderr, "(1:s)");
150   }
151   else if (cls == p2)
152   {
153     p2_switch_attempts++;
154     FPRINTF (stderr, "(2:s)");
155   }
156
157   bytes_recv_after_switch = 0;
158   bytes_sent_after_switch = 0;
159
160   return GNUNET_OK;
161 }
162
163
164 static int
165 stat_success_attempt_cb (void *cls, const char *subsystem, const char *name,
166     uint64_t value, int is_persistent)
167 {
168   if (cls == p1)
169   {
170     p1_switch_success++;
171     FPRINTF (stderr, "(1:+)");
172   }
173   if (cls == p2)
174   {
175     p2_switch_success++;
176     FPRINTF (stderr, "(2:+)");
177   }
178
179   return GNUNET_OK;
180 }
181
182
183 static int
184 stat_fail_attempt_cb (void *cls, const char *subsystem, const char *name,
185     uint64_t value, int is_persistent)
186 {
187   if (value == 0)
188     return GNUNET_OK;
189
190   if (cls == p1)
191   {
192     p1_switch_fail++;
193     FPRINTF (stderr, "(1:-)");
194   }
195   if (cls == p2)
196   {
197     p2_switch_fail++;
198     FPRINTF (stderr, "(2:-)");
199   }
200
201   return GNUNET_OK;
202 }
203
204 static int
205 stat_addresses_available (void *cls, const char *subsystem, const char *name,
206     uint64_t value, int is_persistent)
207 {
208   if (cls == p1)
209   {
210     p1_addresses_avail++;
211   }
212   if (cls == p2)
213   {
214     p2_addresses_avail++;
215   }
216
217   return GNUNET_OK;
218 }
219
220 static void
221 clean_up ()
222 {
223   if (measure_task != NULL )
224   {
225     GNUNET_SCHEDULER_cancel (measure_task);
226     measure_task = NULL;
227   }
228
229   if (delayed_end_task != NULL )
230   {
231     GNUNET_SCHEDULER_cancel (delayed_end_task);
232     delayed_end_task = NULL;
233   }
234
235   if (die_task != NULL )
236   {
237     GNUNET_SCHEDULER_cancel (die_task);
238     die_task = NULL;
239   }
240
241   if (NULL != p1_stat)
242   {
243     GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
244         "# Attempts to switch addresses",
245         stat_start_attempt_cb, p1);
246     GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
247         "# Successful attempts to switch addresses",
248         stat_success_attempt_cb, p1);
249     GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
250         "# Failed attempts to switch addresses (failed to send CONNECT CONT)",
251         stat_fail_attempt_cb, p1);
252     GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
253         "# Failed attempts to switch addresses (failed to send CONNECT)",
254         stat_fail_attempt_cb, p1);
255     GNUNET_STATISTICS_watch_cancel (p1_stat, "transport",
256         "# Failed attempts to switch addresses (no response)",
257         stat_fail_attempt_cb, p1);
258     GNUNET_STATISTICS_watch (p1_stat, "transport",
259         "# transport addresses",
260         stat_addresses_available, p1);
261     GNUNET_STATISTICS_destroy (p1_stat, GNUNET_NO);
262     p1_stat = NULL;
263   }
264   if (NULL != p2_stat)
265   {
266     GNUNET_STATISTICS_watch_cancel (p2_stat, "transport",
267         "# Attempts to switch addresses", stat_start_attempt_cb, p2);
268     GNUNET_STATISTICS_watch_cancel (p2_stat, "transport",
269         "# Successful attempts to switch addresses", stat_success_attempt_cb, p2);
270     GNUNET_STATISTICS_watch_cancel (p2_stat, "transport",
271         "# Failed attempts to switch addresses (failed to send CONNECT CONT)",
272         stat_fail_attempt_cb, p2);
273     GNUNET_STATISTICS_watch_cancel (p2_stat, "transport",
274         "# Failed attempts to switch addresses (failed to send CONNECT)",
275         stat_fail_attempt_cb, p2);
276     GNUNET_STATISTICS_watch_cancel (p2_stat, "transport",
277         "# Failed attempts to switch addresses (no response)",
278         stat_fail_attempt_cb, p2);
279     GNUNET_STATISTICS_watch (p2_stat, "transport",
280         "# transport addresses",
281         stat_addresses_available, p2);
282     GNUNET_STATISTICS_destroy (p2_stat, GNUNET_NO);
283     p2_stat = NULL;
284   }
285
286   if (th != NULL )
287   {
288     GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
289     th = NULL;
290   }
291   if (cc != NULL )
292   {
293     GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc);
294     cc = NULL;
295   }
296   if (p1 != NULL )
297   {
298     GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
299     p1 = NULL;
300   }
301   if (p2 != NULL )
302   {
303     GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
304     p2 = NULL;
305   }
306
307 }
308
309
310 static void
311 end ()
312 {
313   int result = 0;
314   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
315
316   delayed_end_task = NULL;
317   FPRINTF (stderr, "\n");
318   if (p1_switch_attempts > 0)
319   {
320     FPRINTF (stderr, "Peer 1 tried %u times to switch and succeeded %u times, failed %u times\n",
321         p1_switch_attempts, p1_switch_success, p1_switch_fail);
322     if (p1_switch_success != p1_switch_attempts)
323     {
324       GNUNET_break (0);
325       result ++;
326     }
327   }
328   else if (p1_addresses_avail > 1)
329   {
330     FPRINTF (stderr, "Peer 1 had %u addresses available, but did not try to switch\n",
331         p1_addresses_avail);
332   }
333   if (p2_switch_attempts > 0)
334   {
335     FPRINTF (stderr, "Peer 2 tried %u times to switch and succeeded %u times, failed %u times\n",
336         p2_switch_attempts, p2_switch_success, p2_switch_fail);
337     if (p2_switch_success != p2_switch_attempts)
338     {
339       GNUNET_break (0);
340       result ++;
341     }
342   }
343   else if (p2_addresses_avail > 1)
344   {
345     FPRINTF (stderr, "Peer 2 had %u addresses available, but did not try to switch\n",
346         p2_addresses_avail);
347   }
348
349   if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) &&
350        (bytes_sent_after_switch == 0) )
351   {
352     FPRINTF (stderr, "No data sent after switching!\n");
353     GNUNET_break (0);
354     res ++;
355   }
356   if ( ((p1_switch_attempts > 0) || (p2_switch_attempts > 0)) &&
357        (bytes_recv_after_switch == 0) )
358   {
359     FPRINTF (stderr, "No data received after switching!\n");
360     GNUNET_break (0);
361     res ++;
362   }
363
364   clean_up();
365
366   res = result;
367 }
368
369
370 static void
371 end_badly ()
372 {
373   die_task = NULL;
374   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
375
376   if (test_connected == GNUNET_YES)
377     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n");
378   else
379     GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Peers got NOT connected\n");
380
381   clean_up();
382
383   res = GNUNET_YES;
384 }
385
386
387 static void
388 notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
389     const struct GNUNET_MessageHeader *message)
390 {
391   const struct TestMessage *hdr;
392
393   hdr = (const struct TestMessage *) message;
394   if (MTYPE != ntohs (message->type))
395     return;
396
397   struct PeerContext *p = cls;
398   char *ps = GNUNET_strdup (GNUNET_i2s (&p->id));
399
400   GNUNET_log(GNUNET_ERROR_TYPE_INFO,
401       "Peer %u (`%s') got message %u of size %u from peer (`%s')\n", p->no, ps,
402       ntohl (hdr->num), ntohs (message->size), GNUNET_i2s (peer));
403
404   if ( ((p1_switch_attempts >= 1) || (p2_switch_attempts >= 1)) &&
405         (p1_switch_attempts == p1_switch_fail + p1_switch_success) &&
406         (p2_switch_attempts == p2_switch_fail + p2_switch_success) )
407   {
408       bytes_recv_after_switch += ntohs(hdr->header.size);
409       if ((bytes_sent_after_switch > 0) && (bytes_recv_after_switch > 0))
410       {
411         /* A peer switched addresses and sent and received data after the
412          * switch operations */
413         end ();
414       }
415   }
416
417
418   GNUNET_free(ps);
419 }
420
421
422 static size_t
423 notify_ready (void *cls, size_t size, void *buf)
424 {
425   char *cbuf = buf;
426   struct TestMessage hdr;
427
428   th = NULL;
429   if (buf == NULL)
430   {
431     GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
432         "Timeout occurred while waiting for transmit_ready for message\n");
433     if (NULL != die_task)
434       GNUNET_SCHEDULER_cancel (die_task);
435     die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL );
436     res = 1;
437     return 0;
438   }
439
440   GNUNET_assert(size >= MSIZE);
441   GNUNET_assert(buf != NULL);
442   cbuf = buf;
443
444   hdr.header.size = htons (MSIZE);
445   hdr.header.type = htons (MTYPE);
446   hdr.num = htonl (0);
447   memcpy (&cbuf[0], &hdr, sizeof(struct TestMessage));
448   memset (&cbuf[sizeof(struct TestMessage)], '0', MSIZE - sizeof(struct TestMessage));
449
450 #if VERBOSE
451   char *receiver_s = GNUNET_strdup (GNUNET_i2s (&receiver->id));
452   GNUNET_log(GNUNET_ERROR_TYPE_INFO,
453       "Sending message %u of size %u from peer %u (`%4s') -> peer %u (`%s') !\n",
454       n, s, sender->no, GNUNET_i2s (&sender->id), receiver->no, receiver_s);
455   GNUNET_free(receiver_s);
456 #endif
457
458   if (th == NULL )
459     th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, MSIZE,
460         TIMEOUT_TRANSMIT, &notify_ready, NULL );
461
462   if ( ((p1_switch_attempts >= 1) || (p2_switch_attempts >= 1)) &&
463         (p1_switch_attempts == p1_switch_fail + p1_switch_success) &&
464         (p2_switch_attempts == p2_switch_fail + p2_switch_success) )
465   {
466     bytes_sent_after_switch += MSIZE;
467   }
468
469   return MSIZE;
470 }
471
472
473 static void
474 notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
475 {
476   struct PeerContext *p = cls;
477   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s') connected to us!\n",
478       p->no, GNUNET_i2s (peer));
479 }
480
481
482 static void
483 notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
484 {
485   struct PeerContext *p = cls;
486   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%4s') disconnected!\n", p->no,
487       GNUNET_i2s (peer));
488   if (th != NULL )
489     GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
490   th = NULL;
491
492 }
493
494
495 static void
496 sendtask ()
497 {
498   th = GNUNET_TRANSPORT_notify_transmit_ready (p2->th, &p1->id, MSIZE,
499       TIMEOUT_TRANSMIT, &notify_ready, NULL );
500 }
501
502
503 static void
504 progress_indicator (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
505 {
506   static int counter;
507   measure_task = NULL;
508   counter++;
509   if ((DURATION.rel_value_us / 1000 / 1000LL) < counter)
510   {
511     FPRINTF (stderr, "%s", ".\n");
512   }
513   else
514   {
515     FPRINTF (stderr, "%s", ".");
516     measure_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
517         &progress_indicator, NULL );
518   }
519 }
520
521
522 static void
523 testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls)
524 {
525   char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id));
526
527   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peers connected: %u (%s) <-> %u (%s)\n",
528       p1->no, p1_c, p2->no, GNUNET_i2s (&p2->id));
529   GNUNET_free(p1_c);
530
531   cc = NULL;
532   test_connected = GNUNET_YES;
533
534   FPRINTF (stderr, "(i:s/+/-) \t i == peer 1/2, s/+/- : switch attempt/switch ok/switch fail\n");
535
536   measure_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
537       &progress_indicator, NULL );
538  GNUNET_SCHEDULER_add_now (&sendtask, NULL );
539 }
540
541
542 static void
543 start_cb (struct PeerContext *p, void *cls)
544 {
545   static int started;
546   started++;
547
548   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Peer %u (`%s') started\n", p->no,
549       GNUNET_i2s (&p->id));
550   if (started != 2)
551     return;
552
553   test_connected = GNUNET_NO;
554   sender = p2;
555   receiver = p1;
556
557   char *sender_c = GNUNET_strdup (GNUNET_i2s (&sender->id));
558   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
559       "Test tries to send from %u (%s) -> peer %u (%s)\n", sender->no, sender_c,
560       receiver->no, GNUNET_i2s (&receiver->id));
561   GNUNET_free(sender_c);
562   cc = GNUNET_TRANSPORT_TESTING_connect_peers (tth, p1, p2, &testing_connect_cb,
563       NULL );
564 }
565
566
567 static void
568 run (void *cls, char * const *args, const char *cfgfile,
569     const struct GNUNET_CONFIGURATION_Handle *cfg)
570 {
571   die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL );
572
573   p1 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p1, 1,
574       &notify_receive, &notify_connect, &notify_disconnect, &start_cb, NULL );
575
576   p2 = GNUNET_TRANSPORT_TESTING_start_peer (tth, cfg_file_p2, 2,
577       &notify_receive, &notify_connect, &notify_disconnect, &start_cb, NULL );
578
579   if ((p1 == NULL )|| (p2 == NULL))
580   {
581     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
582     if (die_task != NULL)
583     GNUNET_SCHEDULER_cancel (die_task);
584     die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
585     return;
586   }
587
588   /* Start to watch statistics for peer 1 */
589   p1_stat = GNUNET_STATISTICS_create ("transport", p1->cfg);
590   GNUNET_STATISTICS_watch (p1_stat, "transport",
591       "# Attempts to switch addresses",
592       stat_start_attempt_cb, p1);
593   GNUNET_STATISTICS_watch (p1_stat, "transport",
594       "# Successful attempts to switch addresses",
595       stat_success_attempt_cb, p1);
596   GNUNET_STATISTICS_watch (p1_stat, "transport",
597       "# Failed attempts to switch addresses (failed to send CONNECT CONT)",
598       stat_fail_attempt_cb, p1);
599   GNUNET_STATISTICS_watch (p1_stat, "transport",
600       "# Failed attempts to switch addresses (failed to send CONNECT)",
601       stat_fail_attempt_cb, p1);
602   GNUNET_STATISTICS_watch (p1_stat, "transport",
603       "# Failed attempts to switch addresses (no response)",
604       stat_fail_attempt_cb, p1);
605   GNUNET_STATISTICS_watch (p1_stat, "transport",
606       "# transport addresses",
607       stat_addresses_available, p1);
608
609   /* Start to watch statistics for peer 2  */
610   p2_stat = GNUNET_STATISTICS_create ("transport", p2->cfg);
611   GNUNET_STATISTICS_watch (p2_stat, "transport",
612       "# Attempts to switch addresses",
613       stat_start_attempt_cb, p2);
614   GNUNET_STATISTICS_watch (p2_stat, "transport",
615       "# Successful attempts to switch addresses",
616       stat_success_attempt_cb, p2);
617   GNUNET_STATISTICS_watch (p2_stat, "transport",
618       "# Failed attempts to switch addresses (failed to send CONNECT CONT)",
619       stat_fail_attempt_cb, p2);
620   GNUNET_STATISTICS_watch (p2_stat, "transport",
621       "# Failed attempts to switch addresses (failed to send CONNECT)",
622       stat_fail_attempt_cb, p2);
623   GNUNET_STATISTICS_watch (p2_stat, "transport",
624       "# Failed attempts to switch addresses (no response)",
625       stat_fail_attempt_cb, p2);
626   GNUNET_STATISTICS_watch (p2_stat, "transport",
627       "# transport addresses",
628       stat_addresses_available, p2);
629
630   if ((p1_stat == NULL )|| (p2_stat == NULL))
631   {
632     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not create statistics for peers!\n");
633     if (die_task != NULL)
634     GNUNET_SCHEDULER_cancel (die_task);
635     die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
636     return;
637   }
638 }
639
640 int
641 main (int argc, char *argv[])
642 {
643   char *test_plugin;
644   char *test_source;
645   char *test_name;
646
647   static char *argv_new[] = { "test-transport-address-switch", "-c",
648       "test_transport_startonly.conf", NULL };
649
650   static struct GNUNET_GETOPT_CommandLineOption options[] = {
651       GNUNET_GETOPT_OPTION_END };
652
653   GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name);
654
655   GNUNET_log_setup (test_name, "WARNING", NULL );
656
657   GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source);
658   GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], test_source,
659       &test_plugin);
660
661   tth = GNUNET_TRANSPORT_TESTING_init ();
662
663   GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p1, 1);
664   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Using cfg [%u] : %s \n", 1, cfg_file_p1);
665   GNUNET_TRANSPORT_TESTING_get_config_name (argv[0], &cfg_file_p2, 2);
666   GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Using cfg [%u] : %s \n", 2, cfg_file_p2);
667
668   GNUNET_PROGRAM_run ((sizeof(argv_new) / sizeof(char *)) - 1, argv_new,
669       test_name, "nohelp", options, &run, NULL );
670
671   GNUNET_free(cfg_file_p1);
672   GNUNET_free(cfg_file_p2);
673
674   GNUNET_free(test_source);
675   GNUNET_free(test_plugin);
676   GNUNET_free(test_name);
677
678   GNUNET_TRANSPORT_TESTING_done (tth);
679
680   return res;
681 }
682
683 /* end of test_transport_address_switch.c */