aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_testing_topology.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.c
parent59b233b7e3b3d70006fc8b40bd566e67bc487231 (diff)
downloadgnunet-5d67c7671b669eec8d63d3af345217bcf10768fd.tar.gz
gnunet-5d67c7671b669eec8d63d3af345217bcf10768fd.zip
configurable connect options
Diffstat (limited to 'src/testing/test_testing_topology.c')
-rw-r--r--src/testing/test_testing_topology.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index 0e64f93aa..0461af89c 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -52,6 +52,10 @@ static int ok;
52 52
53static unsigned long long num_peers; 53static unsigned long long num_peers;
54 54
55struct GNUNET_TIME_Relative connect_timeout;
56
57static unsigned long long connect_attempts;
58
55static unsigned int topology_connections; 59static unsigned int topology_connections;
56 60
57static unsigned int total_connections; 61static unsigned int total_connections;
@@ -814,6 +818,8 @@ connect_topology ()
814 GNUNET_TESTING_connect_topology (pg, connection_topology, 818 GNUNET_TESTING_connect_topology (pg, connection_topology,
815 connect_topology_option, 819 connect_topology_option,
816 connect_topology_option_modifier, 820 connect_topology_option_modifier,
821 connect_timeout,
822 connect_attempts,
817 &topology_creation_finished, NULL); 823 &topology_creation_finished, NULL);
818#if VERBOSE 824#if VERBOSE
819 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 825 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1112,6 +1118,26 @@ run (void *cls,
1112 settle_time = 1118 settle_time =
1113 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_settle); 1119 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_settle);
1114 1120
1121 if (GNUNET_OK ==
1122 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_timeout",
1123 &temp_settle))
1124 connect_timeout =
1125 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, temp_settle);
1126 else
1127 {
1128 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "connect_timeout");
1129 return;
1130 }
1131
1132
1133 if (GNUNET_OK !=
1134 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_attempts",
1135 &connect_attempts))
1136 {
1137 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", "testing", "connect_attempts");
1138 return;
1139 }
1140
1115 if (GNUNET_SYSERR == 1141 if (GNUNET_SYSERR ==
1116 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "num_peers", 1142 GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "num_peers",
1117 &num_peers)) 1143 &num_peers))
@@ -1136,6 +1162,7 @@ run (void *cls,
1136 GNUNET_assert (num_peers > 0 && num_peers < (unsigned int) -1); 1162 GNUNET_assert (num_peers > 0 && num_peers < (unsigned int) -1);
1137 pg = GNUNET_TESTING_daemons_start (cfg, 1163 pg = GNUNET_TESTING_daemons_start (cfg,
1138 peers_left, 1164 peers_left,
1165 peers_left / 2,
1139 GNUNET_TIME_relative_multiply 1166 GNUNET_TIME_relative_multiply
1140 (GNUNET_TIME_UNIT_SECONDS, 1167 (GNUNET_TIME_UNIT_SECONDS,
1141 SECONDS_PER_PEER_START * num_peers), 1168 SECONDS_PER_PEER_START * num_peers),