diff options
Diffstat (limited to 'src/testing/test_testing_topology_blacklist.c')
-rw-r--r-- | src/testing/test_testing_topology_blacklist.c | 357 |
1 files changed, 178 insertions, 179 deletions
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c index ea32e339d..f9185b6fc 100644 --- a/src/testing/test_testing_topology_blacklist.c +++ b/src/testing/test_testing_topology_blacklist.c | |||
@@ -106,20 +106,19 @@ void | |||
106 | shutdown_callback (void *cls, const char *emsg) | 106 | shutdown_callback (void *cls, const char *emsg) |
107 | { | 107 | { |
108 | if (emsg != NULL) | 108 | if (emsg != NULL) |
109 | { | 109 | { |
110 | #if VERBOSE | 110 | #if VERBOSE |
111 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); | 111 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); |
112 | #endif | 112 | #endif |
113 | if (ok == 0) | 113 | if (ok == 0) |
114 | ok = 666; | 114 | ok = 666; |
115 | } | 115 | } |
116 | else | 116 | else |
117 | { | 117 | { |
118 | #if VERBOSE | 118 | #if VERBOSE |
119 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 119 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); |
120 | "All peers successfully shut down!\n"); | ||
121 | #endif | 120 | #endif |
122 | } | 121 | } |
123 | } | 122 | } |
124 | 123 | ||
125 | static void | 124 | static void |
@@ -140,10 +139,10 @@ finish_testing () | |||
140 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "daemons_stop finished\n"); | 139 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "daemons_stop finished\n"); |
141 | #endif | 140 | #endif |
142 | if (dotOutFile != NULL) | 141 | if (dotOutFile != NULL) |
143 | { | 142 | { |
144 | fprintf (dotOutFile, "}"); | 143 | fprintf (dotOutFile, "}"); |
145 | fclose (dotOutFile); | 144 | fclose (dotOutFile); |
146 | } | 145 | } |
147 | 146 | ||
148 | ok = 0; | 147 | ok = 0; |
149 | } | 148 | } |
@@ -152,22 +151,23 @@ static void | |||
152 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 151 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
153 | { | 152 | { |
154 | char *msg = cls; | 153 | char *msg = cls; |
154 | |||
155 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 155 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
156 | "End badly was called (%s)... stopping daemons.\n", msg); | 156 | "End badly was called (%s)... stopping daemons.\n", msg); |
157 | 157 | ||
158 | if (pg != NULL) | 158 | if (pg != NULL) |
159 | { | 159 | { |
160 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); | 160 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
161 | ok = 7331; /* Opposite of leet */ | 161 | ok = 7331; /* Opposite of leet */ |
162 | } | 162 | } |
163 | else | 163 | else |
164 | ok = 401; /* Never got peers started */ | 164 | ok = 401; /* Never got peers started */ |
165 | 165 | ||
166 | if (dotOutFile != NULL) | 166 | if (dotOutFile != NULL) |
167 | { | 167 | { |
168 | fprintf (dotOutFile, "}"); | 168 | fprintf (dotOutFile, "}"); |
169 | fclose (dotOutFile); | 169 | fclose (dotOutFile); |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
173 | 173 | ||
@@ -184,70 +184,70 @@ topology_callback (void *cls, | |||
184 | const char *emsg) | 184 | const char *emsg) |
185 | { | 185 | { |
186 | if (emsg == NULL) | 186 | if (emsg == NULL) |
187 | { | 187 | { |
188 | total_connections++; | 188 | total_connections++; |
189 | #if VERBOSE | 189 | #if VERBOSE |
190 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connected peer %s to peer %s\n", | 190 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connected peer %s to peer %s\n", |
191 | first_daemon->shortname, second_daemon->shortname); | 191 | first_daemon->shortname, second_daemon->shortname); |
192 | #endif | 192 | #endif |
193 | if (dotOutFile != NULL) | 193 | if (dotOutFile != NULL) |
194 | fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, | 194 | fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, |
195 | second_daemon->shortname); | 195 | second_daemon->shortname); |
196 | } | 196 | } |
197 | 197 | ||
198 | else | 198 | else |
199 | { | 199 | { |
200 | failed_connections++; | 200 | failed_connections++; |
201 | #if VERBOSE | 201 | #if VERBOSE |
202 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 202 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
203 | "Failed to connect peer %s to peer %s with error :\n%s\n", | 203 | "Failed to connect peer %s to peer %s with error :\n%s\n", |
204 | first_daemon->shortname, second_daemon->shortname, emsg); | 204 | first_daemon->shortname, second_daemon->shortname, emsg); |
205 | #endif | 205 | #endif |
206 | } | 206 | } |
207 | 207 | ||
208 | 208 | ||
209 | if (total_connections == expected_connections) | 209 | if (total_connections == expected_connections) |
210 | { | 210 | { |
211 | #if VERBOSE | 211 | #if VERBOSE |
212 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 212 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
213 | "Created %d total connections, which is our target number (that's bad)!\n", | 213 | "Created %d total connections, which is our target number (that's bad)!\n", |
214 | total_connections); | 214 | total_connections); |
215 | #endif | 215 | #endif |
216 | 216 | ||
217 | GNUNET_SCHEDULER_cancel (die_task); | 217 | GNUNET_SCHEDULER_cancel (die_task); |
218 | die_task = GNUNET_SCHEDULER_NO_TASK; | 218 | die_task = GNUNET_SCHEDULER_NO_TASK; |
219 | die_task = | 219 | die_task = |
220 | GNUNET_SCHEDULER_add_now (&end_badly, | 220 | GNUNET_SCHEDULER_add_now (&end_badly, |
221 | "from topology_callback (too many successful connections)"); | 221 | "from topology_callback (too many successful connections)"); |
222 | } | 222 | } |
223 | else if (total_connections + failed_connections == expected_connections) | 223 | else if (total_connections + failed_connections == expected_connections) |
224 | { | ||
225 | if ((failed_connections == expected_failed_connections) | ||
226 | && (total_connections == | ||
227 | expected_connections - expected_failed_connections)) | ||
228 | { | ||
229 | GNUNET_SCHEDULER_cancel (die_task); | ||
230 | die_task = GNUNET_SCHEDULER_NO_TASK; | ||
231 | die_task = GNUNET_SCHEDULER_add_now (&finish_testing, NULL); | ||
232 | } | ||
233 | else | ||
224 | { | 234 | { |
225 | if ((failed_connections == expected_failed_connections) | 235 | GNUNET_SCHEDULER_cancel (die_task); |
226 | && (total_connections == | 236 | die_task = |
227 | expected_connections - expected_failed_connections)) | 237 | GNUNET_SCHEDULER_add_now (&end_badly, |
228 | { | 238 | "from topology_callback (wrong number of failed connections)"); |
229 | GNUNET_SCHEDULER_cancel (die_task); | ||
230 | die_task = GNUNET_SCHEDULER_NO_TASK; | ||
231 | die_task = GNUNET_SCHEDULER_add_now (&finish_testing, NULL); | ||
232 | } | ||
233 | else | ||
234 | { | ||
235 | GNUNET_SCHEDULER_cancel (die_task); | ||
236 | die_task = | ||
237 | GNUNET_SCHEDULER_add_now (&end_badly, | ||
238 | "from topology_callback (wrong number of failed connections)"); | ||
239 | } | ||
240 | } | 239 | } |
240 | } | ||
241 | else | 241 | else |
242 | { | 242 | { |
243 | #if VERBOSE | 243 | #if VERBOSE |
244 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 244 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
245 | "Have %d total connections, %d failed connections, Want %d (failed) and %d (successful)\n", | 245 | "Have %d total connections, %d failed connections, Want %d (failed) and %d (successful)\n", |
246 | total_connections, failed_connections, | 246 | total_connections, failed_connections, |
247 | expected_failed_connections, | 247 | expected_failed_connections, |
248 | expected_connections - expected_failed_connections); | 248 | expected_connections - expected_failed_connections); |
249 | #endif | 249 | #endif |
250 | } | 250 | } |
251 | } | 251 | } |
252 | 252 | ||
253 | static void | 253 | static void |
@@ -255,27 +255,26 @@ connect_topology () | |||
255 | { | 255 | { |
256 | expected_connections = -1; | 256 | expected_connections = -1; |
257 | if ((pg != NULL) && (peers_left == 0)) | 257 | if ((pg != NULL) && (peers_left == 0)) |
258 | { | 258 | { |
259 | expected_connections = | 259 | expected_connections = |
260 | GNUNET_TESTING_connect_topology (pg, connection_topology, | 260 | GNUNET_TESTING_connect_topology (pg, connection_topology, |
261 | connect_topology_option, | 261 | connect_topology_option, |
262 | connect_topology_option_modifier, | 262 | connect_topology_option_modifier, |
263 | connect_timeout, | 263 | connect_timeout, |
264 | connect_attempts, | 264 | connect_attempts, NULL, NULL); |
265 | NULL, NULL); | ||
266 | #if VERBOSE | 265 | #if VERBOSE |
267 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 266 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
268 | "Have %d expected connections\n", expected_connections); | 267 | "Have %d expected connections\n", expected_connections); |
269 | #endif | 268 | #endif |
270 | } | 269 | } |
271 | 270 | ||
272 | GNUNET_SCHEDULER_cancel (die_task); | 271 | GNUNET_SCHEDULER_cancel (die_task); |
273 | if (expected_connections == GNUNET_SYSERR) | 272 | if (expected_connections == GNUNET_SYSERR) |
274 | { | 273 | { |
275 | die_task = | 274 | die_task = |
276 | GNUNET_SCHEDULER_add_now (&end_badly, | 275 | GNUNET_SCHEDULER_add_now (&end_badly, |
277 | "from connect topology (bad return)"); | 276 | "from connect topology (bad return)"); |
278 | } | 277 | } |
279 | 278 | ||
280 | die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, | 279 | die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, |
281 | &end_badly, | 280 | &end_badly, |
@@ -287,22 +286,21 @@ create_topology () | |||
287 | { | 286 | { |
288 | peers_left = num_peers; /* Reset counter */ | 287 | peers_left = num_peers; /* Reset counter */ |
289 | if (GNUNET_TESTING_create_topology | 288 | if (GNUNET_TESTING_create_topology |
290 | (pg, topology, blacklist_topology, | 289 | (pg, topology, blacklist_topology, blacklist_transports) != GNUNET_SYSERR) |
291 | blacklist_transports) != GNUNET_SYSERR) | 290 | { |
292 | { | ||
293 | #if VERBOSE | 291 | #if VERBOSE |
294 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 292 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
295 | "Topology set up, now starting peers!\n"); | 293 | "Topology set up, now starting peers!\n"); |
296 | #endif | 294 | #endif |
297 | GNUNET_TESTING_daemons_continue_startup (pg); | 295 | GNUNET_TESTING_daemons_continue_startup (pg); |
298 | } | 296 | } |
299 | else | 297 | else |
300 | { | 298 | { |
301 | GNUNET_SCHEDULER_cancel (die_task); | 299 | GNUNET_SCHEDULER_cancel (die_task); |
302 | die_task = | 300 | die_task = |
303 | GNUNET_SCHEDULER_add_now (&end_badly, | 301 | GNUNET_SCHEDULER_add_now (&end_badly, |
304 | "from create topology (bad return)"); | 302 | "from create topology (bad return)"); |
305 | } | 303 | } |
306 | GNUNET_SCHEDULER_cancel (die_task); | 304 | GNUNET_SCHEDULER_cancel (die_task); |
307 | die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, | 305 | die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, |
308 | &end_badly, | 306 | &end_badly, |
@@ -317,11 +315,11 @@ peers_started_callback (void *cls, | |||
317 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | 315 | struct GNUNET_TESTING_Daemon *d, const char *emsg) |
318 | { | 316 | { |
319 | if (emsg != NULL) | 317 | if (emsg != NULL) |
320 | { | 318 | { |
321 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 319 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
322 | "Failed to start daemon with error: `%s'\n", emsg); | 320 | "Failed to start daemon with error: `%s'\n", emsg); |
323 | return; | 321 | return; |
324 | } | 322 | } |
325 | GNUNET_assert (id != NULL); | 323 | GNUNET_assert (id != NULL); |
326 | #if VERBOSE | 324 | #if VERBOSE |
327 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", | 325 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", |
@@ -329,22 +327,21 @@ peers_started_callback (void *cls, | |||
329 | #endif | 327 | #endif |
330 | peers_left--; | 328 | peers_left--; |
331 | if (peers_left == 0) | 329 | if (peers_left == 0) |
332 | { | 330 | { |
333 | #if VERBOSE | 331 | #if VERBOSE |
334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 332 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
335 | "All %d daemons started, now creating topology!\n", | 333 | "All %d daemons started, now creating topology!\n", num_peers); |
336 | num_peers); | ||
337 | #endif | 334 | #endif |
338 | GNUNET_SCHEDULER_cancel (die_task); | 335 | GNUNET_SCHEDULER_cancel (die_task); |
339 | /* Set up task in case topology creation doesn't finish | 336 | /* Set up task in case topology creation doesn't finish |
340 | * within a reasonable amount of time */ | 337 | * within a reasonable amount of time */ |
341 | die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 338 | die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
342 | (GNUNET_TIME_UNIT_MINUTES, 5), | 339 | (GNUNET_TIME_UNIT_MINUTES, 5), |
343 | &end_badly, | 340 | &end_badly, |
344 | "from peers_started_callback"); | 341 | "from peers_started_callback"); |
345 | connect_topology (); | 342 | connect_topology (); |
346 | ok = 0; | 343 | ok = 0; |
347 | } | 344 | } |
348 | } | 345 | } |
349 | 346 | ||
350 | /** | 347 | /** |
@@ -361,10 +358,10 @@ hostkey_callback (void *cls, | |||
361 | struct GNUNET_TESTING_Daemon *d, const char *emsg) | 358 | struct GNUNET_TESTING_Daemon *d, const char *emsg) |
362 | { | 359 | { |
363 | if (emsg != NULL) | 360 | if (emsg != NULL) |
364 | { | 361 | { |
365 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 362 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
366 | "Hostkey callback received error: %s\n", emsg); | 363 | "Hostkey callback received error: %s\n", emsg); |
367 | } | 364 | } |
368 | 365 | ||
369 | #if VERBOSE | 366 | #if VERBOSE |
370 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 367 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -372,22 +369,21 @@ hostkey_callback (void *cls, | |||
372 | #endif | 369 | #endif |
373 | peers_left--; | 370 | peers_left--; |
374 | if (peers_left == 0) | 371 | if (peers_left == 0) |
375 | { | 372 | { |
376 | #if VERBOSE | 373 | #if VERBOSE |
377 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 374 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
378 | "All %d hostkeys created, now creating topology!\n", | 375 | "All %d hostkeys created, now creating topology!\n", num_peers); |
379 | num_peers); | ||
380 | #endif | 376 | #endif |
381 | GNUNET_SCHEDULER_cancel (die_task); | 377 | GNUNET_SCHEDULER_cancel (die_task); |
382 | /* Set up task in case topology creation doesn't finish | 378 | /* Set up task in case topology creation doesn't finish |
383 | * within a reasonable amount of time */ | 379 | * within a reasonable amount of time */ |
384 | die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 380 | die_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
385 | (GNUNET_TIME_UNIT_MINUTES, 5), | 381 | (GNUNET_TIME_UNIT_MINUTES, 5), |
386 | &end_badly, | 382 | &end_badly, |
387 | "from hostkey_callback"); | 383 | "from hostkey_callback"); |
388 | GNUNET_SCHEDULER_add_now (&create_topology, NULL); | 384 | GNUNET_SCHEDULER_add_now (&create_topology, NULL); |
389 | ok = 0; | 385 | ok = 0; |
390 | } | 386 | } |
391 | } | 387 | } |
392 | 388 | ||
393 | static void | 389 | static void |
@@ -401,13 +397,14 @@ run (void *cls, | |||
401 | unsigned long long connect_topology_option_num; | 397 | unsigned long long connect_topology_option_num; |
402 | unsigned long long temp_connect; | 398 | unsigned long long temp_connect; |
403 | char *connect_topology_option_modifier_string; | 399 | char *connect_topology_option_modifier_string; |
400 | |||
404 | ok = 1; | 401 | ok = 1; |
405 | 402 | ||
406 | dotOutFile = fopen (dotOutFileName, "w"); | 403 | dotOutFile = fopen (dotOutFileName, "w"); |
407 | if (dotOutFile != NULL) | 404 | if (dotOutFile != NULL) |
408 | { | 405 | { |
409 | fprintf (dotOutFile, "strict graph G {\n"); | 406 | fprintf (dotOutFile, "strict graph G {\n"); |
410 | } | 407 | } |
411 | 408 | ||
412 | #if VERBOSE | 409 | #if VERBOSE |
413 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 410 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -417,14 +414,14 @@ run (void *cls, | |||
417 | if (GNUNET_YES != | 414 | if (GNUNET_YES != |
418 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", | 415 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", |
419 | &test_directory)) | 416 | &test_directory)) |
417 | { | ||
418 | ok = 404; | ||
419 | if (dotOutFile != NULL) | ||
420 | { | 420 | { |
421 | ok = 404; | 421 | fclose (dotOutFile); |
422 | if (dotOutFile != NULL) | ||
423 | { | ||
424 | fclose (dotOutFile); | ||
425 | } | ||
426 | return; | ||
427 | } | 422 | } |
423 | return; | ||
424 | } | ||
428 | 425 | ||
429 | if (GNUNET_YES == | 426 | if (GNUNET_YES == |
430 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "topology", | 427 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "topology", |
@@ -447,41 +444,41 @@ run (void *cls, | |||
447 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 444 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
448 | "connect_topology_option_modifier", | 445 | "connect_topology_option_modifier", |
449 | &connect_topology_option_modifier_string)) | 446 | &connect_topology_option_modifier_string)) |
447 | { | ||
448 | if (sscanf | ||
449 | (connect_topology_option_modifier_string, "%lf", | ||
450 | &connect_topology_option_modifier) != 1) | ||
450 | { | 451 | { |
451 | if (sscanf | 452 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
452 | (connect_topology_option_modifier_string, "%lf", | 453 | _ |
453 | &connect_topology_option_modifier) != 1) | 454 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), |
454 | { | 455 | connect_topology_option_modifier_string, |
455 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 456 | "connect_topology_option_modifier", "TESTING"); |
456 | _ | ||
457 | ("Invalid value `%s' for option `%s' in section `%s': expected float\n"), | ||
458 | connect_topology_option_modifier_string, | ||
459 | "connect_topology_option_modifier", "TESTING"); | ||
460 | GNUNET_free (connect_topology_option_modifier_string); | ||
461 | ok = 707; | ||
462 | if (dotOutFile != NULL) | ||
463 | { | ||
464 | fclose (dotOutFile); | ||
465 | } | ||
466 | return; | ||
467 | } | ||
468 | GNUNET_free (connect_topology_option_modifier_string); | 457 | GNUNET_free (connect_topology_option_modifier_string); |
458 | ok = 707; | ||
459 | if (dotOutFile != NULL) | ||
460 | { | ||
461 | fclose (dotOutFile); | ||
462 | } | ||
463 | return; | ||
469 | } | 464 | } |
465 | GNUNET_free (connect_topology_option_modifier_string); | ||
466 | } | ||
470 | 467 | ||
471 | if (GNUNET_OK != | 468 | if (GNUNET_OK != |
472 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 469 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
473 | "blacklist_transports", | 470 | "blacklist_transports", |
474 | &blacklist_transports)) | 471 | &blacklist_transports)) |
472 | { | ||
473 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
474 | "No transports specified for blacklisting in blacklist testcase (this shouldn't happen!)\n"); | ||
475 | ok = 808; | ||
476 | if (dotOutFile != NULL) | ||
475 | { | 477 | { |
476 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 478 | fclose (dotOutFile); |
477 | "No transports specified for blacklisting in blacklist testcase (this shouldn't happen!)\n"); | ||
478 | ok = 808; | ||
479 | if (dotOutFile != NULL) | ||
480 | { | ||
481 | fclose (dotOutFile); | ||
482 | } | ||
483 | return; | ||
484 | } | 479 | } |
480 | return; | ||
481 | } | ||
485 | 482 | ||
486 | if (GNUNET_YES == | 483 | if (GNUNET_YES == |
487 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", | 484 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", |
@@ -498,21 +495,23 @@ run (void *cls, | |||
498 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout", | 495 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout", |
499 | &temp_connect)) | 496 | &temp_connect)) |
500 | connect_timeout = | 497 | connect_timeout = |
501 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_connect); | 498 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_connect); |
502 | else | 499 | else |
503 | { | 500 | { |
504 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "connect_timeout"); | 501 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
505 | return; | 502 | "testing", "connect_timeout"); |
506 | } | 503 | return; |
504 | } | ||
507 | 505 | ||
508 | 506 | ||
509 | if (GNUNET_OK != | 507 | if (GNUNET_OK != |
510 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_attempts", | 508 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_attempts", |
511 | &connect_attempts)) | 509 | &connect_attempts)) |
512 | { | 510 | { |
513 | GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "connect_attempts"); | 511 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
514 | return; | 512 | "testing", "connect_attempts"); |
515 | } | 513 | return; |
514 | } | ||
516 | 515 | ||
517 | main_cfg = cfg; | 516 | main_cfg = cfg; |
518 | 517 | ||
@@ -546,6 +545,7 @@ static int | |||
546 | check () | 545 | check () |
547 | { | 546 | { |
548 | int ret; | 547 | int ret; |
548 | |||
549 | char *const argv[] = { "test-testing-topology-blacklist", | 549 | char *const argv[] = { "test-testing-topology-blacklist", |
550 | "-c", | 550 | "-c", |
551 | "test_testing_data_topology_blacklist.conf", | 551 | "test_testing_data_topology_blacklist.conf", |
@@ -561,11 +561,11 @@ check () | |||
561 | argv, "test-testing-topology-blacklist", "nohelp", | 561 | argv, "test-testing-topology-blacklist", "nohelp", |
562 | options, &run, &ok); | 562 | options, &run, &ok); |
563 | if (ret != GNUNET_OK) | 563 | if (ret != GNUNET_OK) |
564 | { | 564 | { |
565 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 565 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
566 | "`test-testing-topology-blacklist': Failed with error code %d\n", | 566 | "`test-testing-topology-blacklist': Failed with error code %d\n", |
567 | ret); | 567 | ret); |
568 | } | 568 | } |
569 | 569 | ||
570 | return ok; | 570 | return ok; |
571 | } | 571 | } |
@@ -589,14 +589,13 @@ main (int argc, char *argv[]) | |||
589 | * of by the testing framework. | 589 | * of by the testing framework. |
590 | */ | 590 | */ |
591 | if (test_directory != NULL) | 591 | if (test_directory != NULL) |
592 | { | ||
593 | if (GNUNET_DISK_directory_remove (test_directory) != GNUNET_OK) | ||
592 | { | 594 | { |
593 | if (GNUNET_DISK_directory_remove (test_directory) != GNUNET_OK) | 595 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
594 | { | 596 | "Failed to remove testing directory %s\n", test_directory); |
595 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
596 | "Failed to remove testing directory %s\n", | ||
597 | test_directory); | ||
598 | } | ||
599 | } | 597 | } |
598 | } | ||
600 | 599 | ||
601 | return ret; | 600 | return ret; |
602 | } | 601 | } |