diff options
Diffstat (limited to 'src/transport/test_transport_plugin_cmd_simple_send_dv.c')
-rw-r--r-- | src/transport/test_transport_plugin_cmd_simple_send_dv.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_dv.c b/src/transport/test_transport_plugin_cmd_simple_send_dv.c index 8bfa1fd0a..674c0d576 100644 --- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c +++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.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,6 +41,8 @@ | |||
40 | 41 | ||
41 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" | 42 | #define TOPOLOGY_CONFIG "test_transport_simple_send_topo.conf" |
42 | 43 | ||
44 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) | ||
45 | |||
43 | /** | 46 | /** |
44 | * The number of messages received. | 47 | * The number of messages received. |
45 | */ | 48 | */ |
@@ -55,6 +58,8 @@ static struct GNUNET_TESTING_Command local_prepared; | |||
55 | 58 | ||
56 | static struct GNUNET_TESTING_Command start_peer; | 59 | static struct GNUNET_TESTING_Command start_peer; |
57 | 60 | ||
61 | static struct GNUNET_TESTING_Interpreter *is; | ||
62 | |||
58 | /** | 63 | /** |
59 | * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being | 64 | * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being |
60 | * received. | 65 | * received. |
@@ -134,6 +139,25 @@ handle_test (void *cls, | |||
134 | } | 139 | } |
135 | 140 | ||
136 | 141 | ||
142 | struct GNUNET_TESTING_Barrier * | ||
143 | get_waiting_for_barriers () | ||
144 | { | ||
145 | struct GNUNET_TESTING_Barrier *barrier; | ||
146 | |||
147 | //No Barrier | ||
148 | return NULL; | ||
149 | } | ||
150 | |||
151 | |||
152 | static void | ||
153 | barrier_advanced (const char *barrier_name) | ||
154 | { | ||
155 | struct GNUNET_TESTING_Barrier *barrier = GNUNET_TESTING_get_barrier (is, barrier_name); | ||
156 | |||
157 | GNUNET_TESTING_finish_attached_cmds (is, barrier); | ||
158 | } | ||
159 | |||
160 | |||
137 | /** | 161 | /** |
138 | * Callback to set the flag indicating all peers started. Will be called via the plugin api. | 162 | * Callback to set the flag indicating all peers started. Will be called via the plugin api. |
139 | * | 163 | * |
@@ -366,8 +390,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip, | |||
366 | 390 | ||
367 | ts->write_message = write_message; | 391 | ts->write_message = write_message; |
368 | 392 | ||
369 | GNUNET_TESTING_run (commands, | 393 | is = GNUNET_TESTING_run (commands, |
370 | GNUNET_TIME_UNIT_FOREVER_REL, | 394 | TIMEOUT, |
371 | &handle_result, | 395 | &handle_result, |
372 | ts); | 396 | ts); |
373 | 397 | ||
@@ -393,6 +417,8 @@ libgnunet_test_transport_plugin_cmd_simple_send_dv_init (void *cls) | |||
393 | api->start_testcase = &start_testcase; | 417 | api->start_testcase = &start_testcase; |
394 | api->all_peers_started = &all_peers_started; | 418 | api->all_peers_started = &all_peers_started; |
395 | api->all_local_tests_prepared = all_local_tests_prepared; | 419 | api->all_local_tests_prepared = all_local_tests_prepared; |
420 | api->barrier_advanced = barrier_advanced; | ||
421 | api->get_waiting_for_barriers = get_waiting_for_barriers; | ||
396 | return api; | 422 | return api; |
397 | } | 423 | } |
398 | 424 | ||