diff options
Diffstat (limited to 'src/transport/test_transport_plugin_cmd_udp_backchannel.c')
-rw-r--r-- | src/transport/test_transport_plugin_cmd_udp_backchannel.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c index 5a0dac32b..38b81da85 100644 --- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c +++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "gnunet_transport_application_service.h" | 30 | #include "gnunet_transport_application_service.h" |
31 | #include "transport-testing2.h" | 31 | #include "transport-testing2.h" |
32 | #include "transport-testing-cmds.h" | 32 | #include "transport-testing-cmds.h" |
33 | #include "gnunet_testing_barrier.h" | ||
33 | 34 | ||
34 | /** | 35 | /** |
35 | * Generic logging shortcut | 36 | * Generic logging shortcut |
@@ -40,12 +41,16 @@ | |||
40 | 41 | ||
41 | #define TOPOLOGY_CONFIG "test_transport_udp_backchannel_topo.conf" | 42 | #define TOPOLOGY_CONFIG "test_transport_udp_backchannel_topo.conf" |
42 | 43 | ||
44 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) | ||
45 | |||
43 | static struct GNUNET_TESTING_Command block_send; | 46 | static struct GNUNET_TESTING_Command block_send; |
44 | 47 | ||
45 | static struct GNUNET_TESTING_Command connect_peers; | 48 | static struct GNUNET_TESTING_Command connect_peers; |
46 | 49 | ||
47 | static struct GNUNET_TESTING_Command local_prepared; | 50 | static struct GNUNET_TESTING_Command local_prepared; |
48 | 51 | ||
52 | static struct GNUNET_TESTING_Interpreter *is; | ||
53 | |||
49 | 54 | ||
50 | /** | 55 | /** |
51 | * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being | 56 | * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being |
@@ -80,6 +85,25 @@ handle_test (void *cls, | |||
80 | } | 85 | } |
81 | 86 | ||
82 | 87 | ||
88 | struct GNUNET_TESTING_Barrier * | ||
89 | get_waiting_for_barriers () | ||
90 | { | ||
91 | struct GNUNET_TESTING_Barrier *barrier; | ||
92 | |||
93 | //No Barrier | ||
94 | return NULL; | ||
95 | } | ||
96 | |||
97 | |||
98 | static void | ||
99 | barrier_advanced (const char *barrier_name) | ||
100 | { | ||
101 | struct GNUNET_TESTING_Barrier *barrier = GNUNET_TESTING_get_barrier (is, barrier_name); | ||
102 | |||
103 | GNUNET_TESTING_finish_attached_cmds (is, barrier); | ||
104 | } | ||
105 | |||
106 | |||
83 | /** | 107 | /** |
84 | * Callback to set the flag indicating all peers started. Will be called via the plugin api. | 108 | * Callback to set the flag indicating all peers started. Will be called via the plugin api. |
85 | * | 109 | * |
@@ -303,8 +327,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
303 | 327 | ||
304 | ts->write_message = write_message; | 328 | ts->write_message = write_message; |
305 | 329 | ||
306 | GNUNET_TESTING_run (commands, | 330 | is = GNUNET_TESTING_run (commands, |
307 | GNUNET_TIME_UNIT_FOREVER_REL, | 331 | TIMEOUT, |
308 | &handle_result, | 332 | &handle_result, |
309 | ts); | 333 | ts); |
310 | 334 | ||
@@ -330,6 +354,8 @@ libgnunet_test_transport_plugin_cmd_udp_backchannel_init (void *cls) | |||
330 | api->start_testcase = &start_testcase; | 354 | api->start_testcase = &start_testcase; |
331 | api->all_peers_started = &all_peers_started; | 355 | api->all_peers_started = &all_peers_started; |
332 | api->all_local_tests_prepared = all_local_tests_prepared; | 356 | api->all_local_tests_prepared = all_local_tests_prepared; |
357 | api->barrier_advanced = barrier_advanced; | ||
358 | api->get_waiting_for_barriers = get_waiting_for_barriers; | ||
333 | return api; | 359 | return api; |
334 | } | 360 | } |
335 | 361 | ||