aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_plugin_cmd_simple_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/test_transport_plugin_cmd_simple_send.c')
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c
index 5941a991b..c9acb0431 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send.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
43static struct GNUNET_TESTING_Command block_send; 46static struct GNUNET_TESTING_Command block_send;
44 47
45static struct GNUNET_TESTING_Command block_receive; 48static struct GNUNET_TESTING_Command block_receive;
@@ -48,6 +51,7 @@ static struct GNUNET_TESTING_Command connect_peers;
48 51
49static struct GNUNET_TESTING_Command local_prepared; 52static struct GNUNET_TESTING_Command local_prepared;
50 53
54static struct GNUNET_TESTING_Interpreter *is;
51 55
52/** 56/**
53 * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being 57 * Function called to check a message of type GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE being
@@ -83,6 +87,25 @@ handle_test (void *cls,
83} 87}
84 88
85 89
90struct GNUNET_TESTING_Barrier *
91get_waiting_for_barriers ()
92{
93 struct GNUNET_TESTING_Barrier *barrier;
94
95 //No Barrier
96 return NULL;
97}
98
99
100static void
101barrier_advanced (const char *barrier_name)
102{
103 struct GNUNET_TESTING_Barrier *barrier = GNUNET_TESTING_get_barrier (is, barrier_name);
104
105 GNUNET_TESTING_finish_attached_cmds (is, barrier);
106}
107
108
86/** 109/**
87 * Callback to set the flag indicating all peers started. Will be called via the plugin api. 110 * Callback to set the flag indicating all peers started. Will be called via the plugin api.
88 * 111 *
@@ -312,8 +335,8 @@ start_testcase (TESTING_CMD_HELPER_write_cb write_message, char *router_ip,
312 335
313 ts->write_message = write_message; 336 ts->write_message = write_message;
314 337
315 GNUNET_TESTING_run (commands, 338 is = GNUNET_TESTING_run (commands,
316 GNUNET_TIME_UNIT_FOREVER_REL, 339 TIMEOUT,
317 &handle_result, 340 &handle_result,
318 ts); 341 ts);
319 342
@@ -339,6 +362,8 @@ libgnunet_test_transport_plugin_cmd_simple_send_init (void *cls)
339 api->start_testcase = &start_testcase; 362 api->start_testcase = &start_testcase;
340 api->all_peers_started = &all_peers_started; 363 api->all_peers_started = &all_peers_started;
341 api->all_local_tests_prepared = all_local_tests_prepared; 364 api->all_local_tests_prepared = all_local_tests_prepared;
365 api->barrier_advanced = barrier_advanced;
366 api->get_waiting_for_barriers = get_waiting_for_barriers;
342 return api; 367 return api;
343} 368}
344 369