diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-15 18:36:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-15 18:36:57 +0000 |
commit | f8dcb68bc0d257058e26c96aed0a967beda82b6a (patch) | |
tree | ad8d727cb6823a737c1115a82844ad8f9d2ee068 /src/ats | |
parent | 3a123f07fe36bc6ee07b3040d72f3ebb1d80dd9e (diff) | |
download | gnunet-f8dcb68bc0d257058e26c96aed0a967beda82b6a.tar.gz gnunet-f8dcb68bc0d257058e26c96aed0a967beda82b6a.zip |
-fix test: only run test logic, not full peer
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses.c | 8 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_performance.c | 3 | ||||
-rw-r--r-- | src/ats/test_ats_api.conf | 2 | ||||
-rw-r--r-- | src/ats/test_ats_api_performance_list_peer_addresses.c | 21 |
4 files changed, 23 insertions, 11 deletions
diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index 768b13076..f0af8f1a2 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c | |||
@@ -2239,7 +2239,7 @@ peerinfo_it (void *cls, | |||
2239 | addr->atsi, addr->atsi_count, | 2239 | addr->atsi, addr->atsi_count, |
2240 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_out), | 2240 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_out), |
2241 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_in)); | 2241 | GNUNET_BANDWIDTH_value_init (addr->assigned_bw_in)); |
2242 | return GNUNET_YES; | 2242 | return GNUNET_OK; |
2243 | } | 2243 | } |
2244 | 2244 | ||
2245 | 2245 | ||
@@ -2265,6 +2265,12 @@ GAS_addresses_get_peer_info (struct GAS_Addresses_Handle *handle, | |||
2265 | GNUNET_break (0); | 2265 | GNUNET_break (0); |
2266 | return; | 2266 | return; |
2267 | } | 2267 | } |
2268 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2269 | "Returning information for %s from a total of %u known addresses\n", | ||
2270 | (NULL == peer) | ||
2271 | ? "all peers" | ||
2272 | : GNUNET_i2s (peer), | ||
2273 | (unsigned int) GNUNET_CONTAINER_multipeermap_size (handle->addresses)); | ||
2268 | pi_ctx.it = pi_it; | 2274 | pi_ctx.it = pi_it; |
2269 | pi_ctx.it_cls = pi_it_cls; | 2275 | pi_ctx.it_cls = pi_it_cls; |
2270 | if (NULL == peer) | 2276 | if (NULL == peer) |
diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c index 18038cc04..ad204fff3 100644 --- a/src/ats/gnunet-service-ats_performance.c +++ b/src/ats/gnunet-service-ats_performance.c | |||
@@ -541,6 +541,9 @@ GAS_handle_request_address_list (void *cls, | |||
541 | &req_addr_peerinfo_it, | 541 | &req_addr_peerinfo_it, |
542 | &ai); | 542 | &ai); |
543 | } | 543 | } |
544 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
545 | "Finished handling `%s' message\n", | ||
546 | "ADDRESSLIST_REQUEST"); | ||
544 | transmit_req_addr (&ai, | 547 | transmit_req_addr (&ai, |
545 | NULL, NULL, NULL, | 548 | NULL, NULL, NULL, |
546 | 0, GNUNET_NO, | 549 | 0, GNUNET_NO, |
diff --git a/src/ats/test_ats_api.conf b/src/ats/test_ats_api.conf index eb1c303be..ded22b7a2 100644 --- a/src/ats/test_ats_api.conf +++ b/src/ats/test_ats_api.conf | |||
@@ -1,3 +1,5 @@ | |||
1 | @INLINE@ ../../contrib/no_forcestart.conf | ||
2 | |||
1 | [PATHS] | 3 | [PATHS] |
2 | GNUNET_TEST_HOME = /tmp/test-ats-api-scheduling/ | 4 | GNUNET_TEST_HOME = /tmp/test-ats-api-scheduling/ |
3 | 5 | ||
diff --git a/src/ats/test_ats_api_performance_list_peer_addresses.c b/src/ats/test_ats_api_performance_list_peer_addresses.c index ed1b99f44..f19727b2d 100644 --- a/src/ats/test_ats_api_performance_list_peer_addresses.c +++ b/src/ats/test_ats_api_performance_list_peer_addresses.c | |||
@@ -181,19 +181,16 @@ end (void *cls, | |||
181 | GNUNET_SCHEDULER_cancel (die_task); | 181 | GNUNET_SCHEDULER_cancel (die_task); |
182 | die_task = GNUNET_SCHEDULER_NO_TASK; | 182 | die_task = GNUNET_SCHEDULER_NO_TASK; |
183 | } | 183 | } |
184 | |||
185 | if (NULL != sched_ats) | 184 | if (NULL != sched_ats) |
186 | { | 185 | { |
187 | GNUNET_ATS_scheduling_done (sched_ats); | 186 | GNUNET_ATS_scheduling_done (sched_ats); |
188 | sched_ats = NULL; | 187 | sched_ats = NULL; |
189 | } | 188 | } |
190 | |||
191 | if (NULL != phal) | 189 | if (NULL != phal) |
192 | { | 190 | { |
193 | GNUNET_ATS_performance_list_addresses_cancel (phal); | 191 | GNUNET_ATS_performance_list_addresses_cancel (phal); |
194 | phal = NULL; | 192 | phal = NULL; |
195 | } | 193 | } |
196 | |||
197 | if (NULL != perf_ats) | 194 | if (NULL != perf_ats) |
198 | { | 195 | { |
199 | GNUNET_ATS_performance_done (perf_ats); | 196 | GNUNET_ATS_performance_done (perf_ats); |
@@ -242,8 +239,9 @@ address_suggest_cb (void *cls, | |||
242 | 239 | ||
243 | 240 | ||
244 | static void | 241 | static void |
245 | run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, | 242 | run (void *cls, |
246 | struct GNUNET_TESTING_Peer *peer) | 243 | const struct GNUNET_CONFIGURATION_Handle *mycfg, |
244 | struct GNUNET_TESTING_Peer *peer) | ||
247 | { | 245 | { |
248 | ret = 1; | 246 | ret = 1; |
249 | cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg; | 247 | cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg; |
@@ -274,8 +272,9 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, | |||
274 | p0_ha[1].peer = p[0].id; | 272 | p0_ha[1].peer = p[0].id; |
275 | p0_ha[1].transport_name = p0_addresses[1].plugin; | 273 | p0_ha[1].transport_name = p0_addresses[1].plugin; |
276 | 274 | ||
277 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Created peer 0: `%s'\n", | 275 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
278 | GNUNET_i2s (&p[0].id)); | 276 | "Created peer 0: `%s'\n", |
277 | GNUNET_i2s (&p[0].id)); | ||
279 | 278 | ||
280 | memset (&p[1].id, '2', sizeof (p[1].id)); | 279 | memset (&p[1].id, '2', sizeof (p[1].id)); |
281 | p1_addresses[0].plugin = "test"; | 280 | p1_addresses[0].plugin = "test"; |
@@ -298,11 +297,13 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, | |||
298 | p1_ha[1].peer = p[1].id; | 297 | p1_ha[1].peer = p[1].id; |
299 | p1_ha[1].transport_name = p1_addresses[1].plugin; | 298 | p1_ha[1].transport_name = p1_addresses[1].plugin; |
300 | 299 | ||
301 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Created peer 1: `%s'\n", | 300 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
302 | GNUNET_i2s (&p[1].id)); | 301 | "Created peer 1: `%s'\n", |
302 | GNUNET_i2s (&p[1].id)); | ||
303 | 303 | ||
304 | /* Add addresses */ | 304 | /* Add addresses */ |
305 | sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL ); | 305 | sched_ats = GNUNET_ATS_scheduling_init (cfg, |
306 | &address_suggest_cb, NULL); | ||
306 | if (NULL == sched_ats) | 307 | if (NULL == sched_ats) |
307 | { | 308 | { |
308 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 309 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |