aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_topology_blacklist.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-02-05 14:19:42 +0000
committerNathan S. Evans <evans@in.tum.de>2011-02-05 14:19:42 +0000
commit5d67c7671b669eec8d63d3af345217bcf10768fd (patch)
treee1abf089630ba9d540f97b2d67fda0073744e247 /src/testing/test_testing_topology_blacklist.c
parent59b233b7e3b3d70006fc8b40bd566e67bc487231 (diff)
downloadgnunet-5d67c7671b669eec8d63d3af345217bcf10768fd.tar.gz
gnunet-5d67c7671b669eec8d63d3af345217bcf10768fd.zip
configurable connect options
Diffstat (limited to 'src/testing/test_testing_topology_blacklist.c')
-rw-r--r--src/testing/test_testing_topology_blacklist.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c
index aa4a9cac7..2c1a8b31c 100644
--- a/src/testing/test_testing_topology_blacklist.c
+++ b/src/testing/test_testing_topology_blacklist.c
@@ -43,6 +43,10 @@
43 43
44static int ok; 44static int ok;
45 45
46struct GNUNET_TIME_Relative connect_timeout;
47
48static unsigned long long connect_attempts;
49
46static unsigned long long num_peers; 50static unsigned long long num_peers;
47 51
48static unsigned int total_connections; 52static unsigned int total_connections;
@@ -256,6 +260,8 @@ connect_topology ()
256 GNUNET_TESTING_connect_topology (pg, connection_topology, 260 GNUNET_TESTING_connect_topology (pg, connection_topology,
257 connect_topology_option, 261 connect_topology_option,
258 connect_topology_option_modifier, 262 connect_topology_option_modifier,
263 connect_timeout,
264 connect_attempts,
259 NULL, NULL); 265 NULL, NULL);
260#if VERBOSE 266#if VERBOSE
261 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 267 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -393,6 +399,7 @@ run (void *cls,
393 unsigned long long connect_topology_num; 399 unsigned long long connect_topology_num;
394 unsigned long long blacklist_topology_num; 400 unsigned long long blacklist_topology_num;
395 unsigned long long connect_topology_option_num; 401 unsigned long long connect_topology_option_num;
402 unsigned long long temp_connect;
396 char *connect_topology_option_modifier_string; 403 char *connect_topology_option_modifier_string;
397 ok = 1; 404 ok = 1;
398 405
@@ -487,6 +494,26 @@ run (void *cls,
487 &num_peers)) 494 &num_peers))
488 num_peers = DEFAULT_NUM_PEERS; 495 num_peers = DEFAULT_NUM_PEERS;
489 496
497 if (GNUNET_OK ==
498 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout",
499 &temp_connect))
500 connect_timeout =
501 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_connect);
502 else
503 {
504 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "connect_timeout");
505 return;
506 }
507
508
509 if (GNUNET_OK !=
510 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_attempts",
511 &connect_attempts))
512 {
513 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "connect_attempts");
514 return;
515 }
516
490 main_cfg = cfg; 517 main_cfg = cfg;
491 518
492 GNUNET_assert (num_peers > 0 && num_peers < (unsigned int) -1); 519 GNUNET_assert (num_peers > 0 && num_peers < (unsigned int) -1);
@@ -508,7 +535,8 @@ run (void *cls,
508 "didn't start all daemons in reasonable amount of time!!!"); 535 "didn't start all daemons in reasonable amount of time!!!");
509 536
510 pg = GNUNET_TESTING_daemons_start (cfg, 537 pg = GNUNET_TESTING_daemons_start (cfg,
511 peers_left, TIMEOUT, &hostkey_callback, 538 peers_left, peers_left,
539 TIMEOUT, &hostkey_callback,
512 NULL, &peers_started_callback, NULL, 540 NULL, &peers_started_callback, NULL,
513 &topology_callback, NULL, NULL); 541 &topology_callback, NULL, NULL);
514 542