From f8dcb68bc0d257058e26c96aed0a967beda82b6a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 15 Dec 2014 18:36:57 +0000 Subject: [PATCH] -fix test: only run test logic, not full peer --- src/ats/gnunet-service-ats_addresses.c | 8 ++++++- src/ats/gnunet-service-ats_performance.c | 3 +++ src/ats/test_ats_api.conf | 2 ++ ..._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, addr->atsi, addr->atsi_count, GNUNET_BANDWIDTH_value_init (addr->assigned_bw_out), GNUNET_BANDWIDTH_value_init (addr->assigned_bw_in)); - return GNUNET_YES; + return GNUNET_OK; } @@ -2265,6 +2265,12 @@ GAS_addresses_get_peer_info (struct GAS_Addresses_Handle *handle, GNUNET_break (0); return; } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Returning information for %s from a total of %u known addresses\n", + (NULL == peer) + ? "all peers" + : GNUNET_i2s (peer), + (unsigned int) GNUNET_CONTAINER_multipeermap_size (handle->addresses)); pi_ctx.it = pi_it; pi_ctx.it_cls = pi_it_cls; 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, &req_addr_peerinfo_it, &ai); } + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Finished handling `%s' message\n", + "ADDRESSLIST_REQUEST"); transmit_req_addr (&ai, NULL, NULL, NULL, 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 @@ +@INLINE@ ../../contrib/no_forcestart.conf + [PATHS] GNUNET_TEST_HOME = /tmp/test-ats-api-scheduling/ 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, GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_NO_TASK; } - if (NULL != sched_ats) { GNUNET_ATS_scheduling_done (sched_ats); sched_ats = NULL; } - if (NULL != phal) { GNUNET_ATS_performance_list_addresses_cancel (phal); phal = NULL; } - if (NULL != perf_ats) { GNUNET_ATS_performance_done (perf_ats); @@ -242,8 +239,9 @@ address_suggest_cb (void *cls, static void -run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, - struct GNUNET_TESTING_Peer *peer) +run (void *cls, + const struct GNUNET_CONFIGURATION_Handle *mycfg, + struct GNUNET_TESTING_Peer *peer) { ret = 1; cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg; @@ -274,8 +272,9 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, p0_ha[1].peer = p[0].id; p0_ha[1].transport_name = p0_addresses[1].plugin; - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Created peer 0: `%s'\n", - GNUNET_i2s (&p[0].id)); + GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, + "Created peer 0: `%s'\n", + GNUNET_i2s (&p[0].id)); memset (&p[1].id, '2', sizeof (p[1].id)); p1_addresses[0].plugin = "test"; @@ -298,11 +297,13 @@ run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, p1_ha[1].peer = p[1].id; p1_ha[1].transport_name = p1_addresses[1].plugin; - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Created peer 1: `%s'\n", - GNUNET_i2s (&p[1].id)); + GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, + "Created peer 1: `%s'\n", + GNUNET_i2s (&p[1].id)); /* Add addresses */ - sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL ); + sched_ats = GNUNET_ATS_scheduling_init (cfg, + &address_suggest_cb, NULL); if (NULL == sched_ats) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, -- 2.25.1