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 /src/testbed/testbed_api_testbed.c | |
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
Diffstat (limited to 'src/testbed/testbed_api_testbed.c')
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 17 |
1 files changed, 15 insertions, 2 deletions
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 | ||