diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-06 14:38:24 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-06 14:38:24 +0000 |
commit | 2ca4b8a208f6f910c819bbaa6785a25ae2955501 (patch) | |
tree | 7328fb7cfc62189197dfa34035502a80b0acdcd3 | |
parent | 8d46a214ce11653b5160d32e330786fa487e3ae6 (diff) | |
download | gnunet-2ca4b8a208f6f910c819bbaa6785a25ae2955501.tar.gz gnunet-2ca4b8a208f6f910c819bbaa6785a25ae2955501.zip |
- give out run handle through which master controller's handle can be retrieved
32 files changed, 200 insertions, 53 deletions
diff --git a/doc/testbed_test.c b/doc/testbed_test.c index c34d064b0..d6ab1aa1b 100644 --- a/doc/testbed_test.c +++ b/doc/testbed_test.c | |||
@@ -131,13 +131,16 @@ dht_da (void *cls, void *op_result) | |||
131 | * just to the DHT service of peer 0. | 131 | * just to the DHT service of peer 0. |
132 | * | 132 | * |
133 | * @param cls closure | 133 | * @param cls closure |
134 | * @param h the run handle | ||
134 | * @param peers started peers for the test | 135 | * @param peers started peers for the test |
135 | * @param num_peers size of the 'peers' array | 136 | * @param num_peers size of the 'peers' array |
136 | * @param links_succeeded number of links between peers that were created | 137 | * @param links_succeeded number of links between peers that were created |
137 | * @param links_failed number of links testbed was unable to establish | 138 | * @param links_failed number of links testbed was unable to establish |
138 | */ | 139 | */ |
139 | static void | 140 | static void |
140 | test_master (void *cls, unsigned int num_peers, | 141 | test_master (void *cls, |
142 | struct GNUNET_TESTBED_RunHandle *h, | ||
143 | unsigned int num_peers, | ||
141 | struct GNUNET_TESTBED_Peer **peers, | 144 | struct GNUNET_TESTBED_Peer **peers, |
142 | unsigned int links_succeeded, | 145 | unsigned int links_succeeded, |
143 | unsigned int links_failed) | 146 | unsigned int links_failed) |
diff --git a/src/consensus/gnunet-consensus-profiler.c b/src/consensus/gnunet-consensus-profiler.c index 418cc99ba..b64abeff6 100644 --- a/src/consensus/gnunet-consensus-profiler.c +++ b/src/consensus/gnunet-consensus-profiler.c | |||
@@ -303,6 +303,7 @@ peer_info_cb (void *cb_cls, | |||
303 | * Signature of a main function for a testcase. | 303 | * Signature of a main function for a testcase. |
304 | * | 304 | * |
305 | * @param cls closure | 305 | * @param cls closure |
306 | * @param h the run handle | ||
306 | * @param num_peers number of peers in 'peers' | 307 | * @param num_peers number of peers in 'peers' |
307 | * @param started_peers handle to peers run in the testbed. NULL upon timeout (see | 308 | * @param started_peers handle to peers run in the testbed. NULL upon timeout (see |
308 | * GNUNET_TESTBED_test_run()). | 309 | * GNUNET_TESTBED_test_run()). |
@@ -313,6 +314,7 @@ peer_info_cb (void *cb_cls, | |||
313 | */ | 314 | */ |
314 | static void | 315 | static void |
315 | test_master (void *cls, | 316 | test_master (void *cls, |
317 | struct GNUNET_TESTBED_RunHandle *h, | ||
316 | unsigned int num_peers, | 318 | unsigned int num_peers, |
317 | struct GNUNET_TESTBED_Peer **started_peers, | 319 | struct GNUNET_TESTBED_Peer **started_peers, |
318 | unsigned int links_succeeded, | 320 | unsigned int links_succeeded, |
diff --git a/src/dht/dht_test_lib.c b/src/dht/dht_test_lib.c index dbd3006a5..de41b2ecc 100644 --- a/src/dht/dht_test_lib.c +++ b/src/dht/dht_test_lib.c | |||
@@ -159,6 +159,7 @@ GNUNET_DHT_TEST_cleanup (struct GNUNET_DHT_TEST_Context *ctx) | |||
159 | 159 | ||
160 | static void | 160 | static void |
161 | dht_test_run (void *cls, | 161 | dht_test_run (void *cls, |
162 | struct GNUNET_TESTBED_RunHandle *h, | ||
162 | unsigned int num_peers, | 163 | unsigned int num_peers, |
163 | struct GNUNET_TESTBED_Peer **peers, | 164 | struct GNUNET_TESTBED_Peer **peers, |
164 | unsigned int links_succeeded, | 165 | unsigned int links_succeeded, |
diff --git a/src/dv/test_transport_blacklist.c b/src/dv/test_transport_blacklist.c index 834cde19a..4e287a5bd 100644 --- a/src/dv/test_transport_blacklist.c +++ b/src/dv/test_transport_blacklist.c | |||
@@ -33,6 +33,7 @@ static int ok; | |||
33 | 33 | ||
34 | static void | 34 | static void |
35 | test_connection (void *cls, | 35 | test_connection (void *cls, |
36 | struct GNUNET_TESTBED_RunHandle *h, | ||
36 | unsigned int num_peers, | 37 | unsigned int num_peers, |
37 | struct GNUNET_TESTBED_Peer **peers, | 38 | struct GNUNET_TESTBED_Peer **peers, |
38 | unsigned int links_succeeded, | 39 | unsigned int links_succeeded, |
diff --git a/src/dv/test_transport_dv.c b/src/dv/test_transport_dv.c index ea19ad201..aa208515f 100644 --- a/src/dv/test_transport_dv.c +++ b/src/dv/test_transport_dv.c | |||
@@ -33,6 +33,7 @@ static int ok; | |||
33 | 33 | ||
34 | static void | 34 | static void |
35 | test_connection (void *cls, | 35 | test_connection (void *cls, |
36 | struct GNUNET_TESTBED_RunHandle *h, | ||
36 | unsigned int num_peers, | 37 | unsigned int num_peers, |
37 | struct GNUNET_TESTBED_Peer **peers, | 38 | struct GNUNET_TESTBED_Peer **peers, |
38 | unsigned int links_succeeded, | 39 | unsigned int links_succeeded, |
diff --git a/src/experimentation/test_experimentation_clique_connect.c b/src/experimentation/test_experimentation_clique_connect.c index 1905035b3..a84eabd7e 100644 --- a/src/experimentation/test_experimentation_clique_connect.c +++ b/src/experimentation/test_experimentation_clique_connect.c | |||
@@ -345,6 +345,7 @@ stat_disconnect_adapter (void *cls, void *op_result) | |||
345 | * Signature of a main function for a testcase. | 345 | * Signature of a main function for a testcase. |
346 | * | 346 | * |
347 | * @param cls closure | 347 | * @param cls closure |
348 | * @param h the run handle | ||
348 | * @param num_peers number of peers in 'peers' | 349 | * @param num_peers number of peers in 'peers' |
349 | * @param peers_ handle to peers run in the testbed | 350 | * @param peers_ handle to peers run in the testbed |
350 | * @param links_succeeded the number of overlay link connection attempts that | 351 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -353,7 +354,9 @@ stat_disconnect_adapter (void *cls, void *op_result) | |||
353 | * failed | 354 | * failed |
354 | */ | 355 | */ |
355 | static void | 356 | static void |
356 | test_master (void *cls, unsigned int num_peers, | 357 | test_master (void *cls, |
358 | struct GNUNET_TESTBED_RunHandle *h, | ||
359 | unsigned int num_peers, | ||
357 | struct GNUNET_TESTBED_Peer **peers_, | 360 | struct GNUNET_TESTBED_Peer **peers_, |
358 | unsigned int links_succeeded, | 361 | unsigned int links_succeeded, |
359 | unsigned int links_failed) | 362 | unsigned int links_failed) |
diff --git a/src/experimentation/test_experimentation_clique_run.c b/src/experimentation/test_experimentation_clique_run.c index e7613bba1..62f6c74f6 100644 --- a/src/experimentation/test_experimentation_clique_run.c +++ b/src/experimentation/test_experimentation_clique_run.c | |||
@@ -318,6 +318,7 @@ stat_disconnect_adapter (void *cls, void *op_result) | |||
318 | * Signature of a main function for a testcase. | 318 | * Signature of a main function for a testcase. |
319 | * | 319 | * |
320 | * @param cls closure | 320 | * @param cls closure |
321 | * @param h the run handle | ||
321 | * @param num_peers number of peers in 'peers' | 322 | * @param num_peers number of peers in 'peers' |
322 | * @param peers_ handle to peers run in the testbed | 323 | * @param peers_ handle to peers run in the testbed |
323 | * @param links_succeeded the number of overlay link connection attempts that | 324 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -326,7 +327,9 @@ stat_disconnect_adapter (void *cls, void *op_result) | |||
326 | * failed | 327 | * failed |
327 | */ | 328 | */ |
328 | static void | 329 | static void |
329 | test_master (void *cls, unsigned int num_peers, | 330 | test_master (void *cls, |
331 | struct GNUNET_TESTBED_RunHandle *h, | ||
332 | unsigned int num_peers, | ||
330 | struct GNUNET_TESTBED_Peer **peers_, | 333 | struct GNUNET_TESTBED_Peer **peers_, |
331 | unsigned int links_succeeded, | 334 | unsigned int links_succeeded, |
332 | unsigned int links_failed) | 335 | unsigned int links_failed) |
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c index cde70ae88..33b293055 100644 --- a/src/fs/gnunet-fs-profiler.c +++ b/src/fs/gnunet-fs-profiler.c | |||
@@ -128,6 +128,7 @@ terminate_task (void *cls, | |||
128 | * Signature of a main function for a testcase. | 128 | * Signature of a main function for a testcase. |
129 | * | 129 | * |
130 | * @param cls closure | 130 | * @param cls closure |
131 | * @param h the run handle | ||
131 | * @param num_peers number of peers in 'peers' | 132 | * @param num_peers number of peers in 'peers' |
132 | * @param peers handle to peers run in the testbed | 133 | * @param peers handle to peers run in the testbed |
133 | * @param links_succeeded the number of overlay link connection attempts that | 134 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -136,7 +137,9 @@ terminate_task (void *cls, | |||
136 | * failed | 137 | * failed |
137 | */ | 138 | */ |
138 | static void | 139 | static void |
139 | test_master (void *cls, unsigned int num_peers, | 140 | test_master (void *cls, |
141 | struct GNUNET_TESTBED_RunHandle *h, | ||
142 | unsigned int num_peers, | ||
140 | struct GNUNET_TESTBED_Peer **peers, | 143 | struct GNUNET_TESTBED_Peer **peers, |
141 | unsigned int links_succeeded, | 144 | unsigned int links_succeeded, |
142 | unsigned int links_failed) | 145 | unsigned int links_failed) |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index b4b71be4e..61356a644 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -304,7 +304,8 @@ do_download (void *cls, | |||
304 | 304 | ||
305 | 305 | ||
306 | static void | 306 | static void |
307 | do_publish (void *cls, | 307 | do_publish (void *cls, |
308 | struct GNUNET_TESTBED_RunHandle *h, | ||
308 | unsigned int num_peers, | 309 | unsigned int num_peers, |
309 | struct GNUNET_TESTBED_Peer **peers, | 310 | struct GNUNET_TESTBED_Peer **peers, |
310 | unsigned int links_succeeded, | 311 | unsigned int links_succeeded, |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c index c5846c8c3..8790dcc75 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_respect.c +++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c | |||
@@ -434,6 +434,7 @@ do_publish1 (void *cls, | |||
434 | 434 | ||
435 | static void | 435 | static void |
436 | do_connect (void *cls, | 436 | do_connect (void *cls, |
437 | struct GNUNET_TESTBED_RunHandle *h, | ||
437 | unsigned int num_peers, | 438 | unsigned int num_peers, |
438 | struct GNUNET_TESTBED_Peer **peers, | 439 | struct GNUNET_TESTBED_Peer **peers, |
439 | unsigned int links_succeeded, | 440 | unsigned int links_succeeded, |
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c index 81625030d..689456aa4 100644 --- a/src/fs/test_fs_test_lib.c +++ b/src/fs/test_fs_test_lib.c | |||
@@ -115,6 +115,7 @@ do_publish (void *cls, | |||
115 | * Actual main function for the test. | 115 | * Actual main function for the test. |
116 | * | 116 | * |
117 | * @param cls closure | 117 | * @param cls closure |
118 | * @param h the run handle | ||
118 | * @param num_peers number of peers in 'peers' | 119 | * @param num_peers number of peers in 'peers' |
119 | * @param peers handle to peers run in the testbed | 120 | * @param peers handle to peers run in the testbed |
120 | * @param links_succeeded the number of overlay link connection attempts that | 121 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -124,6 +125,7 @@ do_publish (void *cls, | |||
124 | */ | 125 | */ |
125 | static void | 126 | static void |
126 | run (void *cls, | 127 | run (void *cls, |
128 | struct GNUNET_TESTBED_RunHandle *h, | ||
127 | unsigned int num_peers, | 129 | unsigned int num_peers, |
128 | struct GNUNET_TESTBED_Peer **peers, | 130 | struct GNUNET_TESTBED_Peer **peers, |
129 | unsigned int links_succeeded, | 131 | unsigned int links_succeeded, |
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index 58e6374d5..436b8f66d 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c | |||
@@ -161,6 +161,7 @@ do_wait (void *cls, const struct GNUNET_FS_Uri *uri, | |||
161 | 161 | ||
162 | static void | 162 | static void |
163 | do_publish (void *cls, | 163 | do_publish (void *cls, |
164 | struct GNUNET_TESTBED_RunHandle *h, | ||
164 | unsigned int num_peers, | 165 | unsigned int num_peers, |
165 | struct GNUNET_TESTBED_Peer **peers, | 166 | struct GNUNET_TESTBED_Peer **peers, |
166 | unsigned int links_succeeded, | 167 | unsigned int links_succeeded, |
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index 63f5627c2..9c01695b5 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c | |||
@@ -114,6 +114,7 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri, | |||
114 | 114 | ||
115 | static void | 115 | static void |
116 | do_publish (void *cls, | 116 | do_publish (void *cls, |
117 | struct GNUNET_TESTBED_RunHandle *h, | ||
117 | unsigned int num_peers, | 118 | unsigned int num_peers, |
118 | struct GNUNET_TESTBED_Peer **peers, | 119 | struct GNUNET_TESTBED_Peer **peers, |
119 | unsigned int links_succeeded, | 120 | unsigned int links_succeeded, |
diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c index 076bbc6b6..dd83d52f6 100644 --- a/src/gns/test_gns_dht_three_peers.c +++ b/src/gns/test_gns_dht_three_peers.c | |||
@@ -596,6 +596,7 @@ peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op, | |||
596 | 596 | ||
597 | 597 | ||
598 | void testbed_master (void *cls, | 598 | void testbed_master (void *cls, |
599 | struct GNUNET_TESTBED_RunHandle *h, | ||
599 | unsigned int num_peers, | 600 | unsigned int num_peers, |
600 | struct GNUNET_TESTBED_Peer **peers, | 601 | struct GNUNET_TESTBED_Peer **peers, |
601 | unsigned int links_succeeded, | 602 | unsigned int links_succeeded, |
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 44eceadfb..9c09e5689 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -1328,11 +1328,16 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers, | |||
1328 | GNUNET_TESTBED_OperationCompletionCallback cont, | 1328 | GNUNET_TESTBED_OperationCompletionCallback cont, |
1329 | void *cls); | 1329 | void *cls); |
1330 | 1330 | ||
1331 | /** | ||
1332 | * Handle for testbed run helper funtions | ||
1333 | */ | ||
1334 | struct GNUNET_TESTBED_RunHandle; | ||
1331 | 1335 | ||
1332 | /** | 1336 | /** |
1333 | * Signature of a main function for a testcase. | 1337 | * Signature of a main function for a testcase. |
1334 | * | 1338 | * |
1335 | * @param cls closure | 1339 | * @param cls closure |
1340 | * @param h the run handle | ||
1336 | * @param num_peers number of peers in 'peers' | 1341 | * @param num_peers number of peers in 'peers' |
1337 | * @param peers handle to peers run in the testbed. NULL upon timeout (see | 1342 | * @param peers handle to peers run in the testbed. NULL upon timeout (see |
1338 | * GNUNET_TESTBED_test_run()). | 1343 | * GNUNET_TESTBED_test_run()). |
@@ -1340,8 +1345,10 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers, | |||
1340 | * succeeded | 1345 | * succeeded |
1341 | * @param links_failed the number of overlay link connection attempts that | 1346 | * @param links_failed the number of overlay link connection attempts that |
1342 | * failed | 1347 | * failed |
1348 | * @see GNUNET_TESTBED_test_run() | ||
1343 | */ | 1349 | */ |
1344 | typedef void (*GNUNET_TESTBED_TestMaster)(void *cls, | 1350 | typedef void (*GNUNET_TESTBED_TestMaster)(void *cls, |
1351 | struct GNUNET_TESTBED_RunHandle *h, | ||
1345 | unsigned int num_peers, | 1352 | unsigned int num_peers, |
1346 | struct GNUNET_TESTBED_Peer **peers, | 1353 | struct GNUNET_TESTBED_Peer **peers, |
1347 | unsigned int links_succeeded, | 1354 | unsigned int links_succeeded, |
@@ -1442,6 +1449,16 @@ GNUNET_TESTBED_test_run (const char *testname, | |||
1442 | 1449 | ||
1443 | 1450 | ||
1444 | /** | 1451 | /** |
1452 | * Obtain handle to the master controller from a testbed run. The handle | ||
1453 | * returned should not be disconnected. | ||
1454 | * | ||
1455 | * @param h the testbed run handle | ||
1456 | * @return handle to the master controller | ||
1457 | */ | ||
1458 | struct GNUNET_TESTBED_Controller * | ||
1459 | GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h); | ||
1460 | |||
1461 | /** | ||
1445 | * Opaque handle for barrier | 1462 | * Opaque handle for barrier |
1446 | */ | 1463 | */ |
1447 | struct GNUNET_TESTBED_Barrier; | 1464 | struct GNUNET_TESTBED_Barrier; |
diff --git a/src/mesh/mesh_test_lib.c b/src/mesh/mesh_test_lib.c index a6a7c2114..353edb494 100644 --- a/src/mesh/mesh_test_lib.c +++ b/src/mesh/mesh_test_lib.c | |||
@@ -213,6 +213,7 @@ GNUNET_MESH_TEST_cleanup (struct GNUNET_MESH_TEST_Context *ctx) | |||
213 | * each other) | 213 | * each other) |
214 | * | 214 | * |
215 | * @param cls Closure (context). | 215 | * @param cls Closure (context). |
216 | * @param h the run handle | ||
216 | * @param num_peers Number of peers that are running. | 217 | * @param num_peers Number of peers that are running. |
217 | * @param peers Handles to each one of the @c num_peers peers. | 218 | * @param peers Handles to each one of the @c num_peers peers. |
218 | * @param links_succeeded the number of overlay link connection attempts that | 219 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -222,6 +223,7 @@ GNUNET_MESH_TEST_cleanup (struct GNUNET_MESH_TEST_Context *ctx) | |||
222 | */ | 223 | */ |
223 | static void | 224 | static void |
224 | mesh_test_run (void *cls, | 225 | mesh_test_run (void *cls, |
226 | struct GNUNET_TESTBED_RunHandle *h, | ||
225 | unsigned int num_peers, | 227 | unsigned int num_peers, |
226 | struct GNUNET_TESTBED_Peer **peers, | 228 | struct GNUNET_TESTBED_Peer **peers, |
227 | unsigned int links_succeeded, | 229 | unsigned int links_succeeded, |
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index cddaf32ff..e03da6d6e 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c | |||
@@ -757,6 +757,7 @@ master_controller_cb (void *cls, | |||
757 | * Signature of a main function for a testcase. | 757 | * Signature of a main function for a testcase. |
758 | * | 758 | * |
759 | * @param cls NULL | 759 | * @param cls NULL |
760 | * @param h the run handle | ||
760 | * @param num_peers_ number of peers in 'peers' | 761 | * @param num_peers_ number of peers in 'peers' |
761 | * @param peers handle to peers run in the testbed. NULL upon timeout (see | 762 | * @param peers handle to peers run in the testbed. NULL upon timeout (see |
762 | * GNUNET_TESTBED_test_run()). | 763 | * GNUNET_TESTBED_test_run()). |
@@ -767,6 +768,7 @@ master_controller_cb (void *cls, | |||
767 | */ | 768 | */ |
768 | static void | 769 | static void |
769 | test_master (void *cls, | 770 | test_master (void *cls, |
771 | struct GNUNET_TESTBED_RunHandle *h, | ||
770 | unsigned int num_peers_, | 772 | unsigned int num_peers_, |
771 | struct GNUNET_TESTBED_Peer **peers, | 773 | struct GNUNET_TESTBED_Peer **peers, |
772 | unsigned int links_succeeded, | 774 | unsigned int links_succeeded, |
diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c index 9ae3a7aac..45462013c 100644 --- a/src/nse/test_nse_multipeer.c +++ b/src/nse/test_nse_multipeer.c | |||
@@ -179,6 +179,7 @@ nse_disconnect_adapter (void *cls, | |||
179 | * Actual "main" function for the testcase. | 179 | * Actual "main" function for the testcase. |
180 | * | 180 | * |
181 | * @param cls closure | 181 | * @param cls closure |
182 | * @param h the run handle | ||
182 | * @param num_peers number of peers in 'peers' | 183 | * @param num_peers number of peers in 'peers' |
183 | * @param peers handle to peers run in the testbed | 184 | * @param peers handle to peers run in the testbed |
184 | * @param links_succeeded the number of overlay link connection attempts that | 185 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -188,6 +189,7 @@ nse_disconnect_adapter (void *cls, | |||
188 | */ | 189 | */ |
189 | static void | 190 | static void |
190 | run (void *cls, | 191 | run (void *cls, |
192 | struct GNUNET_TESTBED_RunHandle *h, | ||
191 | unsigned int num_peers, | 193 | unsigned int num_peers, |
192 | struct GNUNET_TESTBED_Peer **peers, | 194 | struct GNUNET_TESTBED_Peer **peers, |
193 | unsigned int links_succeeded, | 195 | unsigned int links_succeeded, |
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index 638f1a1a4..dffa64d7a 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c | |||
@@ -1097,6 +1097,7 @@ dht_da (void *cls, void *op_result) | |||
1097 | * Signature of a main function for a testcase. | 1097 | * Signature of a main function for a testcase. |
1098 | * | 1098 | * |
1099 | * @param cls NULL | 1099 | * @param cls NULL |
1100 | * @param h the run handle | ||
1100 | * @param num_peers_ number of peers in 'peers' | 1101 | * @param num_peers_ number of peers in 'peers' |
1101 | * @param testbed_peers handle to peers run in the testbed. NULL upon timeout (see | 1102 | * @param testbed_peers handle to peers run in the testbed. NULL upon timeout (see |
1102 | * GNUNET_TESTBED_test_run()). | 1103 | * GNUNET_TESTBED_test_run()). |
@@ -1107,6 +1108,7 @@ dht_da (void *cls, void *op_result) | |||
1107 | */ | 1108 | */ |
1108 | static void | 1109 | static void |
1109 | test_master (void *cls, | 1110 | test_master (void *cls, |
1111 | struct GNUNET_TESTBED_RunHandle *h, | ||
1110 | unsigned int num_peers_, | 1112 | unsigned int num_peers_, |
1111 | struct GNUNET_TESTBED_Peer **testbed_peers, | 1113 | struct GNUNET_TESTBED_Peer **testbed_peers, |
1112 | unsigned int links_succeeded, | 1114 | unsigned int links_succeeded, |
diff --git a/src/testbed/gnunet-service-test-barriers.c b/src/testbed/gnunet-service-test-barriers.c index 6c43ad4b3..84c6bde68 100644 --- a/src/testbed/gnunet-service-test-barriers.c +++ b/src/testbed/gnunet-service-test-barriers.c | |||
@@ -20,8 +20,8 @@ | |||
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file testbed/gnunet-service-test-barriers.c | 22 | * @file testbed/gnunet-service-test-barriers.c |
23 | * @brief Service for testing testbed barriers. This service is started as a | 23 | * @brief Daemon acting as a service for testing testbed barriers. It is |
24 | * peer service and waits for a barrier to be crossed. | 24 | * started as a peer service and waits for a barrier to be crossed. |
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
26 | */ | 26 | */ |
27 | 27 | ||
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index bd3fe8afd..0b36fed9f 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -209,6 +209,7 @@ controller_event_cb (void *cls, | |||
209 | * Signature of a main function for a testcase. | 209 | * Signature of a main function for a testcase. |
210 | * | 210 | * |
211 | * @param cls closure | 211 | * @param cls closure |
212 | * @param h the run handle | ||
212 | * @param num_peers number of peers in 'peers' | 213 | * @param num_peers number of peers in 'peers' |
213 | * @param peers handle to peers run in the testbed | 214 | * @param peers handle to peers run in the testbed |
214 | * @param links_succeeded the number of overlay link connection attempts that | 215 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -216,7 +217,9 @@ controller_event_cb (void *cls, | |||
216 | * @param links_failed the number of overlay link | 217 | * @param links_failed the number of overlay link |
217 | */ | 218 | */ |
218 | static void | 219 | static void |
219 | test_run (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, | 220 | test_run (void *cls, |
221 | struct GNUNET_TESTBED_RunHandle *h, | ||
222 | unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, | ||
220 | unsigned int links_succeeded, | 223 | unsigned int links_succeeded, |
221 | unsigned int links_failed) | 224 | unsigned int links_failed) |
222 | { | 225 | { |
diff --git a/src/testbed/test_testbed_api_barriers.c b/src/testbed/test_testbed_api_barriers.c index 1e6a8012d..b40fbc87a 100644 --- a/src/testbed/test_testbed_api_barriers.c +++ b/src/testbed/test_testbed_api_barriers.c | |||
@@ -24,8 +24,74 @@ | |||
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | ||
28 | #include "gnunet_util_lib.h" | ||
29 | #include "gnunet_testbed_service.h" | ||
27 | 30 | ||
28 | int main () | 31 | /** |
32 | * Number of peers we start in this test case | ||
33 | */ | ||
34 | #define NUM_PEERS 3 | ||
35 | |||
36 | /** | ||
37 | * Result of this test case | ||
38 | */ | ||
39 | static int result; | ||
40 | |||
41 | |||
42 | /** | ||
43 | * Signature of a main function for a testcase. | ||
44 | * | ||
45 | * @param cls closure | ||
46 | * @param h the run handle | ||
47 | * @param num_peers number of peers in 'peers' | ||
48 | * @param peers_ handle to peers run in the testbed | ||
49 | * @param links_succeeded the number of overlay link connection attempts that | ||
50 | * succeeded | ||
51 | * @param links_failed the number of overlay link connection attempts that | ||
52 | * failed | ||
53 | */ | ||
54 | static void | ||
55 | test_master (void *cls, | ||
56 | struct GNUNET_TESTBED_RunHandle *h, | ||
57 | unsigned int num_peers, | ||
58 | struct GNUNET_TESTBED_Peer **peers_, | ||
59 | unsigned int links_succeeded, | ||
60 | unsigned int links_failed) | ||
29 | { | 61 | { |
62 | |||
63 | GNUNET_assert (NULL == cls); | ||
64 | if (NULL == peers_) | ||
65 | { | ||
66 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n"); | ||
67 | return; | ||
68 | } | ||
69 | GNUNET_assert (NUM_PEERS == num_peers); | ||
70 | |||
71 | result = GNUNET_OK; | ||
72 | GNUNET_SCHEDULER_shutdown (); | ||
73 | /* shutdown_task = */ | ||
74 | /* GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply */ | ||
75 | /* (GNUNET_TIME_UNIT_SECONDS, 300), */ | ||
76 | /* do_shutdown, NULL); */ | ||
77 | } | ||
78 | |||
79 | |||
80 | /** | ||
81 | * Main function | ||
82 | */ | ||
83 | int | ||
84 | main (int argc, char **argv) | ||
85 | { | ||
86 | uint64_t event_mask; | ||
87 | |||
88 | result = GNUNET_SYSERR; | ||
89 | event_mask = 0; | ||
90 | (void) GNUNET_TESTBED_test_run ("test_testbed_api_test", | ||
91 | "test_testbed_api_barriers.conf", NUM_PEERS, | ||
92 | event_mask, NULL, NULL, | ||
93 | &test_master, NULL); | ||
94 | if (GNUNET_OK != result) | ||
95 | return 1; | ||
30 | return 0; | 96 | return 0; |
31 | } | 97 | } |
diff --git a/src/testbed/test_testbed_api_peer_reconfiguration.c b/src/testbed/test_testbed_api_peer_reconfiguration.c index e2aa2c140..7f7bf6473 100644 --- a/src/testbed/test_testbed_api_peer_reconfiguration.c +++ b/src/testbed/test_testbed_api_peer_reconfiguration.c | |||
@@ -143,6 +143,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | |||
143 | * Signature of a main function for a testcase. | 143 | * Signature of a main function for a testcase. |
144 | * | 144 | * |
145 | * @param cls closure | 145 | * @param cls closure |
146 | * @param h the run handle | ||
146 | * @param num_peers number of peers in 'peers' | 147 | * @param num_peers number of peers in 'peers' |
147 | * @param peers_ handle to peers run in the testbed | 148 | * @param peers_ handle to peers run in the testbed |
148 | * @param links_succeeded the number of overlay link connection attempts that | 149 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -151,7 +152,9 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | |||
151 | * failed | 152 | * failed |
152 | */ | 153 | */ |
153 | static void | 154 | static void |
154 | test_master (void *cls, unsigned int num_peers, | 155 | test_master (void *cls, |
156 | struct GNUNET_TESTBED_RunHandle *h, | ||
157 | unsigned int num_peers, | ||
155 | struct GNUNET_TESTBED_Peer **peers_, | 158 | struct GNUNET_TESTBED_Peer **peers_, |
156 | unsigned int links_succeeded, | 159 | unsigned int links_succeeded, |
157 | unsigned int links_failed) | 160 | unsigned int links_failed) |
diff --git a/src/testbed/test_testbed_api_peers_manage_services.c b/src/testbed/test_testbed_api_peers_manage_services.c index 12af939fb..29eed3d12 100644 --- a/src/testbed/test_testbed_api_peers_manage_services.c +++ b/src/testbed/test_testbed_api_peers_manage_services.c | |||
@@ -164,6 +164,7 @@ op_comp_cb (void *cls, | |||
164 | * Signature of a main function for a testcase. | 164 | * Signature of a main function for a testcase. |
165 | * | 165 | * |
166 | * @param cls closure | 166 | * @param cls closure |
167 | * @param h the run handle | ||
167 | * @param num_peers number of peers in 'peers' | 168 | * @param num_peers number of peers in 'peers' |
168 | * @param peers_ handle to peers run in the testbed | 169 | * @param peers_ handle to peers run in the testbed |
169 | * @param links_succeeded the number of overlay link connection attempts that | 170 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -172,7 +173,9 @@ op_comp_cb (void *cls, | |||
172 | * failed | 173 | * failed |
173 | */ | 174 | */ |
174 | static void | 175 | static void |
175 | test_master (void *cls, unsigned int num_peers, | 176 | test_master (void *cls, |
177 | struct GNUNET_TESTBED_RunHandle *h, | ||
178 | unsigned int num_peers, | ||
176 | struct GNUNET_TESTBED_Peer **peers_, | 179 | struct GNUNET_TESTBED_Peer **peers_, |
177 | unsigned int links_succeeded, | 180 | unsigned int links_succeeded, |
178 | unsigned int links_failed) | 181 | unsigned int links_failed) |
diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c index 463dc736e..e0f48fcb5 100644 --- a/src/testbed/test_testbed_api_statistics.c +++ b/src/testbed/test_testbed_api_statistics.c | |||
@@ -159,6 +159,7 @@ op_comp_cb (void *cls, | |||
159 | * Signature of a main function for a testcase. | 159 | * Signature of a main function for a testcase. |
160 | * | 160 | * |
161 | * @param cls closure | 161 | * @param cls closure |
162 | * @param h the run handle | ||
162 | * @param num_peers number of peers in 'peers' | 163 | * @param num_peers number of peers in 'peers' |
163 | * @param peers_ handle to peers run in the testbed | 164 | * @param peers_ handle to peers run in the testbed |
164 | * @param links_succeeded the number of overlay link connection attempts that | 165 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -167,7 +168,9 @@ op_comp_cb (void *cls, | |||
167 | * failed | 168 | * failed |
168 | */ | 169 | */ |
169 | static void | 170 | static void |
170 | test_master (void *cls, unsigned int num_peers, | 171 | test_master (void *cls, |
172 | struct GNUNET_TESTBED_RunHandle *h, | ||
173 | unsigned int num_peers, | ||
171 | struct GNUNET_TESTBED_Peer **peers_, | 174 | struct GNUNET_TESTBED_Peer **peers_, |
172 | unsigned int links_succeeded, | 175 | unsigned int links_succeeded, |
173 | unsigned int links_failed) | 176 | unsigned int links_failed) |
diff --git a/src/testbed/test_testbed_api_test.c b/src/testbed/test_testbed_api_test.c index 8eb2ba7f1..bd5ee28c4 100644 --- a/src/testbed/test_testbed_api_test.c +++ b/src/testbed/test_testbed_api_test.c | |||
@@ -193,6 +193,7 @@ controller_event_cb (void *cls, | |||
193 | * Signature of a main function for a testcase. | 193 | * Signature of a main function for a testcase. |
194 | * | 194 | * |
195 | * @param cls closure | 195 | * @param cls closure |
196 | * @param h the run handle | ||
196 | * @param num_peers number of peers in 'peers' | 197 | * @param num_peers number of peers in 'peers' |
197 | * @param peers- handle to peers run in the testbed | 198 | * @param peers- handle to peers run in the testbed |
198 | * @param links_succeeded the number of overlay link connection attempts that | 199 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -201,7 +202,9 @@ controller_event_cb (void *cls, | |||
201 | * failed | 202 | * failed |
202 | */ | 203 | */ |
203 | static void | 204 | static void |
204 | test_master (void *cls, unsigned int num_peers, | 205 | test_master (void *cls, |
206 | struct GNUNET_TESTBED_RunHandle *h, | ||
207 | unsigned int num_peers, | ||
205 | struct GNUNET_TESTBED_Peer **peers_, | 208 | struct GNUNET_TESTBED_Peer **peers_, |
206 | unsigned int links_succeeded, | 209 | unsigned int links_succeeded, |
207 | unsigned int links_failed) | 210 | unsigned int links_failed) |
diff --git a/src/testbed/test_testbed_api_test_timeout.c b/src/testbed/test_testbed_api_test_timeout.c index 95bc30d38..ddc4dee0b 100644 --- a/src/testbed/test_testbed_api_test_timeout.c +++ b/src/testbed/test_testbed_api_test_timeout.c | |||
@@ -78,6 +78,7 @@ controller_event_cb (void *cls, | |||
78 | * Signature of a main function for a testcase. | 78 | * Signature of a main function for a testcase. |
79 | * | 79 | * |
80 | * @param cls closure | 80 | * @param cls closure |
81 | * @param h the run handle | ||
81 | * @param num_peers number of peers in 'peers' | 82 | * @param num_peers number of peers in 'peers' |
82 | * @param peers- handle to peers run in the testbed | 83 | * @param peers- handle to peers run in the testbed |
83 | * @param links_succeeded the number of overlay link connection attempts that | 84 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -86,7 +87,9 @@ controller_event_cb (void *cls, | |||
86 | * failed | 87 | * failed |
87 | */ | 88 | */ |
88 | static void | 89 | static void |
89 | test_master (void *cls, unsigned int num_peers, | 90 | test_master (void *cls, |
91 | struct GNUNET_TESTBED_RunHandle *h, | ||
92 | unsigned int num_peers, | ||
90 | struct GNUNET_TESTBED_Peer **peers_, | 93 | struct GNUNET_TESTBED_Peer **peers_, |
91 | unsigned int links_succeeded, | 94 | unsigned int links_succeeded, |
92 | unsigned int links_failed) | 95 | unsigned int links_failed) |
diff --git a/src/testbed/test_testbed_api_testbed_run.c b/src/testbed/test_testbed_api_testbed_run.c index b22905757..b7cff2ec7 100644 --- a/src/testbed/test_testbed_api_testbed_run.c +++ b/src/testbed/test_testbed_api_testbed_run.c | |||
@@ -98,6 +98,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
98 | * Signature of a main function for a testcase. | 98 | * Signature of a main function for a testcase. |
99 | * | 99 | * |
100 | * @param cls closure | 100 | * @param cls closure |
101 | * @param h the run handle | ||
101 | * @param num_peers number of peers in 'peers' | 102 | * @param num_peers number of peers in 'peers' |
102 | * @param peers_ handle to peers run in the testbed | 103 | * @param peers_ handle to peers run in the testbed |
103 | * @param links_succeeded the number of overlay link connection attempts that | 104 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -106,7 +107,9 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
106 | * failed | 107 | * failed |
107 | */ | 108 | */ |
108 | static void | 109 | static void |
109 | test_master (void *cls, unsigned int num_peers, | 110 | test_master (void *cls, |
111 | struct GNUNET_TESTBED_RunHandle *h, | ||
112 | unsigned int num_peers, | ||
110 | struct GNUNET_TESTBED_Peer **peers_, | 113 | struct GNUNET_TESTBED_Peer **peers_, |
111 | unsigned int links_succeeded, | 114 | unsigned int links_succeeded, |
112 | unsigned int links_failed) | 115 | unsigned int links_failed) |
diff --git a/src/testbed/test_testbed_api_topology.c b/src/testbed/test_testbed_api_topology.c index e8f1c55be..a435ce0f7 100644 --- a/src/testbed/test_testbed_api_topology.c +++ b/src/testbed/test_testbed_api_topology.c | |||
@@ -119,6 +119,7 @@ controller_event_cb (void *cls, | |||
119 | * Signature of a main function for a testcase. | 119 | * Signature of a main function for a testcase. |
120 | * | 120 | * |
121 | * @param cls closure | 121 | * @param cls closure |
122 | * @param h the run handle | ||
122 | * @param num_peers number of peers in 'peers' | 123 | * @param num_peers number of peers in 'peers' |
123 | * @param peers_ handle to peers run in the testbed | 124 | * @param peers_ handle to peers run in the testbed |
124 | * @param links_succeeded the number of overlay link connection attempts that | 125 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -127,7 +128,9 @@ controller_event_cb (void *cls, | |||
127 | * failed | 128 | * failed |
128 | */ | 129 | */ |
129 | static void | 130 | static void |
130 | test_master (void *cls, unsigned int num_peers, | 131 | test_master (void *cls, |
132 | struct GNUNET_TESTBED_RunHandle *h, | ||
133 | unsigned int num_peers, | ||
131 | struct GNUNET_TESTBED_Peer **peers_, | 134 | struct GNUNET_TESTBED_Peer **peers_, |
132 | unsigned int links_succeeded, | 135 | unsigned int links_succeeded, |
133 | unsigned int links_failed) | 136 | unsigned int links_failed) |
@@ -135,8 +138,12 @@ test_master (void *cls, unsigned int num_peers, | |||
135 | unsigned int peer; | 138 | unsigned int peer; |
136 | 139 | ||
137 | GNUNET_assert (NULL == cls); | 140 | GNUNET_assert (NULL == cls); |
141 | if (NULL == peers_) | ||
142 | { | ||
143 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n"); | ||
144 | return; | ||
145 | } | ||
138 | GNUNET_assert (NUM_PEERS == num_peers); | 146 | GNUNET_assert (NUM_PEERS == num_peers); |
139 | GNUNET_assert (NULL != peers_); | ||
140 | for (peer = 0; peer < num_peers; peer++) | 147 | for (peer = 0; peer < num_peers; peer++) |
141 | GNUNET_assert (NULL != peers_[peer]); | 148 | GNUNET_assert (NULL != peers_[peer]); |
142 | peers = peers_; | 149 | peers = peers_; |
diff --git a/src/testbed/test_testbed_api_topology_clique.c b/src/testbed/test_testbed_api_topology_clique.c index 30cce6c0d..9270f8f78 100644 --- a/src/testbed/test_testbed_api_topology_clique.c +++ b/src/testbed/test_testbed_api_topology_clique.c | |||
@@ -114,6 +114,7 @@ controller_event_cb (void *cls, | |||
114 | * Signature of a main function for a testcase. | 114 | * Signature of a main function for a testcase. |
115 | * | 115 | * |
116 | * @param cls closure | 116 | * @param cls closure |
117 | * @param h the run handle | ||
117 | * @param num_peers number of peers in 'peers' | 118 | * @param num_peers number of peers in 'peers' |
118 | * @param peers_ handle to peers run in the testbed | 119 | * @param peers_ handle to peers run in the testbed |
119 | * @param links_succeeded the number of overlay link connection attempts that | 120 | * @param links_succeeded the number of overlay link connection attempts that |
@@ -122,7 +123,9 @@ controller_event_cb (void *cls, | |||
122 | * failed | 123 | * failed |
123 | */ | 124 | */ |
124 | static void | 125 | static void |
125 | test_master (void *cls, unsigned int num_peers, | 126 | test_master (void *cls, |
127 | struct GNUNET_TESTBED_RunHandle *h, | ||
128 | unsigned int num_peers, | ||
126 | struct GNUNET_TESTBED_Peer **peers_, | 129 | struct GNUNET_TESTBED_Peer **peers_, |
127 | unsigned int links_succeeded, | 130 | unsigned int links_succeeded, |
128 | unsigned int links_failed) | 131 | unsigned int links_failed) |
@@ -130,8 +133,12 @@ test_master (void *cls, unsigned int num_peers, | |||
130 | unsigned int peer; | 133 | unsigned int peer; |
131 | 134 | ||
132 | GNUNET_assert (NULL == cls); | 135 | GNUNET_assert (NULL == cls); |
136 | if (NULL == peers_) | ||
137 | { | ||
138 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failing test due to timeout\n"); | ||
139 | return; | ||
140 | } | ||
133 | GNUNET_assert (NUM_PEERS == num_peers); | 141 | GNUNET_assert (NUM_PEERS == num_peers); |
134 | GNUNET_assert (NULL != peers_); | ||
135 | for (peer = 0; peer < num_peers; peer++) | 142 | for (peer = 0; peer < num_peers; peer++) |
136 | GNUNET_assert (NULL != peers_[peer]); | 143 | GNUNET_assert (NULL != peers_[peer]); |
137 | peers = peers_; | 144 | peers = peers_; |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 3da5f9058..b00e2825c 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -50,10 +50,6 @@ | |||
50 | */ | 50 | */ |
51 | #define DEFAULT_SETUP_TIMEOUT 300 | 51 | #define DEFAULT_SETUP_TIMEOUT 300 |
52 | 52 | ||
53 | /** | ||
54 | * Testbed Run Handle | ||
55 | */ | ||
56 | struct RunContext; | ||
57 | 53 | ||
58 | /** | 54 | /** |
59 | * Context information for the operation we start | 55 | * Context information for the operation we start |
@@ -68,7 +64,7 @@ struct RunContextOperation | |||
68 | /** | 64 | /** |
69 | * Context information for GNUNET_TESTBED_run() | 65 | * Context information for GNUNET_TESTBED_run() |
70 | */ | 66 | */ |
71 | struct RunContext *rc; | 67 | struct GNUNET_TESTBED_RunHandle *rc; |
72 | 68 | ||
73 | /** | 69 | /** |
74 | * Closure | 70 | * Closure |
@@ -130,7 +126,7 @@ struct CompatibilityCheckContext | |||
130 | /** | 126 | /** |
131 | * The run context | 127 | * The run context |
132 | */ | 128 | */ |
133 | struct RunContext *rc; | 129 | struct GNUNET_TESTBED_RunHandle *rc; |
134 | 130 | ||
135 | /** | 131 | /** |
136 | * Handle for the compability check | 132 | * Handle for the compability check |
@@ -147,7 +143,7 @@ struct CompatibilityCheckContext | |||
147 | /** | 143 | /** |
148 | * Testbed Run Handle | 144 | * Testbed Run Handle |
149 | */ | 145 | */ |
150 | struct RunContext | 146 | struct GNUNET_TESTBED_RunHandle |
151 | { | 147 | { |
152 | /** | 148 | /** |
153 | * The controller handle | 149 | * The controller handle |
@@ -381,7 +377,7 @@ search_iterator (void *cls, uint32_t key, void *value) | |||
381 | * @return the matching RunContextOperation if found; NULL if not | 377 | * @return the matching RunContextOperation if found; NULL if not |
382 | */ | 378 | */ |
383 | static struct RunContextOperation * | 379 | static struct RunContextOperation * |
384 | search_rcop (struct RunContext *rc, struct GNUNET_TESTBED_Operation *op) | 380 | search_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct GNUNET_TESTBED_Operation *op) |
385 | { | 381 | { |
386 | struct SearchContext sc; | 382 | struct SearchContext sc; |
387 | 383 | ||
@@ -407,7 +403,7 @@ search_rcop (struct RunContext *rc, struct GNUNET_TESTBED_Operation *op) | |||
407 | * @param rcop the RunContextOperation to insert | 403 | * @param rcop the RunContextOperation to insert |
408 | */ | 404 | */ |
409 | static void | 405 | static void |
410 | insert_rcop (struct RunContext *rc, struct RunContextOperation *rcop) | 406 | insert_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation *rcop) |
411 | { | 407 | { |
412 | GNUNET_assert (GNUNET_OK == | 408 | GNUNET_assert (GNUNET_OK == |
413 | GNUNET_CONTAINER_multihashmap32_put (rc->rcop_map, | 409 | GNUNET_CONTAINER_multihashmap32_put (rc->rcop_map, |
@@ -424,7 +420,7 @@ insert_rcop (struct RunContext *rc, struct RunContextOperation *rcop) | |||
424 | * @param rcop the RunContextOperation | 420 | * @param rcop the RunContextOperation |
425 | */ | 421 | */ |
426 | static void | 422 | static void |
427 | remove_rcop (struct RunContext *rc, struct RunContextOperation *rcop) | 423 | remove_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct RunContextOperation *rcop) |
428 | { | 424 | { |
429 | GNUNET_assert (GNUNET_YES == | 425 | GNUNET_assert (GNUNET_YES == |
430 | GNUNET_CONTAINER_multihashmap32_remove (rc->rcop_map, | 426 | GNUNET_CONTAINER_multihashmap32_remove (rc->rcop_map, |
@@ -440,7 +436,7 @@ remove_rcop (struct RunContext *rc, struct RunContextOperation *rcop) | |||
440 | static void | 436 | static void |
441 | cleanup (void *cls) | 437 | cleanup (void *cls) |
442 | { | 438 | { |
443 | struct RunContext *rc = cls; | 439 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
444 | unsigned int hid; | 440 | unsigned int hid; |
445 | 441 | ||
446 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rc->register_hosts_task); | 442 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rc->register_hosts_task); |
@@ -478,7 +474,7 @@ cleanup (void *cls) | |||
478 | static int | 474 | static int |
479 | rcop_cleanup_iterator (void *cls, uint32_t key, void *value) | 475 | rcop_cleanup_iterator (void *cls, uint32_t key, void *value) |
480 | { | 476 | { |
481 | struct RunContext *rc = cls; | 477 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
482 | struct RunContextOperation *rcop = value; | 478 | struct RunContextOperation *rcop = value; |
483 | 479 | ||
484 | GNUNET_assert (rc == rcop->rc); | 480 | GNUNET_assert (rc == rcop->rc); |
@@ -495,7 +491,7 @@ rcop_cleanup_iterator (void *cls, uint32_t key, void *value) | |||
495 | * @param rc the RunContext | 491 | * @param rc the RunContext |
496 | */ | 492 | */ |
497 | static void | 493 | static void |
498 | rc_cleanup_operations (struct RunContext *rc) | 494 | rc_cleanup_operations (struct GNUNET_TESTBED_RunHandle *rc) |
499 | { | 495 | { |
500 | struct CompatibilityCheckContext *hc; | 496 | struct CompatibilityCheckContext *hc; |
501 | unsigned int nhost; | 497 | unsigned int nhost; |
@@ -546,7 +542,7 @@ rc_cleanup_operations (struct RunContext *rc) | |||
546 | * @param rc the run context | 542 | * @param rc the run context |
547 | */ | 543 | */ |
548 | static void | 544 | static void |
549 | cancel_interrupt_task (struct RunContext *rc) | 545 | cancel_interrupt_task (struct GNUNET_TESTBED_RunHandle *rc) |
550 | { | 546 | { |
551 | GNUNET_SCHEDULER_cancel (rc->interrupt_task); | 547 | GNUNET_SCHEDULER_cancel (rc->interrupt_task); |
552 | rc->interrupt_task = GNUNET_SCHEDULER_NO_TASK; | 548 | rc->interrupt_task = GNUNET_SCHEDULER_NO_TASK; |
@@ -562,7 +558,7 @@ cancel_interrupt_task (struct RunContext *rc) | |||
562 | static void | 558 | static void |
563 | wait_op_completion (void *cls) | 559 | wait_op_completion (void *cls) |
564 | { | 560 | { |
565 | struct RunContext *rc = cls; | 561 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
566 | struct RunContextOperation *rcop; | 562 | struct RunContextOperation *rcop; |
567 | 563 | ||
568 | if ( (NULL == rc->cproc) | 564 | if ( (NULL == rc->cproc) |
@@ -604,7 +600,7 @@ wait_op_completion (void *cls) | |||
604 | static void | 600 | static void |
605 | interrupt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 601 | interrupt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
606 | { | 602 | { |
607 | struct RunContext *rc = cls; | 603 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
608 | struct GNUNET_TESTBED_Controller *c = rc->c; | 604 | struct GNUNET_TESTBED_Controller *c = rc->c; |
609 | unsigned int size; | 605 | unsigned int size; |
610 | 606 | ||
@@ -634,7 +630,7 @@ interrupt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
634 | * @return the representation string; this is NOT reentrant | 630 | * @return the representation string; this is NOT reentrant |
635 | */ | 631 | */ |
636 | static const char * | 632 | static const char * |
637 | prof_time (struct RunContext *rc) | 633 | prof_time (struct GNUNET_TESTBED_RunHandle *rc) |
638 | { | 634 | { |
639 | struct GNUNET_TIME_Relative ptime; | 635 | struct GNUNET_TIME_Relative ptime; |
640 | 636 | ||
@@ -652,7 +648,7 @@ prof_time (struct RunContext *rc) | |||
652 | static void | 648 | static void |
653 | start_peers_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 649 | start_peers_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
654 | { | 650 | { |
655 | struct RunContext *rc = cls; | 651 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
656 | struct RunContextOperation *rcop; | 652 | struct RunContextOperation *rcop; |
657 | unsigned int peer; | 653 | unsigned int peer; |
658 | 654 | ||
@@ -684,7 +680,7 @@ static void | |||
684 | peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg) | 680 | peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg) |
685 | { | 681 | { |
686 | struct RunContextOperation *rcop = cls; | 682 | struct RunContextOperation *rcop = cls; |
687 | struct RunContext *rc; | 683 | struct GNUNET_TESTBED_RunHandle *rc; |
688 | 684 | ||
689 | GNUNET_assert (NULL != rcop); | 685 | GNUNET_assert (NULL != rcop); |
690 | GNUNET_assert (NULL != (rc = rcop->rc)); | 686 | GNUNET_assert (NULL != (rc = rcop->rc)); |
@@ -715,12 +711,12 @@ peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg) | |||
715 | * @param rc the RunContext | 711 | * @param rc the RunContext |
716 | */ | 712 | */ |
717 | static void | 713 | static void |
718 | call_master (struct RunContext *rc) | 714 | call_master (struct GNUNET_TESTBED_RunHandle *rc) |
719 | { | 715 | { |
720 | GNUNET_SCHEDULER_cancel (rc->timeout_task); | 716 | GNUNET_SCHEDULER_cancel (rc->timeout_task); |
721 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 717 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
722 | if (NULL != rc->test_master) | 718 | if (NULL != rc->test_master) |
723 | rc->test_master (rc->test_master_cls, rc->num_peers, rc->peers, | 719 | rc->test_master (rc->test_master_cls, rc, rc->num_peers, rc->peers, |
724 | rc->links_succeeded, rc->links_failed); | 720 | rc->links_succeeded, rc->links_failed); |
725 | } | 721 | } |
726 | 722 | ||
@@ -738,7 +734,7 @@ static void | |||
738 | topology_completion_callback (void *cls, unsigned int nsuccess, | 734 | topology_completion_callback (void *cls, unsigned int nsuccess, |
739 | unsigned int nfailures) | 735 | unsigned int nfailures) |
740 | { | 736 | { |
741 | struct RunContext *rc = cls; | 737 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
742 | 738 | ||
743 | DEBUG ("Overlay topology generated in %s\n", prof_time (rc)); | 739 | DEBUG ("Overlay topology generated in %s\n", prof_time (rc)); |
744 | GNUNET_TESTBED_operation_done (rc->topology_operation); | 740 | GNUNET_TESTBED_operation_done (rc->topology_operation); |
@@ -756,7 +752,7 @@ topology_completion_callback (void *cls, unsigned int nsuccess, | |||
756 | * @param rc the RunContext | 752 | * @param rc the RunContext |
757 | */ | 753 | */ |
758 | static void | 754 | static void |
759 | create_peers (struct RunContext *rc) | 755 | create_peers (struct GNUNET_TESTBED_RunHandle *rc) |
760 | { | 756 | { |
761 | struct RunContextOperation *rcop; | 757 | struct RunContextOperation *rcop; |
762 | unsigned int peer; | 758 | unsigned int peer; |
@@ -793,7 +789,7 @@ create_peers (struct RunContext *rc) | |||
793 | static void | 789 | static void |
794 | event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | 790 | event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) |
795 | { | 791 | { |
796 | struct RunContext *rc = cls; | 792 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
797 | struct RunContextOperation *rcop; | 793 | struct RunContextOperation *rcop; |
798 | 794 | ||
799 | if (RC_INIT == rc->state) | 795 | if (RC_INIT == rc->state) |
@@ -940,7 +936,7 @@ register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | |||
940 | static void | 936 | static void |
941 | host_registration_completion (void *cls, const char *emsg) | 937 | host_registration_completion (void *cls, const char *emsg) |
942 | { | 938 | { |
943 | struct RunContext *rc = cls; | 939 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
944 | 940 | ||
945 | rc->reg_handle = NULL; | 941 | rc->reg_handle = NULL; |
946 | if (NULL != emsg) | 942 | if (NULL != emsg) |
@@ -963,7 +959,7 @@ host_registration_completion (void *cls, const char *emsg) | |||
963 | static void | 959 | static void |
964 | register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 960 | register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
965 | { | 961 | { |
966 | struct RunContext *rc = cls; | 962 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
967 | struct RunContextOperation *rcop; | 963 | struct RunContextOperation *rcop; |
968 | unsigned int slave; | 964 | unsigned int slave; |
969 | 965 | ||
@@ -1005,7 +1001,7 @@ static void | |||
1005 | controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, | 1001 | controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, |
1006 | int status) | 1002 | int status) |
1007 | { | 1003 | { |
1008 | struct RunContext *rc = cls; | 1004 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
1009 | uint64_t event_mask; | 1005 | uint64_t event_mask; |
1010 | 1006 | ||
1011 | if (status != GNUNET_OK) | 1007 | if (status != GNUNET_OK) |
@@ -1052,7 +1048,7 @@ netint_proc (void *cls, const char *name, int isDefault, | |||
1052 | const struct sockaddr *addr, const struct sockaddr *broadcast_addr, | 1048 | const struct sockaddr *addr, const struct sockaddr *broadcast_addr, |
1053 | const struct sockaddr *netmask, socklen_t addrlen) | 1049 | const struct sockaddr *netmask, socklen_t addrlen) |
1054 | { | 1050 | { |
1055 | struct RunContext *rc = cls; | 1051 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
1056 | char hostip[NI_MAXHOST]; | 1052 | char hostip[NI_MAXHOST]; |
1057 | char *buf; | 1053 | char *buf; |
1058 | 1054 | ||
@@ -1088,7 +1084,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, | |||
1088 | int status) | 1084 | int status) |
1089 | { | 1085 | { |
1090 | struct CompatibilityCheckContext *hc = cls; | 1086 | struct CompatibilityCheckContext *hc = cls; |
1091 | struct RunContext *rc; | 1087 | struct GNUNET_TESTBED_RunHandle *rc; |
1092 | struct GNUNET_TESTBED_Host **old_hosts; | 1088 | struct GNUNET_TESTBED_Host **old_hosts; |
1093 | unsigned int nhost; | 1089 | unsigned int nhost; |
1094 | 1090 | ||
@@ -1157,13 +1153,13 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host, | |||
1157 | static void | 1153 | static void |
1158 | timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1154 | timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
1159 | { | 1155 | { |
1160 | struct RunContext *rc = cls; | 1156 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
1161 | 1157 | ||
1162 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 1158 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1163 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); | 1159 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); |
1164 | GNUNET_SCHEDULER_shutdown (); | 1160 | GNUNET_SCHEDULER_shutdown (); |
1165 | if (NULL != rc->test_master) | 1161 | if (NULL != rc->test_master) |
1166 | rc->test_master (rc->test_master_cls, 0, NULL, 0, 0); | 1162 | rc->test_master (rc->test_master_cls, rc, 0, NULL, 0, 0); |
1167 | rc->test_master = NULL; | 1163 | rc->test_master = NULL; |
1168 | } | 1164 | } |
1169 | 1165 | ||
@@ -1203,7 +1199,7 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1203 | GNUNET_TESTBED_TestMaster test_master, | 1199 | GNUNET_TESTBED_TestMaster test_master, |
1204 | void *test_master_cls) | 1200 | void *test_master_cls) |
1205 | { | 1201 | { |
1206 | struct RunContext *rc; | 1202 | struct GNUNET_TESTBED_RunHandle *rc; |
1207 | char *topology; | 1203 | char *topology; |
1208 | struct CompatibilityCheckContext *hc; | 1204 | struct CompatibilityCheckContext *hc; |
1209 | struct GNUNET_TIME_Relative timeout; | 1205 | struct GNUNET_TIME_Relative timeout; |
@@ -1212,7 +1208,7 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1212 | unsigned int nhost; | 1208 | unsigned int nhost; |
1213 | 1209 | ||
1214 | GNUNET_assert (num_peers > 0); | 1210 | GNUNET_assert (num_peers > 0); |
1215 | rc = GNUNET_malloc (sizeof (struct RunContext)); | 1211 | rc = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_RunHandle)); |
1216 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); | 1212 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); |
1217 | #if ENABLE_LL | 1213 | #if ENABLE_LL |
1218 | rc->num_hosts = GNUNET_TESTBED_hosts_load_from_loadleveler (rc->cfg, | 1214 | rc->num_hosts = GNUNET_TESTBED_hosts_load_from_loadleveler (rc->cfg, |
diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c index 1a6b14773..f78fa5bf0 100644 --- a/src/topology/test_gnunet_daemon_topology.c +++ b/src/topology/test_gnunet_daemon_topology.c | |||
@@ -62,7 +62,8 @@ notify_connect_complete (void *cls, | |||
62 | 62 | ||
63 | 63 | ||
64 | static void | 64 | static void |
65 | do_connect (void *cls, | 65 | do_connect (void *cls, |
66 | struct GNUNET_TESTBED_RunHandle *h, | ||
66 | unsigned int num_peers, | 67 | unsigned int num_peers, |
67 | struct GNUNET_TESTBED_Peer **peers, | 68 | struct GNUNET_TESTBED_Peer **peers, |
68 | unsigned int links_succeeded, | 69 | unsigned int links_succeeded, |