diff options
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/test_testing_2dtorus.c | 57 | ||||
-rw-r--r-- | src/testing/test_testing_large_topology.c | 2 | ||||
-rw-r--r-- | src/testing/test_testing_topology.c | 4 | ||||
-rw-r--r-- | src/testing/test_testing_topology_blacklist.c | 2 | ||||
-rw-r--r-- | src/testing/testing.c | 23 | ||||
-rw-r--r-- | src/testing/testing_group.c | 21 | ||||
-rw-r--r-- | src/testing/testing_peergroup.c | 18 |
7 files changed, 54 insertions, 73 deletions
diff --git a/src/testing/test_testing_2dtorus.c b/src/testing/test_testing_2dtorus.c index f1ddff0ea..7b109bca4 100644 --- a/src/testing/test_testing_2dtorus.c +++ b/src/testing/test_testing_2dtorus.c | |||
@@ -104,8 +104,7 @@ shutdown_callback (void *cls, const char *emsg) | |||
104 | if (emsg != NULL) | 104 | if (emsg != NULL) |
105 | { | 105 | { |
106 | #if VERBOSE | 106 | #if VERBOSE |
107 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 107 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Shutdown of peers failed!\n"); |
108 | "test: Shutdown of peers failed!\n"); | ||
109 | #endif | 108 | #endif |
110 | ok--; | 109 | ok--; |
111 | } | 110 | } |
@@ -123,8 +122,7 @@ static void | |||
123 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 122 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
124 | { | 123 | { |
125 | #if VERBOSE | 124 | #if VERBOSE |
126 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 125 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n"); |
127 | "test: Ending test.\n"); | ||
128 | #endif | 126 | #endif |
129 | 127 | ||
130 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); | 128 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
@@ -135,8 +133,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
135 | static void | 133 | static void |
136 | disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 134 | disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
137 | { | 135 | { |
138 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 136 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: disconnecting peers\n"); |
139 | "test: disconnecting peers\n"); | ||
140 | 137 | ||
141 | if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle) | 138 | if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle) |
142 | { | 139 | { |
@@ -163,33 +160,26 @@ topo_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
163 | topo_connections++; | 160 | topo_connections++; |
164 | if (NULL != emsg) | 161 | if (NULL != emsg) |
165 | { | 162 | { |
166 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 163 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: Error by topo %u: %s\n", |
167 | "test: Error by topo %u: %s\n", | ||
168 | topo_connections, emsg); | 164 | topo_connections, emsg); |
169 | } | 165 | } |
170 | else | 166 | else |
171 | { | 167 | { |
172 | if (first == NULL || second == NULL) | 168 | if (first == NULL || second == NULL) |
173 | { | 169 | { |
174 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 170 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Connection %u NULL\n", |
175 | "test: Connection %u NULL\n", | ||
176 | topo_connections); | 171 | topo_connections); |
177 | if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) | 172 | if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) |
178 | { | 173 | { |
179 | GNUNET_SCHEDULER_cancel (disconnect_task); | 174 | GNUNET_SCHEDULER_cancel (disconnect_task); |
180 | GNUNET_SCHEDULER_add_now(&disconnect_peers, NULL); | 175 | GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL); |
181 | } | 176 | } |
182 | return; | 177 | return; |
183 | } | 178 | } |
184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 179 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Connection %u ok\n", |
185 | "test: Connection %u ok\n", | ||
186 | topo_connections); | 180 | topo_connections); |
187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 181 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: %s\n", GNUNET_i2s (first)); |
188 | "test: %s\n", | 182 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: %s\n", GNUNET_i2s (second)); |
189 | GNUNET_i2s (first)); | ||
190 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
191 | "test: %s\n", | ||
192 | GNUNET_i2s (second)); | ||
193 | } | 183 | } |
194 | } | 184 | } |
195 | 185 | ||
@@ -206,8 +196,8 @@ peergroup_ready (void *cls, const char *emsg) | |||
206 | { | 196 | { |
207 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 197 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
208 | "test: Peergroup callback called with error, aborting test!\n"); | 198 | "test: Peergroup callback called with error, aborting test!\n"); |
209 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 199 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Error from testing: `%s'\n", |
210 | "test: Error from testing: `%s'\n", emsg); | 200 | emsg); |
211 | ok--; | 201 | ok--; |
212 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); | 202 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
213 | return; | 203 | return; |
@@ -217,8 +207,7 @@ peergroup_ready (void *cls, const char *emsg) | |||
217 | "************************************************************\n"); | 207 | "************************************************************\n"); |
218 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
219 | "test: Peer Group started successfully!\n"); | 209 | "test: Peer Group started successfully!\n"); |
220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 210 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Have %u connections\n", |
221 | "test: Have %u connections\n", | ||
222 | total_connections); | 211 | total_connections); |
223 | #endif | 212 | #endif |
224 | 213 | ||
@@ -226,8 +215,7 @@ peergroup_ready (void *cls, const char *emsg) | |||
226 | if (0 < failed_connections) | 215 | if (0 < failed_connections) |
227 | { | 216 | { |
228 | ok = GNUNET_SYSERR; | 217 | ok = GNUNET_SYSERR; |
229 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 218 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: %u connections have FAILED!\n", |
230 | "test: %u connections have FAILED!\n", | ||
231 | failed_connections); | 219 | failed_connections); |
232 | disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL); | 220 | disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_peers, NULL); |
233 | 221 | ||
@@ -273,12 +261,9 @@ connect_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
273 | { | 261 | { |
274 | failed_connections++; | 262 | failed_connections++; |
275 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 263 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
276 | "test: Problem with new connection (%s)\n", | 264 | "test: Problem with new connection (%s)\n", emsg); |
277 | emsg); | 265 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", GNUNET_i2s (first)); |
278 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", | 266 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", GNUNET_i2s (second)); |
279 | GNUNET_i2s (first)); | ||
280 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: (%s)\n", | ||
281 | GNUNET_i2s (second)); | ||
282 | } | 267 | } |
283 | 268 | ||
284 | } | 269 | } |
@@ -311,8 +296,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
311 | NULL); | 296 | NULL); |
312 | 297 | ||
313 | #if VERBOSE | 298 | #if VERBOSE |
314 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 299 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n"); |
315 | "test: Starting daemons.\n"); | ||
316 | GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing", | 300 | GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing", |
317 | "use_progressbars", "YES"); | 301 | "use_progressbars", "YES"); |
318 | #endif | 302 | #endif |
@@ -371,15 +355,14 @@ main (int argc, char *argv[]) | |||
371 | 355 | ||
372 | GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, | 356 | GNUNET_PROGRAM_run ((sizeof (argv2) / sizeof (char *)) - 1, argv2, |
373 | "test_testing_2dtorus", | 357 | "test_testing_2dtorus", |
374 | gettext_noop ("Test testing 2d torus."), options, | 358 | gettext_noop ("Test testing 2d torus."), options, &run, |
375 | &run, NULL); | 359 | NULL); |
376 | #if REMOVE_DIR | 360 | #if REMOVE_DIR |
377 | GNUNET_DISK_directory_remove ("/tmp/test_testing_2dtorus"); | 361 | GNUNET_DISK_directory_remove ("/tmp/test_testing_2dtorus"); |
378 | #endif | 362 | #endif |
379 | if (GNUNET_OK != ok) | 363 | if (GNUNET_OK != ok) |
380 | { | 364 | { |
381 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 365 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "test: FAILED!\n"); |
382 | "test: FAILED!\n"); | ||
383 | return 1; | 366 | return 1; |
384 | } | 367 | } |
385 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n"); | 368 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: success\n"); |
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c index a27154507..08b1df5b9 100644 --- a/src/testing/test_testing_large_topology.c +++ b/src/testing/test_testing_large_topology.c | |||
@@ -1045,7 +1045,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1045 | 1045 | ||
1046 | if (GNUNET_OK != | 1046 | if (GNUNET_OK != |
1047 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME", | 1047 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME", |
1048 | &settle_time)) | 1048 | &settle_time)) |
1049 | { | 1049 | { |
1050 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 1050 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
1051 | "testing", "SETTLE_TIME"); | 1051 | "testing", "SETTLE_TIME"); |
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index ba092220a..f60ac3a1a 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c | |||
@@ -1102,7 +1102,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1102 | 1102 | ||
1103 | if (GNUNET_OK != | 1103 | if (GNUNET_OK != |
1104 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME", | 1104 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "SETTLE_TIME", |
1105 | &settle_time)) | 1105 | &settle_time)) |
1106 | { | 1106 | { |
1107 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 1107 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
1108 | "testing", "SETTLE_TIME"); | 1108 | "testing", "SETTLE_TIME"); |
@@ -1111,7 +1111,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1111 | 1111 | ||
1112 | if (GNUNET_OK != | 1112 | if (GNUNET_OK != |
1113 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT", | 1113 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT", |
1114 | &connect_timeout)) | 1114 | &connect_timeout)) |
1115 | { | 1115 | { |
1116 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 1116 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
1117 | "testing", "CONNECT_TIMEOUT"); | 1117 | "testing", "CONNECT_TIMEOUT"); |
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c index d53fc8cbe..d45d1bbb4 100644 --- a/src/testing/test_testing_topology_blacklist.c +++ b/src/testing/test_testing_topology_blacklist.c | |||
@@ -486,7 +486,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
486 | 486 | ||
487 | if (GNUNET_OK != | 487 | if (GNUNET_OK != |
488 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT", | 488 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT", |
489 | &connect_timeout)) | 489 | &connect_timeout)) |
490 | { | 490 | { |
491 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 491 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
492 | "testing", "CONNECT_TIMEOUT"); | 492 | "testing", "CONNECT_TIMEOUT"); |
diff --git a/src/testing/testing.c b/src/testing/testing.c index 9ba58de61..d7f6946b0 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -65,8 +65,7 @@ static struct GNUNET_CORE_MessageHandler no_handlers[] = { {NULL, 0, 0} }; | |||
65 | 65 | ||
66 | #if EMPTY_HACK | 66 | #if EMPTY_HACK |
67 | static int | 67 | static int |
68 | test_address (void *cls, | 68 | test_address (void *cls, const struct GNUNET_HELLO_Address *address, |
69 | const struct GNUNET_HELLO_Address *address, | ||
70 | struct GNUNET_TIME_Absolute expiration) | 69 | struct GNUNET_TIME_Absolute expiration) |
71 | { | 70 | { |
72 | int *empty = cls; | 71 | int *empty = cls; |
@@ -108,7 +107,7 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message) | |||
108 | #endif | 107 | #endif |
109 | GNUNET_assert (daemon->phase == SP_GET_HELLO || | 108 | GNUNET_assert (daemon->phase == SP_GET_HELLO || |
110 | daemon->phase == SP_START_DONE); | 109 | daemon->phase == SP_START_DONE); |
111 | daemon->cb = NULL; // FIXME: why??? (see fsm:SP_START_CORE, notify_daemon_started) | 110 | daemon->cb = NULL; // FIXME: why??? (see fsm:SP_START_CORE, notify_daemon_started) |
112 | if (daemon->task != GNUNET_SCHEDULER_NO_TASK) /* Assertion here instead? */ | 111 | if (daemon->task != GNUNET_SCHEDULER_NO_TASK) /* Assertion here instead? */ |
113 | GNUNET_SCHEDULER_cancel (daemon->task); | 112 | GNUNET_SCHEDULER_cancel (daemon->task); |
114 | 113 | ||
@@ -551,9 +550,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
551 | GNUNET_free_non_null (d->username); | 550 | GNUNET_free_non_null (d->username); |
552 | GNUNET_free (d->proc); | 551 | GNUNET_free (d->proc); |
553 | // GNUNET_free (d); // FIXME (could this leak) | 552 | // GNUNET_free (d); // FIXME (could this leak) |
554 | d->hostname = NULL; // Quick hack to avoid crashing (testing need to be | 553 | d->hostname = NULL; // Quick hack to avoid crashing (testing need to be |
555 | d->cfg = NULL; // overhauled anyway, and the error managing is | 554 | d->cfg = NULL; // overhauled anyway, and the error managing is |
556 | // pretty broken anyway. | 555 | // pretty broken anyway. |
557 | return; | 556 | return; |
558 | } | 557 | } |
559 | /* wait some more */ | 558 | /* wait some more */ |
@@ -2037,8 +2036,7 @@ reattempt_daemons_connect (void *cls, | |||
2037 | if (NULL != ctx->d2->hello) | 2036 | if (NULL != ctx->d2->hello) |
2038 | { | 2037 | { |
2039 | #if DEBUG_TESTING_RECONNECT | 2038 | #if DEBUG_TESTING_RECONNECT |
2040 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2039 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "updating %s's HELLO\n", |
2041 | "updating %s's HELLO\n", | ||
2042 | ctx->d2->shortname); | 2040 | ctx->d2->shortname); |
2043 | #endif | 2041 | #endif |
2044 | GNUNET_free (ctx->d2->hello); | 2042 | GNUNET_free (ctx->d2->hello); |
@@ -2059,8 +2057,7 @@ reattempt_daemons_connect (void *cls, | |||
2059 | #if DEBUG_TESTING_RECONNECT | 2057 | #if DEBUG_TESTING_RECONNECT |
2060 | else | 2058 | else |
2061 | { | 2059 | { |
2062 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2060 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "didn't have %s's HELLO\n", |
2063 | "didn't have %s's HELLO\n", | ||
2064 | ctx->d2->shortname); | 2061 | ctx->d2->shortname); |
2065 | } | 2062 | } |
2066 | #endif | 2063 | #endif |
@@ -2103,8 +2100,7 @@ reattempt_daemons_connect (void *cls, | |||
2103 | if (ctx->send_hello == GNUNET_YES) | 2100 | if (ctx->send_hello == GNUNET_YES) |
2104 | { | 2101 | { |
2105 | #if DEBUG_TESTING_RECONNECT | 2102 | #if DEBUG_TESTING_RECONNECT |
2106 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2103 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending %s's HELLO to %s\n", |
2107 | "Sending %s's HELLO to %s\n", | ||
2108 | ctx->d1->shortname, ctx->d2->shortname); | 2104 | ctx->d1->shortname, ctx->d2->shortname); |
2109 | #endif | 2105 | #endif |
2110 | ctx->d1th = | 2106 | ctx->d1th = |
@@ -2126,8 +2122,7 @@ reattempt_daemons_connect (void *cls, | |||
2126 | else | 2122 | else |
2127 | { | 2123 | { |
2128 | #if DEBUG_TESTING_RECONNECT | 2124 | #if DEBUG_TESTING_RECONNECT |
2129 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2125 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Trying to reconnect %s to %s\n", |
2130 | "Trying to reconnect %s to %s\n", | ||
2131 | ctx->d1->shortname, ctx->d2->shortname); | 2126 | ctx->d1->shortname, ctx->d2->shortname); |
2132 | #endif | 2127 | #endif |
2133 | GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id); | 2128 | GNUNET_TRANSPORT_try_connect (ctx->d1th, &ctx->d2->id); |
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index f22bb2bff..26aac5e7c 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -5554,7 +5554,7 @@ internal_startup_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
5554 | * Calls GNUNET_TESTING_daemon_continue_startup to set the daemon's state | 5554 | * Calls GNUNET_TESTING_daemon_continue_startup to set the daemon's state |
5555 | * from HOSTKEY_CREATED to TOPOLOGY_SETUP. Makes sure not to saturate a host | 5555 | * from HOSTKEY_CREATED to TOPOLOGY_SETUP. Makes sure not to saturate a host |
5556 | * with requests delaying them when needed. | 5556 | * with requests delaying them when needed. |
5557 | * | 5557 | * |
5558 | * @param cls closure: internal context of the daemon. | 5558 | * @param cls closure: internal context of the daemon. |
5559 | * @param tc TaskContext | 5559 | * @param tc TaskContext |
5560 | */ | 5560 | */ |
@@ -5563,6 +5563,7 @@ internal_continue_startup (void *cls, | |||
5563 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 5563 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
5564 | { | 5564 | { |
5565 | struct InternalStartContext *internal_context = cls; | 5565 | struct InternalStartContext *internal_context = cls; |
5566 | |||
5566 | internal_context->peer->startup_task = GNUNET_SCHEDULER_NO_TASK; | 5567 | internal_context->peer->startup_task = GNUNET_SCHEDULER_NO_TASK; |
5567 | 5568 | ||
5568 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | 5569 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) |
@@ -5586,9 +5587,11 @@ internal_continue_startup (void *cls, | |||
5586 | } | 5587 | } |
5587 | else | 5588 | else |
5588 | { | 5589 | { |
5589 | internal_context->peer->startup_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 5590 | internal_context->peer->startup_task = |
5590 | (GNUNET_TIME_UNIT_MILLISECONDS, 100), | 5591 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
5591 | &internal_continue_startup, internal_context); | 5592 | (GNUNET_TIME_UNIT_MILLISECONDS, 100), |
5593 | &internal_continue_startup, | ||
5594 | internal_context); | ||
5592 | } | 5595 | } |
5593 | } | 5596 | } |
5594 | 5597 | ||
@@ -5894,16 +5897,18 @@ GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg) | |||
5894 | pg->starting = 0; | 5897 | pg->starting = 0; |
5895 | for (i = 0; i < pg->total; i++) | 5898 | for (i = 0; i < pg->total; i++) |
5896 | { | 5899 | { |
5897 | pg->peers[i].startup_task = GNUNET_SCHEDULER_add_now (&internal_continue_startup, | 5900 | pg->peers[i].startup_task = |
5898 | &pg->peers[i].internal_context); | 5901 | GNUNET_SCHEDULER_add_now (&internal_continue_startup, |
5902 | &pg->peers[i].internal_context); | ||
5899 | } | 5903 | } |
5900 | } | 5904 | } |
5901 | #else | 5905 | #else |
5902 | pg->starting = 0; | 5906 | pg->starting = 0; |
5903 | for (i = 0; i < pg->total; i++) | 5907 | for (i = 0; i < pg->total; i++) |
5904 | { | 5908 | { |
5905 | pg->peers[i].startup_task = GNUNET_SCHEDULER_add_now (&internal_continue_startup, | 5909 | pg->peers[i].startup_task = |
5906 | &pg->peers[i].internal_context); | 5910 | GNUNET_SCHEDULER_add_now (&internal_continue_startup, |
5911 | &pg->peers[i].internal_context); | ||
5907 | } | 5912 | } |
5908 | #endif | 5913 | #endif |
5909 | } | 5914 | } |
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c index aee9b8a50..1d9d3ba88 100644 --- a/src/testing/testing_peergroup.c +++ b/src/testing/testing_peergroup.c | |||
@@ -46,7 +46,7 @@ struct PeerGroupStartupContext | |||
46 | unsigned int total; | 46 | unsigned int total; |
47 | unsigned int peers_left; | 47 | unsigned int peers_left; |
48 | unsigned long long max_concurrent_connections; | 48 | unsigned long long max_concurrent_connections; |
49 | 49 | ||
50 | /** | 50 | /** |
51 | * Maximum attemps to connect two daemons. | 51 | * Maximum attemps to connect two daemons. |
52 | */ | 52 | */ |
@@ -56,7 +56,7 @@ struct PeerGroupStartupContext | |||
56 | * How long to spend trying to establish all the connections? | 56 | * How long to spend trying to establish all the connections? |
57 | */ | 57 | */ |
58 | struct GNUNET_TIME_Relative connect_timeout; | 58 | struct GNUNET_TIME_Relative connect_timeout; |
59 | 59 | ||
60 | unsigned long long max_concurrent_ssh; | 60 | unsigned long long max_concurrent_ssh; |
61 | struct GNUNET_TIME_Absolute timeout; | 61 | struct GNUNET_TIME_Absolute timeout; |
62 | GNUNET_TESTING_NotifyConnection connect_cb; | 62 | GNUNET_TESTING_NotifyConnection connect_cb; |
@@ -508,7 +508,7 @@ internal_peers_started_callback (void *cls, | |||
508 | pg_start_ctx->connect_topology, | 508 | pg_start_ctx->connect_topology, |
509 | pg_start_ctx->connect_topology_option, | 509 | pg_start_ctx->connect_topology_option, |
510 | pg_start_ctx->connect_topology_option_modifier, | 510 | pg_start_ctx->connect_topology_option_modifier, |
511 | pg_start_ctx->connect_timeout, | 511 | pg_start_ctx->connect_timeout, |
512 | pg_start_ctx->connect_attempts, NULL, | 512 | pg_start_ctx->connect_attempts, NULL, |
513 | NULL); | 513 | NULL); |
514 | 514 | ||
@@ -755,9 +755,9 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
755 | 755 | ||
756 | if (GNUNET_OK != | 756 | if (GNUNET_OK != |
757 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT", | 757 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "CONNECT_TIMEOUT", |
758 | &pg_start_ctx->connect_timeout)) | 758 | &pg_start_ctx->connect_timeout)) |
759 | { | 759 | { |
760 | pg_start_ctx->connect_timeout = DEFAULT_CONNECT_TIMEOUT; | 760 | pg_start_ctx->connect_timeout = DEFAULT_CONNECT_TIMEOUT; |
761 | } | 761 | } |
762 | 762 | ||
763 | if (GNUNET_OK != | 763 | if (GNUNET_OK != |
@@ -794,17 +794,15 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
794 | } | 794 | } |
795 | 795 | ||
796 | if (GNUNET_OK != | 796 | if (GNUNET_OK != |
797 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", | 797 | GNUNET_CONFIGURATION_get_value_time (cfg, "testing", "PEERGROUP_TIMEOUT", |
798 | "PEERGROUP_TIMEOUT", | 798 | &rtimeout)) |
799 | &rtimeout)) | ||
800 | { | 799 | { |
801 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 800 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
802 | "testing", "PEERGROUP_TIMEOUT"); | 801 | "testing", "PEERGROUP_TIMEOUT"); |
803 | GNUNET_free (pg_start_ctx); | 802 | GNUNET_free (pg_start_ctx); |
804 | return NULL; | 803 | return NULL; |
805 | } | 804 | } |
806 | pg_start_ctx->timeout = | 805 | pg_start_ctx->timeout = GNUNET_TIME_relative_to_absolute (rtimeout); |
807 | GNUNET_TIME_relative_to_absolute (rtimeout); | ||
808 | 806 | ||
809 | 807 | ||
810 | /* Read topology related options from the configuration file */ | 808 | /* Read topology related options from the configuration file */ |