From 949f21f03df9f08b0a73c3e47a798e63790edf7f Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Thu, 28 Mar 2013 16:47:02 +0000 Subject: [PATCH] provide how many links succeeded and how many failed in test master callback from GNUNET_TESTBED_run() and GNUNET_TESTBED_test_run() functions --- src/ats/gnunet-service-ats_addresses.c | 6 +++--- src/consensus/gnunet-consensus-start-peers.c | 16 +++++++++++++++- src/consensus/gnunet-consensus.c | 16 +++++++++++++++- src/dht/dht_test_lib.c | 4 +++- src/dv/test_transport_blacklist.c | 4 +++- src/dv/test_transport_dv.c | 4 +++- src/fs/gnunet-fs-profiler.c | 9 ++++++++- src/fs/perf_gnunet_service_fs_p2p.c | 4 +++- src/fs/perf_gnunet_service_fs_p2p_respect.c | 4 +++- src/fs/test_fs_test_lib.c | 8 +++++++- src/fs/test_gnunet_service_fs_migration.c | 4 +++- src/fs/test_gnunet_service_fs_p2p.c | 4 +++- src/gns/test_gns_dht_three_peers.c | 4 +++- src/include/gnunet_testbed_service.h | 8 +++++++- src/mesh/mesh_test_lib.c | 4 +++- src/nse/gnunet-nse-profiler.c | 8 +++++++- src/nse/test_nse_multipeer.c | 8 +++++++- src/stream/perf_stream_api.c | 8 +++++++- src/stream/test_stream_2peers.c | 8 +++++++- src/stream/test_stream_2peers_halfclose.c | 8 +++++++- src/testbed/gnunet-testbed-profiler.c | 7 ++++++- src/testbed/test_testbed_api_statistics.c | 10 ++++++++-- src/testbed/test_testbed_api_test.c | 10 ++++++++-- src/testbed/test_testbed_api_test_timeout.c | 10 ++++++++-- src/testbed/test_testbed_api_testbed_run.c | 10 ++++++++-- src/testbed/test_testbed_api_topology.c | 10 ++++++++-- src/testbed/test_testbed_api_topology_clique.c | 10 ++++++++-- src/testbed/testbed_api_testbed.c | 17 +++++++++++++++-- src/topology/test_gnunet_daemon_topology.c | 4 +++- 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, session_id, atsi, atsi_count); if (aa == NULL) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Tried to update unknown address for peer `%s' `%s' session id %u\n", - GNUNET_i2s (peer), plugin_name, session_id); - GNUNET_break (0); + /* GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Tried to update unknown address for peer `%s' `%s' session id %u\n", */ + /* GNUNET_i2s (peer), plugin_name, session_id); */ + /* GNUNET_break (0); */ return; } 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, +/** + * Signature of a main function for a testcase. + * + * @param cls closure + * @param num_peers number of peers in 'peers' + * @param peers handle to peers run in the testbed. NULL upon timeout (see + * GNUNET_TESTBED_test_run()). + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed + */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **started_peers) + struct GNUNET_TESTBED_Peer **started_peers, + unsigned int links_succeeded, + unsigned int links_failed) { int i; 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, } +/** + * Signature of a main function for a testcase. + * + * @param cls closure + * @param num_peers number of peers in 'peers' + * @param peers handle to peers run in the testbed. NULL upon timeout (see + * GNUNET_TESTBED_test_run()). + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed + */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **started_peers) + struct GNUNET_TESTBED_Peer **started_peers, + unsigned int links_succeeded, + unsigned int links_failed) { int i; 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) static void dht_test_run (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { struct GNUNET_DHT_TEST_Context *ctx = cls; 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; static void test_connection (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { if (4 == num_peers) { 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; static void test_connection (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { if (4 != num_peers) { 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, * @param cls closure * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void -test_master (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers) +test_master (void *cls, unsigned int num_peers, + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { // const struct GNUNET_CONFIGURATION_Handle *cfg = cls; // 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, static void do_publish (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int i; 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, static void do_connect (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { static unsigned int coco; 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, * @param cls closure * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void run (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int i; 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, static void do_publish (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int i; 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, static void do_publish (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int i; 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, void testbed_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { GNUNET_assert (NULL != peers); 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, * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed. NULL upon timeout (see * GNUNET_TESTBED_test_run()). + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ typedef void (*GNUNET_TESTBED_TestMaster)(void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers); + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed); /** 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) static void mesh_test_run (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { struct GNUNET_MESH_TEST_Context *ctx = cls; 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, * @param num_peers_ number of peers in 'peers' * @param peers handle to peers run in the testbed. NULL upon timeout (see * GNUNET_TESTBED_test_run()). + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers_, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { if (NULL == peers) { 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, * @param cls closure * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void run (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int i; 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, * @param cls closure * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers_, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { GNUNET_assert (NULL != peers); 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, * @param cls closure * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { GNUNET_assert (NULL != peers); 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, * @param cls closure * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { GNUNET_assert (NULL != peers); 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, * @param cls closure * @param num_peers number of peers in 'peers' * @param peers handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link */ static void -test_run (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers) +test_run (void *cls, unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { result = GNUNET_OK; 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, * * @param cls closure * @param num_peers number of peers in 'peers' - * @param peers handle to peers run in the testbed + * @param peers_ handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers_) + struct GNUNET_TESTBED_Peer **peers_, + unsigned int links_succeeded, + unsigned int links_failed) { FAIL_TEST (NUM_PEERS == num_peers, return); 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, * * @param cls closure * @param num_peers number of peers in 'peers' - * @param peers handle to peers run in the testbed + * @param peers- handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers_) + struct GNUNET_TESTBED_Peer **peers_, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int peer; 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, * * @param cls closure * @param num_peers number of peers in 'peers' - * @param peers handle to peers run in the testbed + * @param peers- handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers_) + struct GNUNET_TESTBED_Peer **peers_, + unsigned int links_succeeded, + unsigned int links_failed) { FAIL_TEST (NULL == cls); 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) * * @param cls closure * @param num_peers number of peers in 'peers' - * @param peers handle to peers run in the testbed + * @param peers_ handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers_) + struct GNUNET_TESTBED_Peer **peers_, + unsigned int links_succeeded, + unsigned int links_failed) { result = GNUNET_OK; 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, * * @param cls closure * @param num_peers number of peers in 'peers' - * @param peers handle to peers run in the testbed + * @param peers_ handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers_) + struct GNUNET_TESTBED_Peer **peers_, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int peer; 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, * * @param cls closure * @param num_peers number of peers in 'peers' - * @param peers handle to peers run in the testbed + * @param peers_ handle to peers run in the testbed + * @param links_succeeded the number of overlay link connection attempts that + * succeeded + * @param links_failed the number of overlay link connection attempts that + * failed */ static void test_master (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers_) + struct GNUNET_TESTBED_Peer **peers_, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int peer; 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 */ unsigned int random_links; + /** + * the number of overlay link connection attempts that succeeded + */ + unsigned int links_succeeded; + + /** + * the number of overlay link connection attempts that failed + */ + unsigned int links_failed; + }; @@ -540,7 +550,8 @@ call_master (struct RunContext *rc) GNUNET_SCHEDULER_cancel (rc->timeout_task); rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; if (NULL != rc->test_master) - rc->test_master (rc->test_master_cls, rc->num_peers, rc->peers); + rc->test_master (rc->test_master_cls, rc->num_peers, rc->peers, + rc->links_succeeded, rc->links_failed); } @@ -562,6 +573,8 @@ topology_completion_callback (void *cls, unsigned int nsuccess, DEBUG ("Overlay topology generated in %s\n", prof_time (rc)); GNUNET_TESTBED_operation_done (rc->topology_operation); rc->topology_operation = NULL; + rc->links_succeeded = nsuccess; + rc->links_failed = nfailures; rc->state = RC_READY; call_master (rc); } @@ -1001,7 +1014,7 @@ timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); shutdown_now (rc); if (NULL != rc->test_master) - rc->test_master (rc->test_master_cls, 0, NULL); + rc->test_master (rc->test_master_cls, 0, NULL, 0, 0); rc->test_master = NULL; } 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, static void do_connect (void *cls, unsigned int num_peers, - struct GNUNET_TESTBED_Peer **peers) + struct GNUNET_TESTBED_Peer **peers, + unsigned int links_succeeded, + unsigned int links_failed) { unsigned int i; -- 2.25.1