aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/testbed_test.c5
-rw-r--r--src/consensus/gnunet-consensus-profiler.c2
-rw-r--r--src/dht/dht_test_lib.c1
-rw-r--r--src/dv/test_transport_blacklist.c1
-rw-r--r--src/dv/test_transport_dv.c1
-rw-r--r--src/experimentation/test_experimentation_clique_connect.c5
-rw-r--r--src/experimentation/test_experimentation_clique_run.c5
-rw-r--r--src/fs/gnunet-fs-profiler.c5
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p.c3
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p_respect.c1
-rw-r--r--src/fs/test_fs_test_lib.c2
-rw-r--r--src/fs/test_gnunet_service_fs_migration.c1
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c1
-rw-r--r--src/gns/test_gns_dht_three_peers.c1
-rw-r--r--src/include/gnunet_testbed_service.h17
-rw-r--r--src/mesh/mesh_test_lib.c2
-rw-r--r--src/nse/gnunet-nse-profiler.c2
-rw-r--r--src/nse/test_nse_multipeer.c2
-rw-r--r--src/regex/gnunet-regex-profiler.c2
-rw-r--r--src/testbed/gnunet-service-test-barriers.c4
-rw-r--r--src/testbed/gnunet-testbed-profiler.c5
-rw-r--r--src/testbed/test_testbed_api_barriers.c68
-rw-r--r--src/testbed/test_testbed_api_peer_reconfiguration.c5
-rw-r--r--src/testbed/test_testbed_api_peers_manage_services.c5
-rw-r--r--src/testbed/test_testbed_api_statistics.c5
-rw-r--r--src/testbed/test_testbed_api_test.c5
-rw-r--r--src/testbed/test_testbed_api_test_timeout.c5
-rw-r--r--src/testbed/test_testbed_api_testbed_run.c5
-rw-r--r--src/testbed/test_testbed_api_topology.c11
-rw-r--r--src/testbed/test_testbed_api_topology_clique.c11
-rw-r--r--src/testbed/testbed_api_testbed.c62
-rw-r--r--src/topology/test_gnunet_daemon_topology.c3
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 */
139static void 140static void
140test_master (void *cls, unsigned int num_peers, 141test_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 */
314static void 315static void
315test_master (void *cls, 316test_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
160static void 160static void
161dht_test_run (void *cls, 161dht_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
34static void 34static void
35test_connection (void *cls, 35test_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
34static void 34static void
35test_connection (void *cls, 35test_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 */
355static void 356static void
356test_master (void *cls, unsigned int num_peers, 357test_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 */
328static void 329static void
329test_master (void *cls, unsigned int num_peers, 330test_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 */
138static void 139static void
139test_master (void *cls, unsigned int num_peers, 140test_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
306static void 306static void
307do_publish (void *cls, 307do_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
435static void 435static void
436do_connect (void *cls, 436do_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 */
125static void 126static void
126run (void *cls, 127run (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
162static void 162static void
163do_publish (void *cls, 163do_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
115static void 115static void
116do_publish (void *cls, 116do_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
598void testbed_master (void *cls, 598void 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 */
1334struct 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 */
1344typedef void (*GNUNET_TESTBED_TestMaster)(void *cls, 1350typedef 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 */
1458struct GNUNET_TESTBED_Controller *
1459GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h);
1460
1461/**
1445 * Opaque handle for barrier 1462 * Opaque handle for barrier
1446 */ 1463 */
1447struct GNUNET_TESTBED_Barrier; 1464struct 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 */
223static void 224static void
224mesh_test_run (void *cls, 225mesh_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 */
768static void 769static void
769test_master (void *cls, 770test_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 */
189static void 190static void
190run (void *cls, 191run (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 */
1108static void 1109static void
1109test_master (void *cls, 1110test_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 */
218static void 219static void
219test_run (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, 220test_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
28int 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 */
39static 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 */
54static void
55test_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 */
83int
84main (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 */
153static void 154static void
154test_master (void *cls, unsigned int num_peers, 155test_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 */
174static void 175static void
175test_master (void *cls, unsigned int num_peers, 176test_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 */
169static void 170static void
170test_master (void *cls, unsigned int num_peers, 171test_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 */
203static void 204static void
204test_master (void *cls, unsigned int num_peers, 205test_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 */
88static void 89static void
89test_master (void *cls, unsigned int num_peers, 90test_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 */
108static void 109static void
109test_master (void *cls, unsigned int num_peers, 110test_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 */
129static void 130static void
130test_master (void *cls, unsigned int num_peers, 131test_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 */
124static void 125static void
125test_master (void *cls, unsigned int num_peers, 126test_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 */
56struct 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 */
150struct RunContext 146struct 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 */
383static struct RunContextOperation * 379static struct RunContextOperation *
384search_rcop (struct RunContext *rc, struct GNUNET_TESTBED_Operation *op) 380search_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 */
409static void 405static void
410insert_rcop (struct RunContext *rc, struct RunContextOperation *rcop) 406insert_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 */
426static void 422static void
427remove_rcop (struct RunContext *rc, struct RunContextOperation *rcop) 423remove_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)
440static void 436static void
441cleanup (void *cls) 437cleanup (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)
478static int 474static int
479rcop_cleanup_iterator (void *cls, uint32_t key, void *value) 475rcop_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 */
497static void 493static void
498rc_cleanup_operations (struct RunContext *rc) 494rc_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 */
548static void 544static void
549cancel_interrupt_task (struct RunContext *rc) 545cancel_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)
562static void 558static void
563wait_op_completion (void *cls) 559wait_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)
604static void 600static void
605interrupt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 601interrupt (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 */
636static const char * 632static const char *
637prof_time (struct RunContext *rc) 633prof_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)
652static void 648static void
653start_peers_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 649start_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
684peer_create_cb (void *cls, struct GNUNET_TESTBED_Peer *peer, const char *emsg) 680peer_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 */
717static void 713static void
718call_master (struct RunContext *rc) 714call_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
738topology_completion_callback (void *cls, unsigned int nsuccess, 734topology_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 */
758static void 754static void
759create_peers (struct RunContext *rc) 755create_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)
793static void 789static void
794event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) 790event_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);
940static void 936static void
941host_registration_completion (void *cls, const char *emsg) 937host_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)
963static void 959static void
964register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 960register_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
1005controller_status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, 1001controller_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,
1157static void 1153static void
1158timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1154timeout_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
64static void 64static void
65do_connect (void *cls, 65do_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,