aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2022-12-13 13:08:17 +0100
committert3sserakt <t3ss@posteo.de>2022-12-13 13:08:17 +0100
commitba4d141be09651b452270fc21f062d50bd3f738a (patch)
tree309c149fc8989fc83a893703e4f86194fb9a2f36 /src/transport
parent52d0d09146c1d13bded8195cb91845acac1b355d (diff)
downloadgnunet-ba4d141be09651b452270fc21f062d50bd3f738a.tar.gz
gnunet-ba4d141be09651b452270fc21f062d50bd3f738a.zip
- refactored barrier header, fixed messages for barrier signaling
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/test_transport_plugin_cmd_nat_upnp.c22
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send.c16
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send_broadcast.c16
-rw-r--r--src/transport/test_transport_plugin_cmd_simple_send_dv.c16
-rw-r--r--src/transport/test_transport_plugin_cmd_udp_backchannel.c17
5 files changed, 19 insertions, 68 deletions
diff --git a/src/transport/test_transport_plugin_cmd_nat_upnp.c b/src/transport/test_transport_plugin_cmd_nat_upnp.c
index 3fef41d87..b02673d04 100644
--- a/src/transport/test_transport_plugin_cmd_nat_upnp.c
+++ b/src/transport/test_transport_plugin_cmd_nat_upnp.c
@@ -24,7 +24,7 @@
24 * @author t3sserakt 24 * @author t3sserakt
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_testing_ng_lib.h" 27#include "gnunet_testing_barrier.h"
28#include "gnunet_testing_netjail_lib.h" 28#include "gnunet_testing_netjail_lib.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_transport_application_service.h" 30#include "gnunet_transport_application_service.h"
@@ -95,13 +95,15 @@ get_waiting_for_barriers ()
95 95
96 barriers = GNUNET_new (struct GNUNET_TESTING_BarrierList); 96 barriers = GNUNET_new (struct GNUNET_TESTING_BarrierList);
97 ble = GNUNET_new (struct GNUNET_TESTING_BarrierListEntry); 97 ble = GNUNET_new (struct GNUNET_TESTING_BarrierListEntry);
98 ble->barrier = GNUNET_TESTING_barrier_new ("ready-to-connect"); 98 ble->barrier_name = "ready-to-connect";
99 ble->expected_reaches = 1;
99 GNUNET_CONTAINER_DLL_insert (barriers->head, 100 GNUNET_CONTAINER_DLL_insert (barriers->head,
100 barriers->tail, 101 barriers->tail,
101 ble); 102 ble);
102 103
103 ble = GNUNET_new (struct GNUNET_TESTING_BarrierListEntry); 104 ble = GNUNET_new (struct GNUNET_TESTING_BarrierListEntry);
104 ble->barrier = GNUNET_TESTING_barrier_new ("test-case-finished"); 105 ble->barrier_name = "test-case-finished";
106 ble->expected_reaches = 1;
105 GNUNET_CONTAINER_DLL_insert (barriers->head, 107 GNUNET_CONTAINER_DLL_insert (barriers->head,
106 barriers->tail, 108 barriers->tail,
107 ble); 109 ble);
@@ -109,15 +111,6 @@ get_waiting_for_barriers ()
109} 111}
110 112
111 113
112static void
113barrier_advanced (const char *barrier_name)
114{
115 struct GNUNET_TESTING_Barrier *barrier = GNUNET_TESTING_get_barrier (is, barrier_name);
116
117 GNUNET_TESTING_finish_attached_cmds (is, barrier);
118}
119
120
121/** 114/**
122 * Callback to set the flag indicating all peers started. Will be called via the plugin api. 115 * Callback to set the flag indicating all peers started. Will be called via the plugin api.
123 * 116 *
@@ -213,7 +206,7 @@ all_local_tests_prepared ()
213 * @param n The number of the network namespace. 206 * @param n The number of the network namespace.
214 * @param local_m The number of nodes in a network namespace. 207 * @param local_m The number of nodes in a network namespace.
215 */ 208 */
216static void 209static struct GNUNET_TESTING_Interpreter *
217start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, 210start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
218 const char *router_ip, 211 const char *router_ip,
219 const char *node_ip, 212 const char *node_ip,
@@ -354,7 +347,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
354 TIMEOUT, 347 TIMEOUT,
355 &handle_result, 348 &handle_result,
356 ts); 349 ts);
357 350 return is;
358} 351}
359 352
360 353
@@ -377,7 +370,6 @@ libgnunet_test_transport_plugin_cmd_nat_upnp_init (void *cls)
377 api->start_testcase = &start_testcase; 370 api->start_testcase = &start_testcase;
378 api->all_peers_started = &all_peers_started; 371 api->all_peers_started = &all_peers_started;
379 api->all_local_tests_prepared = all_local_tests_prepared; 372 api->all_local_tests_prepared = all_local_tests_prepared;
380 api->barrier_advanced = barrier_advanced;
381 api->get_waiting_for_barriers = get_waiting_for_barriers; 373 api->get_waiting_for_barriers = get_waiting_for_barriers;
382 return api; 374 return api;
383} 375}
diff --git a/src/transport/test_transport_plugin_cmd_simple_send.c b/src/transport/test_transport_plugin_cmd_simple_send.c
index e94667593..83f9d62b8 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send.c
@@ -24,7 +24,7 @@
24 * @author t3sserakt 24 * @author t3sserakt
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_testing_ng_lib.h" 27#include "gnunet_testing_barrier.h"
28#include "gnunet_testing_netjail_lib.h" 28#include "gnunet_testing_netjail_lib.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_transport_application_service.h" 30#include "gnunet_transport_application_service.h"
@@ -95,15 +95,6 @@ get_waiting_for_barriers ()
95} 95}
96 96
97 97
98static void
99barrier_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
107/** 98/**
108 * Callback to set the flag indicating all peers started. Will be called via the plugin api. 99 * Callback to set the flag indicating all peers started. Will be called via the plugin api.
109 * 100 *
@@ -199,7 +190,7 @@ all_local_tests_prepared ()
199 * @param n The number of the network namespace. 190 * @param n The number of the network namespace.
200 * @param local_m The number of nodes in a network namespace. 191 * @param local_m The number of nodes in a network namespace.
201 */ 192 */
202static void 193static struct GNUNET_TESTING_Interpreter *
203start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, 194start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
204 const char *router_ip, 195 const char *router_ip,
205 const char *node_ip, 196 const char *node_ip,
@@ -338,7 +329,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
338 TIMEOUT, 329 TIMEOUT,
339 &handle_result, 330 &handle_result,
340 ts); 331 ts);
341 332 return is;
342} 333}
343 334
344 335
@@ -361,7 +352,6 @@ libgnunet_test_transport_plugin_cmd_simple_send_init (void *cls)
361 api->start_testcase = &start_testcase; 352 api->start_testcase = &start_testcase;
362 api->all_peers_started = &all_peers_started; 353 api->all_peers_started = &all_peers_started;
363 api->all_local_tests_prepared = all_local_tests_prepared; 354 api->all_local_tests_prepared = all_local_tests_prepared;
364 api->barrier_advanced = barrier_advanced;
365 api->get_waiting_for_barriers = get_waiting_for_barriers; 355 api->get_waiting_for_barriers = get_waiting_for_barriers;
366 return api; 356 return api;
367} 357}
diff --git a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
index 4eeb25ec8..9f028e260 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_broadcast.c
@@ -24,7 +24,7 @@
24 * @author t3sserakt 24 * @author t3sserakt
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_testing_ng_lib.h" 27#include "gnunet_testing_barrier.h"
28#include "gnunet_testing_netjail_lib.h" 28#include "gnunet_testing_netjail_lib.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_transport_application_service.h" 30#include "gnunet_transport_application_service.h"
@@ -95,15 +95,6 @@ get_waiting_for_barriers ()
95} 95}
96 96
97 97
98static void
99barrier_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
107/** 98/**
108 * Callback to set the flag indicating all peers started. Will be called via the plugin api. 99 * Callback to set the flag indicating all peers started. Will be called via the plugin api.
109 * 100 *
@@ -232,7 +223,7 @@ all_local_tests_prepared ()
232 * @param n The number of the network namespace. 223 * @param n The number of the network namespace.
233 * @param local_m The number of nodes in a network namespace. 224 * @param local_m The number of nodes in a network namespace.
234 */ 225 */
235static void 226static struct GNUNET_TESTING_Interpreter *
236start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, 227start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
237 const char *router_ip, 228 const char *router_ip,
238 const char *node_ip, 229 const char *node_ip,
@@ -365,7 +356,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
365 TIMEOUT, 356 TIMEOUT,
366 &handle_result, 357 &handle_result,
367 ts); 358 ts);
368 359 return is;
369} 360}
370 361
371 362
@@ -388,7 +379,6 @@ libgnunet_test_transport_plugin_cmd_simple_send_broadcast_init (void *cls)
388 api->start_testcase = &start_testcase; 379 api->start_testcase = &start_testcase;
389 api->all_peers_started = &all_peers_started; 380 api->all_peers_started = &all_peers_started;
390 api->all_local_tests_prepared = all_local_tests_prepared; 381 api->all_local_tests_prepared = all_local_tests_prepared;
391 api->barrier_advanced = barrier_advanced;
392 api->get_waiting_for_barriers = get_waiting_for_barriers; 382 api->get_waiting_for_barriers = get_waiting_for_barriers;
393 return api; 383 return api;
394} 384}
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 fe2c04401..3f4ae735c 100644
--- a/src/transport/test_transport_plugin_cmd_simple_send_dv.c
+++ b/src/transport/test_transport_plugin_cmd_simple_send_dv.c
@@ -24,7 +24,7 @@
24 * @author t3sserakt 24 * @author t3sserakt
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_testing_ng_lib.h" 27#include "gnunet_testing_barrier.h"
28#include "gnunet_testing_netjail_lib.h" 28#include "gnunet_testing_netjail_lib.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_transport_application_service.h" 30#include "gnunet_transport_application_service.h"
@@ -147,15 +147,6 @@ get_waiting_for_barriers ()
147} 147}
148 148
149 149
150static void
151barrier_advanced (const char *barrier_name)
152{
153 struct GNUNET_TESTING_Barrier *barrier = GNUNET_TESTING_get_barrier (is, barrier_name);
154
155 GNUNET_TESTING_finish_attached_cmds (is, barrier);
156}
157
158
159/** 150/**
160 * Callback to set the flag indicating all peers started. Will be called via the plugin api. 151 * Callback to set the flag indicating all peers started. Will be called via the plugin api.
161 * 152 *
@@ -255,7 +246,7 @@ all_local_tests_prepared ()
255 * @param n The number of the network namespace. 246 * @param n The number of the network namespace.
256 * @param local_m The number of nodes in a network namespace. 247 * @param local_m The number of nodes in a network namespace.
257 */ 248 */
258static void 249static struct GNUNET_TESTING_Interpreter *
259start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, 250start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
260 const char *router_ip, 251 const char *router_ip,
261 const char *node_ip, 252 const char *node_ip,
@@ -393,7 +384,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
393 TIMEOUT, 384 TIMEOUT,
394 &handle_result, 385 &handle_result,
395 ts); 386 ts);
396 387 return is;
397} 388}
398 389
399 390
@@ -416,7 +407,6 @@ libgnunet_test_transport_plugin_cmd_simple_send_dv_init (void *cls)
416 api->start_testcase = &start_testcase; 407 api->start_testcase = &start_testcase;
417 api->all_peers_started = &all_peers_started; 408 api->all_peers_started = &all_peers_started;
418 api->all_local_tests_prepared = all_local_tests_prepared; 409 api->all_local_tests_prepared = all_local_tests_prepared;
419 api->barrier_advanced = barrier_advanced;
420 api->get_waiting_for_barriers = get_waiting_for_barriers; 410 api->get_waiting_for_barriers = get_waiting_for_barriers;
421 return api; 411 return api;
422} 412}
diff --git a/src/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
index f96a25e80..524250590 100644
--- a/src/transport/test_transport_plugin_cmd_udp_backchannel.c
+++ b/src/transport/test_transport_plugin_cmd_udp_backchannel.c
@@ -24,7 +24,7 @@
24 * @author t3sserakt 24 * @author t3sserakt
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include "gnunet_testing_ng_lib.h" 27#include "gnunet_testing_barrier.h"
28#include "gnunet_testing_netjail_lib.h" 28#include "gnunet_testing_netjail_lib.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_transport_application_service.h" 30#include "gnunet_transport_application_service.h"
@@ -93,16 +93,6 @@ get_waiting_for_barriers ()
93} 93}
94 94
95 95
96static void
97barrier_advanced (const char *barrier_name)
98{
99 struct GNUNET_TESTING_Barrier *barrier = GNUNET_TESTING_get_barrier (is,
100 barrier_name);
101
102 GNUNET_TESTING_finish_attached_cmds (is, barrier);
103}
104
105
106/** 96/**
107 * Callback to set the flag indicating all peers started. Will be called via the plugin api. 97 * Callback to set the flag indicating all peers started. Will be called via the plugin api.
108 * 98 *
@@ -193,7 +183,7 @@ all_local_tests_prepared ()
193 * @param n The number of the network namespace. 183 * @param n The number of the network namespace.
194 * @param local_m The number of nodes in a network namespace. 184 * @param local_m The number of nodes in a network namespace.
195 */ 185 */
196static void 186static struct GNUNET_TESTING_Interpreter *
197start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message, 187start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
198 const char *router_ip, 188 const char *router_ip,
199 const char *node_ip, 189 const char *node_ip,
@@ -331,7 +321,7 @@ start_testcase (GNUNET_TESTING_cmd_helper_write_cb write_message,
331 TIMEOUT, 321 TIMEOUT,
332 &handle_result, 322 &handle_result,
333 ts); 323 ts);
334 324 return is;
335} 325}
336 326
337 327
@@ -354,7 +344,6 @@ libgnunet_test_transport_plugin_cmd_udp_backchannel_init (void *cls)
354 api->start_testcase = &start_testcase; 344 api->start_testcase = &start_testcase;
355 api->all_peers_started = &all_peers_started; 345 api->all_peers_started = &all_peers_started;
356 api->all_local_tests_prepared = all_local_tests_prepared; 346 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; 347 api->get_waiting_for_barriers = get_waiting_for_barriers;
359 return api; 348 return api;
360} 349}