diff options
Diffstat (limited to 'src/testbed')
-rw-r--r-- | src/testbed/gnunet-testbed-profiler.c | 7 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_statistics.c | 10 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_test.c | 10 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_test_timeout.c | 10 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_testbed_run.c | 10 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_topology.c | 10 | ||||
-rw-r--r-- | src/testbed/test_testbed_api_topology_clique.c | 10 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 17 |
8 files changed, 69 insertions, 15 deletions
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 | ||