diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-28 16:47:02 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-03-28 16:47:02 +0000 |
commit | 949f21f03df9f08b0a73c3e47a798e63790edf7f (patch) | |
tree | 52f56432e08a0b83cfc155e1af45e1587d32073d | |
parent | 8f8e6a5bb1ccbb7d1311332ec1cc3a340bdd621f (diff) | |
download | gnunet-949f21f03df9f08b0a73c3e47a798e63790edf7f.tar.gz gnunet-949f21f03df9f08b0a73c3e47a798e63790edf7f.zip |
provide how many links succeeded and how many failed in test master callback
from GNUNET_TESTBED_run() and GNUNET_TESTBED_test_run() functions
29 files changed, 189 insertions, 38 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index c7aea82e9..863b7cc40 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -803,9 +803,9 @@ GAS_addresses_update (struct GAS_Addresses_Handle *handle, | |||
803 | session_id, atsi, atsi_count); | 803 | session_id, atsi, atsi_count); |
804 | if (aa == NULL) | 804 | if (aa == NULL) |
805 | { | 805 | { |
806 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Tried to update unknown address for peer `%s' `%s' session id %u\n", | 806 | /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Tried to update unknown address for peer `%s' `%s' session id %u\n", */ |
807 | GNUNET_i2s (peer), plugin_name, session_id); | 807 | /* GNUNET_i2s (peer), plugin_name, session_id); */ |
808 | GNUNET_break (0); | 808 | /* GNUNET_break (0); */ |
809 | return; | 809 | return; |
810 | } | 810 | } |
811 | 811 | ||
diff --git a/src/consensus/gnunet-consensus-start-peers.c b/src/consensus/gnunet-consensus-start-peers.c index fb7f047ae..ad88b0f08 100644 --- a/src/consensus/gnunet-consensus-start-peers.c +++ b/src/consensus/gnunet-consensus-start-peers.c | |||
@@ -105,10 +105,24 @@ controller_cb(void *cls, | |||
105 | 105 | ||
106 | 106 | ||
107 | 107 | ||
108 | /** | ||
109 | * Signature of a main function for a testcase. | ||
110 | * | ||
111 | * @param cls closure | ||
112 | * @param num_peers number of peers in 'peers' | ||
113 | * @param peers handle to peers run in the testbed. NULL upon timeout (see | ||
114 | * GNUNET_TESTBED_test_run()). | ||
115 | * @param links_succeeded the number of overlay link connection attempts that | ||
116 | * succeeded | ||
117 | * @param links_failed the number of overlay link connection attempts that | ||
118 | * failed | ||
119 | */ | ||
108 | static void | 120 | static void |
109 | test_master (void *cls, | 121 | test_master (void *cls, |
110 | unsigned int num_peers, | 122 | unsigned int num_peers, |
111 | struct GNUNET_TESTBED_Peer **started_peers) | 123 | struct GNUNET_TESTBED_Peer **started_peers, |
124 | unsigned int links_succeeded, | ||
125 | unsigned int links_failed) | ||
112 | { | 126 | { |
113 | int i; | 127 | int i; |
114 | 128 | ||
diff --git a/src/consensus/gnunet-consensus.c b/src/consensus/gnunet-consensus.c index 4525fc719..2524a20ca 100644 --- a/src/consensus/gnunet-consensus.c +++ b/src/consensus/gnunet-consensus.c | |||
@@ -276,10 +276,24 @@ peer_info_cb (void *cb_cls, | |||
276 | } | 276 | } |
277 | 277 | ||
278 | 278 | ||
279 | /** | ||
280 | * Signature of a main function for a testcase. | ||
281 | * | ||
282 | * @param cls closure | ||
283 | * @param num_peers number of peers in 'peers' | ||
284 | * @param peers handle to peers run in the testbed. NULL upon timeout (see | ||
285 | * GNUNET_TESTBED_test_run()). | ||
286 | * @param links_succeeded the number of overlay link connection attempts that | ||
287 | * succeeded | ||
288 | * @param links_failed the number of overlay link connection attempts that | ||
289 | * failed | ||
290 | */ | ||
279 | static void | 291 | static void |
280 | test_master (void *cls, | 292 | test_master (void *cls, |
281 | unsigned int num_peers, | 293 | unsigned int num_peers, |
282 | struct GNUNET_TESTBED_Peer **started_peers) | 294 | struct GNUNET_TESTBED_Peer **started_peers, |
295 | unsigned int links_succeeded, | ||
296 | unsigned int links_failed) | ||
283 | { | 297 | { |
284 | int i; | 298 | int i; |
285 | 299 | ||
diff --git a/src/dht/dht_test_lib.c b/src/dht/dht_test_lib.c index 365804b71..dbd3006a5 100644 --- a/src/dht/dht_test_lib.c +++ b/src/dht/dht_test_lib.c | |||
@@ -160,7 +160,9 @@ GNUNET_DHT_TEST_cleanup (struct GNUNET_DHT_TEST_Context *ctx) | |||
160 | static void | 160 | static void |
161 | dht_test_run (void *cls, | 161 | dht_test_run (void *cls, |
162 | unsigned int num_peers, | 162 | unsigned int num_peers, |
163 | struct GNUNET_TESTBED_Peer **peers) | 163 | struct GNUNET_TESTBED_Peer **peers, |
164 | unsigned int links_succeeded, | ||
165 | unsigned int links_failed) | ||
164 | { | 166 | { |
165 | struct GNUNET_DHT_TEST_Context *ctx = cls; | 167 | struct GNUNET_DHT_TEST_Context *ctx = cls; |
166 | unsigned int i; | 168 | unsigned int i; |
diff --git a/src/dv/test_transport_blacklist.c b/src/dv/test_transport_blacklist.c index 2adf45d4a..e8cd5102b 100644 --- a/src/dv/test_transport_blacklist.c +++ b/src/dv/test_transport_blacklist.c | |||
@@ -34,7 +34,9 @@ static int ok; | |||
34 | static void | 34 | static void |
35 | test_connection (void *cls, | 35 | test_connection (void *cls, |
36 | unsigned int num_peers, | 36 | unsigned int num_peers, |
37 | struct GNUNET_TESTBED_Peer **peers) | 37 | struct GNUNET_TESTBED_Peer **peers, |
38 | unsigned int links_succeeded, | ||
39 | unsigned int links_failed) | ||
38 | { | 40 | { |
39 | if (4 == num_peers) | 41 | if (4 == num_peers) |
40 | { | 42 | { |
diff --git a/src/dv/test_transport_dv.c b/src/dv/test_transport_dv.c index c527827e8..13e9afa62 100644 --- a/src/dv/test_transport_dv.c +++ b/src/dv/test_transport_dv.c | |||
@@ -34,7 +34,9 @@ static int ok; | |||
34 | static void | 34 | static void |
35 | test_connection (void *cls, | 35 | test_connection (void *cls, |
36 | unsigned int num_peers, | 36 | unsigned int num_peers, |
37 | struct GNUNET_TESTBED_Peer **peers) | 37 | struct GNUNET_TESTBED_Peer **peers, |
38 | unsigned int links_succeeded, | ||
39 | unsigned int links_failed) | ||
38 | { | 40 | { |
39 | if (4 != num_peers) | 41 | if (4 != num_peers) |
40 | { | 42 | { |
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c index aeb84315a..9bc3ff253 100644 --- a/src/fs/gnunet-fs-profiler.c +++ b/src/fs/gnunet-fs-profiler.c | |||
@@ -130,9 +130,16 @@ terminate_task (void *cls, | |||
130 | * @param cls closure | 130 | * @param cls closure |
131 | * @param num_peers number of peers in 'peers' | 131 | * @param num_peers number of peers in 'peers' |
132 | * @param peers handle to peers run in the testbed | 132 | * @param peers handle to peers run in the testbed |
133 | * @param links_succeeded the number of overlay link connection attempts that | ||
134 | * succeeded | ||
135 | * @param links_failed the number of overlay link connection attempts that | ||
136 | * failed | ||
133 | */ | 137 | */ |
134 | static void | 138 | static void |
135 | test_master (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers) | 139 | test_master (void *cls, unsigned int num_peers, |
140 | struct GNUNET_TESTBED_Peer **peers, | ||
141 | unsigned int links_succeeded, | ||
142 | unsigned int links_failed) | ||
136 | { | 143 | { |
137 | // const struct GNUNET_CONFIGURATION_Handle *cfg = cls; | 144 | // const struct GNUNET_CONFIGURATION_Handle *cfg = cls; |
138 | // FIXME: enable clients to signal 'completion' before timeout; | 145 | // FIXME: enable clients to signal 'completion' before timeout; |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 89db80c0b..3a6b9fd03 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -306,7 +306,9 @@ do_download (void *cls, | |||
306 | static void | 306 | static void |
307 | do_publish (void *cls, | 307 | do_publish (void *cls, |
308 | unsigned int num_peers, | 308 | unsigned int num_peers, |
309 | struct GNUNET_TESTBED_Peer **peers) | 309 | struct GNUNET_TESTBED_Peer **peers, |
310 | unsigned int links_succeeded, | ||
311 | unsigned int links_failed) | ||
310 | { | 312 | { |
311 | unsigned int i; | 313 | unsigned int i; |
312 | int do_index; | 314 | int do_index; |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c index 0a5dc0578..35425a253 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_respect.c +++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c | |||
@@ -435,7 +435,9 @@ do_publish1 (void *cls, | |||
435 | static void | 435 | static void |
436 | do_connect (void *cls, | 436 | do_connect (void *cls, |
437 | unsigned int num_peers, | 437 | unsigned int num_peers, |
438 | struct GNUNET_TESTBED_Peer **peers) | 438 | struct GNUNET_TESTBED_Peer **peers, |
439 | unsigned int links_succeeded, | ||
440 | unsigned int links_failed) | ||
439 | { | 441 | { |
440 | static unsigned int coco; | 442 | static unsigned int coco; |
441 | unsigned int i; | 443 | unsigned int i; |
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c index 2fe5a8140..81625030d 100644 --- a/src/fs/test_fs_test_lib.c +++ b/src/fs/test_fs_test_lib.c | |||
@@ -117,11 +117,17 @@ do_publish (void *cls, | |||
117 | * @param cls closure | 117 | * @param cls closure |
118 | * @param num_peers number of peers in 'peers' | 118 | * @param num_peers number of peers in 'peers' |
119 | * @param peers handle to peers run in the testbed | 119 | * @param peers handle to peers run in the testbed |
120 | * @param links_succeeded the number of overlay link connection attempts that | ||
121 | * succeeded | ||
122 | * @param links_failed the number of overlay link connection attempts that | ||
123 | * failed | ||
120 | */ | 124 | */ |
121 | static void | 125 | static void |
122 | run (void *cls, | 126 | run (void *cls, |
123 | unsigned int num_peers, | 127 | unsigned int num_peers, |
124 | struct GNUNET_TESTBED_Peer **peers) | 128 | struct GNUNET_TESTBED_Peer **peers, |
129 | unsigned int links_succeeded, | ||
130 | unsigned int links_failed) | ||
125 | { | 131 | { |
126 | unsigned int i; | 132 | unsigned int i; |
127 | 133 | ||
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index 29129a580..138e35c47 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c | |||
@@ -162,7 +162,9 @@ do_wait (void *cls, const struct GNUNET_FS_Uri *uri, | |||
162 | static void | 162 | static void |
163 | do_publish (void *cls, | 163 | do_publish (void *cls, |
164 | unsigned int num_peers, | 164 | unsigned int num_peers, |
165 | struct GNUNET_TESTBED_Peer **peers) | 165 | struct GNUNET_TESTBED_Peer **peers, |
166 | unsigned int links_succeeded, | ||
167 | unsigned int links_failed) | ||
166 | { | 168 | { |
167 | unsigned int i; | 169 | unsigned int i; |
168 | 170 | ||
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index d293bd66d..108b4e6c9 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c | |||
@@ -115,7 +115,9 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri, | |||
115 | static void | 115 | static void |
116 | do_publish (void *cls, | 116 | do_publish (void *cls, |
117 | unsigned int num_peers, | 117 | unsigned int num_peers, |
118 | struct GNUNET_TESTBED_Peer **peers) | 118 | struct GNUNET_TESTBED_Peer **peers, |
119 | unsigned int links_succeeded, | ||
120 | unsigned int links_failed) | ||
119 | { | 121 | { |
120 | unsigned int i; | 122 | unsigned int i; |
121 | 123 | ||
diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c index 49c94571f..ee2c36e3b 100644 --- a/src/gns/test_gns_dht_three_peers.c +++ b/src/gns/test_gns_dht_three_peers.c | |||
@@ -585,7 +585,9 @@ peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op, | |||
585 | 585 | ||
586 | void testbed_master (void *cls, | 586 | void testbed_master (void *cls, |
587 | unsigned int num_peers, | 587 | unsigned int num_peers, |
588 | struct GNUNET_TESTBED_Peer **peers) | 588 | struct GNUNET_TESTBED_Peer **peers, |
589 | unsigned int links_succeeded, | ||
590 | unsigned int links_failed) | ||
589 | { | 591 | { |
590 | GNUNET_assert (NULL != peers); | 592 | GNUNET_assert (NULL != peers); |
591 | cpeers = peers; | 593 | cpeers = peers; |
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 438227538..5aa4bd727 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -1364,10 +1364,16 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers, | |||
1364 | * @param num_peers number of peers in 'peers' | 1364 | * @param num_peers number of peers in 'peers' |
1365 | * @param peers handle to peers run in the testbed. NULL upon timeout (see | 1365 | * @param peers handle to peers run in the testbed. NULL upon timeout (see |
1366 | * GNUNET_TESTBED_test_run()). | 1366 | * GNUNET_TESTBED_test_run()). |
1367 | * @param links_succeeded the number of overlay link connection attempts that | ||
1368 | * succeeded | ||
1369 | * @param links_failed the number of overlay link connection attempts that | ||
1370 | * failed | ||
1367 | */ | 1371 | */ |
1368 | typedef void (*GNUNET_TESTBED_TestMaster)(void *cls, | 1372 | typedef void (*GNUNET_TESTBED_TestMaster)(void *cls, |
1369 | unsigned int num_peers, | 1373 | unsigned int num_peers, |
1370 | struct GNUNET_TESTBED_Peer **peers); | 1374 | struct GNUNET_TESTBED_Peer **peers, |
1375 | unsigned int links_succeeded, | ||
1376 | unsigned int links_failed); | ||
1371 | 1377 | ||
1372 | 1378 | ||
1373 | /** | 1379 | /** |
diff --git a/src/mesh/mesh_test_lib.c b/src/mesh/mesh_test_lib.c index cec74f2b5..a40281a9f 100644 --- a/src/mesh/mesh_test_lib.c +++ b/src/mesh/mesh_test_lib.c | |||
@@ -224,7 +224,9 @@ GNUNET_MESH_TEST_cleanup (struct GNUNET_MESH_TEST_Context *ctx) | |||
224 | static void | 224 | static void |
225 | mesh_test_run (void *cls, | 225 | mesh_test_run (void *cls, |
226 | unsigned int num_peers, | 226 | unsigned int num_peers, |
227 | struct GNUNET_TESTBED_Peer **peers) | 227 | struct GNUNET_TESTBED_Peer **peers, |
228 | unsigned int links_succeeded, | ||
229 | unsigned int links_failed) | ||
228 | { | 230 | { |
229 | struct GNUNET_MESH_TEST_Context *ctx = cls; | 231 | struct GNUNET_MESH_TEST_Context *ctx = cls; |
230 | unsigned int i; | 232 | unsigned int i; |
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index 9ed998c84..0ba36749c 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c | |||
@@ -768,11 +768,17 @@ master_controller_cb (void *cls, | |||
768 | * @param num_peers_ number of peers in 'peers' | 768 | * @param num_peers_ number of peers in 'peers' |
769 | * @param peers handle to peers run in the testbed. NULL upon timeout (see | 769 | * @param peers handle to peers run in the testbed. NULL upon timeout (see |
770 | * GNUNET_TESTBED_test_run()). | 770 | * GNUNET_TESTBED_test_run()). |
771 | * @param links_succeeded the number of overlay link connection attempts that | ||
772 | * succeeded | ||
773 | * @param links_failed the number of overlay link connection attempts that | ||
774 | * failed | ||
771 | */ | 775 | */ |
772 | static void | 776 | static void |
773 | test_master (void *cls, | 777 | test_master (void *cls, |
774 | unsigned int num_peers_, | 778 | unsigned int num_peers_, |
775 | struct GNUNET_TESTBED_Peer **peers) | 779 | struct GNUNET_TESTBED_Peer **peers, |
780 | unsigned int links_succeeded, | ||
781 | unsigned int links_failed) | ||
776 | { | 782 | { |
777 | if (NULL == peers) | 783 | if (NULL == peers) |
778 | { | 784 | { |
diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c index 2b8c367ce..9ae3a7aac 100644 --- a/src/nse/test_nse_multipeer.c +++ b/src/nse/test_nse_multipeer.c | |||
@@ -181,11 +181,17 @@ nse_disconnect_adapter (void *cls, | |||
181 | * @param cls closure | 181 | * @param cls closure |
182 | * @param num_peers number of peers in 'peers' | 182 | * @param num_peers number of peers in 'peers' |
183 | * @param peers handle to peers run in the testbed | 183 | * @param peers handle to peers run in the testbed |
184 | * @param links_succeeded the number of overlay link connection attempts that | ||
185 | * succeeded | ||
186 | * @param links_failed the number of overlay link connection attempts that | ||
187 | * failed | ||
184 | */ | 188 | */ |
185 | static void | 189 | static void |
186 | run (void *cls, | 190 | run (void *cls, |
187 | unsigned int num_peers, | 191 | unsigned int num_peers, |
188 | struct GNUNET_TESTBED_Peer **peers) | 192 | struct GNUNET_TESTBED_Peer **peers, |
193 | unsigned int links_succeeded, | ||
194 | unsigned int links_failed) | ||
189 | { | 195 | { |
190 | unsigned int i; | 196 | unsigned int i; |
191 | 197 | ||
diff --git a/src/stream/perf_stream_api.c b/src/stream/perf_stream_api.c index aa534ce09..aa54b6bfa 100644 --- a/src/stream/perf_stream_api.c +++ b/src/stream/perf_stream_api.c | |||
@@ -950,10 +950,16 @@ controller_event_cb (void *cls, | |||
950 | * @param cls closure | 950 | * @param cls closure |
951 | * @param num_peers number of peers in 'peers' | 951 | * @param num_peers number of peers in 'peers' |
952 | * @param peers handle to peers run in the testbed | 952 | * @param peers handle to peers run in the testbed |
953 | * @param links_succeeded the number of overlay link connection attempts that | ||
954 | * succeeded | ||
955 | * @param links_failed the number of overlay link connection attempts that | ||
956 | * failed | ||
953 | */ | 957 | */ |
954 | static void | 958 | static void |
955 | test_master (void *cls, unsigned int num_peers_, | 959 | test_master (void *cls, unsigned int num_peers_, |
956 | struct GNUNET_TESTBED_Peer **peers) | 960 | struct GNUNET_TESTBED_Peer **peers, |
961 | unsigned int links_succeeded, | ||
962 | unsigned int links_failed) | ||
957 | { | 963 | { |
958 | GNUNET_assert (NULL != peers); | 964 | GNUNET_assert (NULL != peers); |
959 | GNUNET_assert (NULL != peers[0]); | 965 | GNUNET_assert (NULL != peers[0]); |
diff --git a/src/stream/test_stream_2peers.c b/src/stream/test_stream_2peers.c index 012643980..b920d4071 100644 --- a/src/stream/test_stream_2peers.c +++ b/src/stream/test_stream_2peers.c | |||
@@ -618,10 +618,16 @@ controller_event_cb (void *cls, | |||
618 | * @param cls closure | 618 | * @param cls closure |
619 | * @param num_peers number of peers in 'peers' | 619 | * @param num_peers number of peers in 'peers' |
620 | * @param peers handle to peers run in the testbed | 620 | * @param peers handle to peers run in the testbed |
621 | * @param links_succeeded the number of overlay link connection attempts that | ||
622 | * succeeded | ||
623 | * @param links_failed the number of overlay link connection attempts that | ||
624 | * failed | ||
621 | */ | 625 | */ |
622 | static void | 626 | static void |
623 | test_master (void *cls, unsigned int num_peers, | 627 | test_master (void *cls, unsigned int num_peers, |
624 | struct GNUNET_TESTBED_Peer **peers) | 628 | struct GNUNET_TESTBED_Peer **peers, |
629 | unsigned int links_succeeded, | ||
630 | unsigned int links_failed) | ||
625 | { | 631 | { |
626 | GNUNET_assert (NULL != peers); | 632 | GNUNET_assert (NULL != peers); |
627 | GNUNET_assert (NULL != peers[0]); | 633 | GNUNET_assert (NULL != peers[0]); |
diff --git a/src/stream/test_stream_2peers_halfclose.c b/src/stream/test_stream_2peers_halfclose.c index 95f5aa9fa..930a2429e 100644 --- a/src/stream/test_stream_2peers_halfclose.c +++ b/src/stream/test_stream_2peers_halfclose.c | |||
@@ -842,10 +842,16 @@ controller_event_cb (void *cls, | |||
842 | * @param cls closure | 842 | * @param cls closure |
843 | * @param num_peers number of peers in 'peers' | 843 | * @param num_peers number of peers in 'peers' |
844 | * @param peers handle to peers run in the testbed | 844 | * @param peers handle to peers run in the testbed |
845 | * @param links_succeeded the number of overlay link connection attempts that | ||
846 | * succeeded | ||
847 | * @param links_failed the number of overlay link connection attempts that | ||
848 | * failed | ||
845 | */ | 849 | */ |
846 | static void | 850 | static void |
847 | test_master (void *cls, unsigned int num_peers, | 851 | test_master (void *cls, unsigned int num_peers, |
848 | struct GNUNET_TESTBED_Peer **peers) | 852 | struct GNUNET_TESTBED_Peer **peers, |
853 | unsigned int links_succeeded, | ||
854 | unsigned int links_failed) | ||
849 | { | 855 | { |
850 | GNUNET_assert (NULL != peers); | 856 | GNUNET_assert (NULL != peers); |
851 | GNUNET_assert (NULL != peers[0]); | 857 | GNUNET_assert (NULL != peers[0]); |
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 6c1c78032..a5a4c2350 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -204,9 +204,14 @@ controller_event_cb (void *cls, | |||
204 | * @param cls closure | 204 | * @param cls closure |
205 | * @param num_peers number of peers in 'peers' | 205 | * @param num_peers number of peers in 'peers' |
206 | * @param peers handle to peers run in the testbed | 206 | * @param peers handle to peers run in the testbed |
207 | * @param links_succeeded the number of overlay link connection attempts that | ||
208 | * succeeded | ||
209 | * @param links_failed the number of overlay link | ||
207 | */ | 210 | */ |
208 | static void | 211 | static void |
209 | test_run (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers) | 212 | test_run (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, |
213 | unsigned int links_succeeded, | ||
214 | unsigned int links_failed) | ||
210 | { | 215 | { |
211 | result = GNUNET_OK; | 216 | result = GNUNET_OK; |
212 | fprintf (stdout, "\n"); | 217 | fprintf (stdout, "\n"); |
diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c index 619719207..82b85f700 100644 --- a/src/testbed/test_testbed_api_statistics.c +++ b/src/testbed/test_testbed_api_statistics.c | |||
@@ -151,11 +151,17 @@ op_comp_cb (void *cls, | |||
151 | * | 151 | * |
152 | * @param cls closure | 152 | * @param cls closure |
153 | * @param num_peers number of peers in 'peers' | 153 | * @param num_peers number of peers in 'peers' |
154 | * @param peers handle to peers run in the testbed | 154 | * @param peers_ handle to peers run in the testbed |
155 | * @param links_succeeded the number of overlay link connection attempts that | ||
156 | * succeeded | ||
157 | * @param links_failed the number of overlay link connection attempts that | ||
158 | * failed | ||
155 | */ | 159 | */ |
156 | static void | 160 | static void |
157 | test_master (void *cls, unsigned int num_peers, | 161 | test_master (void *cls, unsigned int num_peers, |
158 | struct GNUNET_TESTBED_Peer **peers_) | 162 | struct GNUNET_TESTBED_Peer **peers_, |
163 | unsigned int links_succeeded, | ||
164 | unsigned int links_failed) | ||
159 | { | 165 | { |
160 | FAIL_TEST (NUM_PEERS == num_peers, return); | 166 | FAIL_TEST (NUM_PEERS == num_peers, return); |
161 | peers = peers_; | 167 | peers = peers_; |
diff --git a/src/testbed/test_testbed_api_test.c b/src/testbed/test_testbed_api_test.c index 464d07b54..91c6fe637 100644 --- a/src/testbed/test_testbed_api_test.c +++ b/src/testbed/test_testbed_api_test.c | |||
@@ -194,11 +194,17 @@ controller_event_cb (void *cls, | |||
194 | * | 194 | * |
195 | * @param cls closure | 195 | * @param cls closure |
196 | * @param num_peers number of peers in 'peers' | 196 | * @param num_peers number of peers in 'peers' |
197 | * @param peers handle to peers run in the testbed | 197 | * @param peers- handle to peers run in the testbed |
198 | * @param links_succeeded the number of overlay link connection attempts that | ||
199 | * succeeded | ||
200 | * @param links_failed the number of overlay link connection attempts that | ||
201 | * failed | ||
198 | */ | 202 | */ |
199 | static void | 203 | static void |
200 | test_master (void *cls, unsigned int num_peers, | 204 | test_master (void *cls, unsigned int num_peers, |
201 | struct GNUNET_TESTBED_Peer **peers_) | 205 | struct GNUNET_TESTBED_Peer **peers_, |
206 | unsigned int links_succeeded, | ||
207 | unsigned int links_failed) | ||
202 | { | 208 | { |
203 | unsigned int peer; | 209 | unsigned int peer; |
204 | 210 | ||
diff --git a/src/testbed/test_testbed_api_test_timeout.c b/src/testbed/test_testbed_api_test_timeout.c index 537837536..4f077e1ee 100644 --- a/src/testbed/test_testbed_api_test_timeout.c +++ b/src/testbed/test_testbed_api_test_timeout.c | |||
@@ -79,11 +79,17 @@ controller_event_cb (void *cls, | |||
79 | * | 79 | * |
80 | * @param cls closure | 80 | * @param cls closure |
81 | * @param num_peers number of peers in 'peers' | 81 | * @param num_peers number of peers in 'peers' |
82 | * @param peers handle to peers run in the testbed | 82 | * @param peers- handle to peers run in the testbed |
83 | * @param links_succeeded the number of overlay link connection attempts that | ||
84 | * succeeded | ||
85 | * @param links_failed the number of overlay link connection attempts that | ||
86 | * failed | ||
83 | */ | 87 | */ |
84 | static void | 88 | static void |
85 | test_master (void *cls, unsigned int num_peers, | 89 | test_master (void *cls, unsigned int num_peers, |
86 | struct GNUNET_TESTBED_Peer **peers_) | 90 | struct GNUNET_TESTBED_Peer **peers_, |
91 | unsigned int links_succeeded, | ||
92 | unsigned int links_failed) | ||
87 | { | 93 | { |
88 | FAIL_TEST (NULL == cls); | 94 | FAIL_TEST (NULL == cls); |
89 | FAIL_TEST (0 == num_peers); | 95 | FAIL_TEST (0 == num_peers); |
diff --git a/src/testbed/test_testbed_api_testbed_run.c b/src/testbed/test_testbed_api_testbed_run.c index a27d8b064..7777988f3 100644 --- a/src/testbed/test_testbed_api_testbed_run.c +++ b/src/testbed/test_testbed_api_testbed_run.c | |||
@@ -94,11 +94,17 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
94 | * | 94 | * |
95 | * @param cls closure | 95 | * @param cls closure |
96 | * @param num_peers number of peers in 'peers' | 96 | * @param num_peers number of peers in 'peers' |
97 | * @param peers handle to peers run in the testbed | 97 | * @param peers_ handle to peers run in the testbed |
98 | * @param links_succeeded the number of overlay link connection attempts that | ||
99 | * succeeded | ||
100 | * @param links_failed the number of overlay link connection attempts that | ||
101 | * failed | ||
98 | */ | 102 | */ |
99 | static void | 103 | static void |
100 | test_master (void *cls, unsigned int num_peers, | 104 | test_master (void *cls, unsigned int num_peers, |
101 | struct GNUNET_TESTBED_Peer **peers_) | 105 | struct GNUNET_TESTBED_Peer **peers_, |
106 | unsigned int links_succeeded, | ||
107 | unsigned int links_failed) | ||
102 | { | 108 | { |
103 | result = GNUNET_OK; | 109 | result = GNUNET_OK; |
104 | GNUNET_assert (NULL != peers[0]); | 110 | GNUNET_assert (NULL != peers[0]); |
diff --git a/src/testbed/test_testbed_api_topology.c b/src/testbed/test_testbed_api_topology.c index 0098dbea4..87fe1cb5c 100644 --- a/src/testbed/test_testbed_api_topology.c +++ b/src/testbed/test_testbed_api_topology.c | |||
@@ -119,11 +119,17 @@ controller_event_cb (void *cls, | |||
119 | * | 119 | * |
120 | * @param cls closure | 120 | * @param cls closure |
121 | * @param num_peers number of peers in 'peers' | 121 | * @param num_peers number of peers in 'peers' |
122 | * @param peers handle to peers run in the testbed | 122 | * @param peers_ handle to peers run in the testbed |
123 | * @param links_succeeded the number of overlay link connection attempts that | ||
124 | * succeeded | ||
125 | * @param links_failed the number of overlay link connection attempts that | ||
126 | * failed | ||
123 | */ | 127 | */ |
124 | static void | 128 | static void |
125 | test_master (void *cls, unsigned int num_peers, | 129 | test_master (void *cls, unsigned int num_peers, |
126 | struct GNUNET_TESTBED_Peer **peers_) | 130 | struct GNUNET_TESTBED_Peer **peers_, |
131 | unsigned int links_succeeded, | ||
132 | unsigned int links_failed) | ||
127 | { | 133 | { |
128 | unsigned int peer; | 134 | unsigned int peer; |
129 | 135 | ||
diff --git a/src/testbed/test_testbed_api_topology_clique.c b/src/testbed/test_testbed_api_topology_clique.c index 3f1ed7ade..dc3a2364c 100644 --- a/src/testbed/test_testbed_api_topology_clique.c +++ b/src/testbed/test_testbed_api_topology_clique.c | |||
@@ -114,11 +114,17 @@ controller_event_cb (void *cls, | |||
114 | * | 114 | * |
115 | * @param cls closure | 115 | * @param cls closure |
116 | * @param num_peers number of peers in 'peers' | 116 | * @param num_peers number of peers in 'peers' |
117 | * @param peers handle to peers run in the testbed | 117 | * @param peers_ handle to peers run in the testbed |
118 | * @param links_succeeded the number of overlay link connection attempts that | ||
119 | * succeeded | ||
120 | * @param links_failed the number of overlay link connection attempts that | ||
121 | * failed | ||
118 | */ | 122 | */ |
119 | static void | 123 | static void |
120 | test_master (void *cls, unsigned int num_peers, | 124 | test_master (void *cls, unsigned int num_peers, |
121 | struct GNUNET_TESTBED_Peer **peers_) | 125 | struct GNUNET_TESTBED_Peer **peers_, |
126 | unsigned int links_succeeded, | ||
127 | unsigned int links_failed) | ||
122 | { | 128 | { |
123 | unsigned int peer; | 129 | unsigned int peer; |
124 | 130 | ||
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 948cf4d55..95f9d3a56 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -295,6 +295,16 @@ struct RunContext | |||
295 | */ | 295 | */ |
296 | unsigned int random_links; | 296 | unsigned int random_links; |
297 | 297 | ||
298 | /** | ||
299 | * the number of overlay link connection attempts that succeeded | ||
300 | */ | ||
301 | unsigned int links_succeeded; | ||
302 | |||
303 | /** | ||
304 | * the number of overlay link connection attempts that failed | ||
305 | */ | ||
306 | unsigned int links_failed; | ||
307 | |||
298 | }; | 308 | }; |
299 | 309 | ||
300 | 310 | ||
@@ -540,7 +550,8 @@ call_master (struct RunContext *rc) | |||
540 | GNUNET_SCHEDULER_cancel (rc->timeout_task); | 550 | GNUNET_SCHEDULER_cancel (rc->timeout_task); |
541 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 551 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
542 | if (NULL != rc->test_master) | 552 | if (NULL != rc->test_master) |
543 | rc->test_master (rc->test_master_cls, rc->num_peers, rc->peers); | 553 | rc->test_master (rc->test_master_cls, rc->num_peers, rc->peers, |
554 | rc->links_succeeded, rc->links_failed); | ||
544 | } | 555 | } |
545 | 556 | ||
546 | 557 | ||
@@ -562,6 +573,8 @@ topology_completion_callback (void *cls, unsigned int nsuccess, | |||
562 | DEBUG ("Overlay topology generated in %s\n", prof_time (rc)); | 573 | DEBUG ("Overlay topology generated in %s\n", prof_time (rc)); |
563 | GNUNET_TESTBED_operation_done (rc->topology_operation); | 574 | GNUNET_TESTBED_operation_done (rc->topology_operation); |
564 | rc->topology_operation = NULL; | 575 | rc->topology_operation = NULL; |
576 | rc->links_succeeded = nsuccess; | ||
577 | rc->links_failed = nfailures; | ||
565 | rc->state = RC_READY; | 578 | rc->state = RC_READY; |
566 | call_master (rc); | 579 | call_master (rc); |
567 | } | 580 | } |
@@ -1001,7 +1014,7 @@ timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1001 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); | 1014 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); |
1002 | shutdown_now (rc); | 1015 | shutdown_now (rc); |
1003 | if (NULL != rc->test_master) | 1016 | if (NULL != rc->test_master) |
1004 | rc->test_master (rc->test_master_cls, 0, NULL); | 1017 | rc->test_master (rc->test_master_cls, 0, NULL, 0, 0); |
1005 | rc->test_master = NULL; | 1018 | rc->test_master = NULL; |
1006 | } | 1019 | } |
1007 | 1020 | ||
diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c index 99734ca8f..1a6b14773 100644 --- a/src/topology/test_gnunet_daemon_topology.c +++ b/src/topology/test_gnunet_daemon_topology.c | |||
@@ -64,7 +64,9 @@ notify_connect_complete (void *cls, | |||
64 | static void | 64 | static void |
65 | do_connect (void *cls, | 65 | do_connect (void *cls, |
66 | unsigned int num_peers, | 66 | unsigned int num_peers, |
67 | struct GNUNET_TESTBED_Peer **peers) | 67 | struct GNUNET_TESTBED_Peer **peers, |
68 | unsigned int links_succeeded, | ||
69 | unsigned int links_failed) | ||
68 | { | 70 | { |
69 | unsigned int i; | 71 | unsigned int i; |
70 | 72 | ||