mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'ticket40237_043_01' into ticket40237_044_01
This commit is contained in:
@@ -462,9 +462,10 @@ test_hsdir_revision_counter_check(void *arg)
|
||||
static networkstatus_t mock_ns;
|
||||
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
return &mock_ns;
|
||||
}
|
||||
|
||||
@@ -485,8 +486,8 @@ test_client_cache(void *arg)
|
||||
/* Initialize HSDir cache subsystem */
|
||||
init_test();
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Set consensus time */
|
||||
parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
|
||||
@@ -589,8 +590,8 @@ test_client_cache_decrypt(void *arg)
|
||||
/* Initialize HSDir cache subsystem */
|
||||
hs_init();
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Set consensus time */
|
||||
parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
|
||||
@@ -645,7 +646,7 @@ test_client_cache_decrypt(void *arg)
|
||||
|
||||
hs_free_all();
|
||||
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -659,8 +660,8 @@ test_client_cache_remove(void *arg)
|
||||
|
||||
hs_init();
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Set consensus time. Lookup will not return the entry if it has expired
|
||||
* and it is checked against the consensus valid_after time. */
|
||||
@@ -698,7 +699,7 @@ test_client_cache_remove(void *arg)
|
||||
hs_descriptor_free(desc1);
|
||||
hs_free_all();
|
||||
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
struct testcase_t hs_cache[] = {
|
||||
|
||||
+24
-22
@@ -66,16 +66,18 @@ static networkstatus_t mock_ns;
|
||||
|
||||
/* Always return NULL. */
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus_false(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus_false(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
return &mock_ns;
|
||||
}
|
||||
|
||||
@@ -379,8 +381,8 @@ test_client_pick_intro(void *arg)
|
||||
ed25519_keypair_t service_kp;
|
||||
hs_descriptor_t *desc = NULL;
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
(void) arg;
|
||||
|
||||
@@ -632,15 +634,15 @@ test_descriptor_fetch(void *arg)
|
||||
get_options_mutable()->FetchHidServDescriptors = 1;
|
||||
|
||||
/* 2. We don't have a live consensus. */
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus_false);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus_false);
|
||||
ret = hs_client_refetch_hsdesc(&service_pk);
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
tt_int_op(ret, OP_EQ, HS_CLIENT_FETCH_MISSING_INFO);
|
||||
|
||||
/* From now on, return a live consensus. */
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* 3. Not enough dir information. */
|
||||
MOCK(router_have_minimum_dir_info,
|
||||
@@ -682,7 +684,7 @@ test_descriptor_fetch(void *arg)
|
||||
|
||||
done:
|
||||
connection_free_minimal(ENTRY_TO_CONN(ec));
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
UNMOCK(router_have_minimum_dir_info);
|
||||
hs_free_all();
|
||||
}
|
||||
@@ -880,8 +882,8 @@ test_desc_has_arrived_cleanup(void *arg)
|
||||
|
||||
hs_init();
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
MOCK(connection_mark_unattached_ap_,
|
||||
mock_connection_mark_unattached_ap_);
|
||||
MOCK(router_have_minimum_dir_info,
|
||||
@@ -953,7 +955,7 @@ test_desc_has_arrived_cleanup(void *arg)
|
||||
tor_free(desc_str);
|
||||
hs_free_all();
|
||||
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
UNMOCK(connection_mark_unattached_ap_);
|
||||
UNMOCK(router_have_minimum_dir_info);
|
||||
}
|
||||
@@ -974,8 +976,8 @@ test_close_intro_circuits_new_desc(void *arg)
|
||||
|
||||
/* This is needed because of the client cache expiration timestamp is based
|
||||
* on having a consensus. See cached_client_descriptor_has_expired(). */
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Set consensus time */
|
||||
parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
|
||||
@@ -1101,7 +1103,7 @@ test_close_intro_circuits_new_desc(void *arg)
|
||||
hs_descriptor_free(desc1);
|
||||
hs_descriptor_free(desc2);
|
||||
hs_free_all();
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1120,8 +1122,8 @@ test_close_intro_circuits_cache_clean(void *arg)
|
||||
|
||||
/* This is needed because of the client cache expiration timestamp is based
|
||||
* on having a consensus. See cached_client_descriptor_has_expired(). */
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Set consensus time */
|
||||
parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
|
||||
@@ -1186,7 +1188,7 @@ test_close_intro_circuits_cache_clean(void *arg)
|
||||
hs_descriptor_free(desc1);
|
||||
hs_free_all();
|
||||
rend_cache_free_all();
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1207,8 +1209,8 @@ test_socks_hs_errors(void *arg)
|
||||
|
||||
(void) arg;
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
MOCK(connection_mark_unattached_ap_,
|
||||
mock_connection_mark_unattached_ap_no_close);
|
||||
MOCK(read_file_to_str, mock_read_file_to_str);
|
||||
@@ -1356,7 +1358,7 @@ test_socks_hs_errors(void *arg)
|
||||
|
||||
hs_free_all();
|
||||
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
UNMOCK(connection_mark_unattached_ap_);
|
||||
UNMOCK(read_file_to_str);
|
||||
UNMOCK(tor_listdir);
|
||||
|
||||
+23
-13
@@ -360,9 +360,10 @@ mock_networkstatus_get_latest_consensus(void)
|
||||
}
|
||||
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
|
||||
tt_assert(mock_ns);
|
||||
|
||||
@@ -382,6 +383,8 @@ test_responsible_hsdirs(void *arg)
|
||||
|
||||
MOCK(networkstatus_get_latest_consensus,
|
||||
mock_networkstatus_get_latest_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
ns = networkstatus_get_latest_consensus();
|
||||
|
||||
@@ -418,6 +421,8 @@ test_responsible_hsdirs(void *arg)
|
||||
smartlist_clear(ns->routerstatus_list);
|
||||
networkstatus_vote_free(mock_ns);
|
||||
cleanup_nodelist();
|
||||
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -467,6 +472,8 @@ test_desc_reupload_logic(void *arg)
|
||||
|
||||
hs_init();
|
||||
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
MOCK(router_have_minimum_dir_info,
|
||||
mock_router_have_minimum_dir_info);
|
||||
MOCK(get_or_state,
|
||||
@@ -911,9 +918,11 @@ static smartlist_t *service_responsible_hsdirs = NULL;
|
||||
static smartlist_t *client_responsible_hsdirs = NULL;
|
||||
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus_service(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus_service(time_t now,
|
||||
int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
|
||||
if (mock_service_ns) {
|
||||
return mock_service_ns;
|
||||
@@ -929,13 +938,14 @@ mock_networkstatus_get_live_consensus_service(time_t now)
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_latest_consensus_service(void)
|
||||
{
|
||||
return mock_networkstatus_get_live_consensus_service(0);
|
||||
return mock_networkstatus_get_reasonably_live_consensus_service(0, 0);
|
||||
}
|
||||
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus_client(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus_client(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
|
||||
if (mock_client_ns) {
|
||||
return mock_client_ns;
|
||||
@@ -951,7 +961,7 @@ mock_networkstatus_get_live_consensus_client(time_t now)
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_latest_consensus_client(void)
|
||||
{
|
||||
return mock_networkstatus_get_live_consensus_client(0);
|
||||
return mock_networkstatus_get_reasonably_live_consensus_client(0, 0);
|
||||
}
|
||||
|
||||
/* Mock function because we are not trying to test the close circuit that does
|
||||
@@ -1411,8 +1421,8 @@ run_reachability_scenario(const reachability_cfg_t *cfg, int num_scenario)
|
||||
* === Client setup ===
|
||||
*/
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus_client);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus_client);
|
||||
MOCK(networkstatus_get_latest_consensus,
|
||||
mock_networkstatus_get_latest_consensus_client);
|
||||
|
||||
@@ -1436,14 +1446,14 @@ run_reachability_scenario(const reachability_cfg_t *cfg, int num_scenario)
|
||||
tt_int_op(smartlist_len(client_responsible_hsdirs), OP_EQ, 6);
|
||||
|
||||
UNMOCK(networkstatus_get_latest_consensus);
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/*
|
||||
* === Service setup ===
|
||||
*/
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus_service);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus_service);
|
||||
MOCK(networkstatus_get_latest_consensus,
|
||||
mock_networkstatus_get_latest_consensus_service);
|
||||
|
||||
@@ -1470,7 +1480,7 @@ run_reachability_scenario(const reachability_cfg_t *cfg, int num_scenario)
|
||||
tt_int_op(smartlist_len(service_responsible_hsdirs), OP_EQ, 8);
|
||||
|
||||
UNMOCK(networkstatus_get_latest_consensus);
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Some testing of the values we just got from the client and service. */
|
||||
tt_mem_op(&client_blinded_pk, OP_EQ, &service_blinded_pk,
|
||||
@@ -1721,8 +1731,8 @@ test_client_service_hsdir_set_sync(void *arg)
|
||||
|
||||
MOCK(networkstatus_get_latest_consensus,
|
||||
mock_networkstatus_get_latest_consensus);
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
MOCK(get_or_state,
|
||||
get_or_state_replacement);
|
||||
MOCK(hs_desc_encode_descriptor,
|
||||
|
||||
+21
-19
@@ -83,16 +83,18 @@
|
||||
static networkstatus_t mock_ns;
|
||||
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
return &mock_ns;
|
||||
}
|
||||
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_live_consensus_null(time_t now)
|
||||
mock_networkstatus_get_reasonably_live_consensus_null(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1375,8 +1377,8 @@ test_rotate_descriptors(void *arg)
|
||||
hs_init();
|
||||
MOCK(get_or_state, get_or_state_replacement);
|
||||
MOCK(circuit_mark_for_close_, mock_circuit_mark_for_close);
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Descriptor rotation happens with a consensus with a new SRV. */
|
||||
|
||||
@@ -1464,7 +1466,7 @@ test_rotate_descriptors(void *arg)
|
||||
hs_free_all();
|
||||
UNMOCK(get_or_state);
|
||||
UNMOCK(circuit_mark_for_close_);
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
/** Test building descriptors: picking intro points, setting up their link
|
||||
@@ -1484,8 +1486,8 @@ test_build_update_descriptors(void *arg)
|
||||
|
||||
MOCK(get_or_state,
|
||||
get_or_state_replacement);
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
dummy_state = or_state_new();
|
||||
|
||||
@@ -1715,8 +1717,8 @@ test_build_descriptors(void *arg)
|
||||
|
||||
MOCK(get_or_state,
|
||||
get_or_state_replacement);
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
dummy_state = or_state_new();
|
||||
|
||||
@@ -1816,8 +1818,8 @@ test_upload_descriptors(void *arg)
|
||||
hs_init();
|
||||
MOCK(get_or_state,
|
||||
get_or_state_replacement);
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
dummy_state = or_state_new();
|
||||
|
||||
@@ -2553,8 +2555,8 @@ test_cannot_upload_descriptors(void *arg)
|
||||
hs_init();
|
||||
MOCK(get_or_state,
|
||||
get_or_state_replacement);
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
dummy_state = or_state_new();
|
||||
|
||||
@@ -2630,17 +2632,17 @@ test_cannot_upload_descriptors(void *arg)
|
||||
|
||||
/* 4. Testing missing live consensus. */
|
||||
{
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus_null);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus_null);
|
||||
setup_full_capture_of_logs(LOG_INFO);
|
||||
run_upload_descriptor_event(now);
|
||||
expect_log_msg_containing(
|
||||
"Service [scrubbed] can't upload its current descriptor: "
|
||||
"No live consensus");
|
||||
"No reasonably live consensus");
|
||||
teardown_capture_of_logs();
|
||||
/* Reset. */
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
/* 5. Test missing minimum directory information. */
|
||||
@@ -2679,7 +2681,7 @@ test_cannot_upload_descriptors(void *arg)
|
||||
done:
|
||||
hs_free_all();
|
||||
UNMOCK(count_desc_circuit_established);
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
UNMOCK(get_or_state);
|
||||
}
|
||||
|
||||
|
||||
@@ -167,6 +167,15 @@ mock_networkstatus_get_live_consensus(time_t now)
|
||||
return &mock_consensus;
|
||||
}
|
||||
|
||||
/* Mock function to immediately return our local 'mock_consensus'. */
|
||||
static networkstatus_t *
|
||||
mock_networkstatus_get_reasonably_live_consensus(time_t now, int flavor)
|
||||
{
|
||||
(void) now;
|
||||
(void) flavor;
|
||||
return &mock_consensus;
|
||||
}
|
||||
|
||||
static void
|
||||
test_get_state_valid_until_time(void *arg)
|
||||
{
|
||||
@@ -179,6 +188,8 @@ test_get_state_valid_until_time(void *arg)
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
retval = parse_rfc1123_time("Mon, 20 Apr 2015 01:00:00 UTC",
|
||||
&mock_consensus.fresh_until);
|
||||
@@ -235,7 +246,7 @@ test_get_state_valid_until_time(void *arg)
|
||||
}
|
||||
|
||||
done:
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
/** Test the function that calculates the start time of the current SRV
|
||||
@@ -251,6 +262,8 @@ test_get_start_time_of_current_run(void *arg)
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
retval = parse_rfc1123_time("Mon, 20 Apr 2015 01:00:00 UTC",
|
||||
&mock_consensus.fresh_until);
|
||||
@@ -335,6 +348,7 @@ test_get_start_time_of_current_run(void *arg)
|
||||
/* Next test is testing it without a consensus to use the testing voting
|
||||
* interval . */
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
/* Now let's alter the voting schedule and check the correctness of the
|
||||
* function. Voting interval of 10 seconds, means that an SRV protocol run
|
||||
@@ -366,8 +380,8 @@ test_get_start_time_functions(void *arg)
|
||||
(void) arg;
|
||||
int retval;
|
||||
|
||||
MOCK(networkstatus_get_live_consensus,
|
||||
mock_networkstatus_get_live_consensus);
|
||||
MOCK(networkstatus_get_reasonably_live_consensus,
|
||||
mock_networkstatus_get_reasonably_live_consensus);
|
||||
|
||||
retval = parse_rfc1123_time("Mon, 20 Apr 2015 01:00:00 UTC",
|
||||
&mock_consensus.fresh_until);
|
||||
@@ -388,7 +402,7 @@ test_get_start_time_functions(void *arg)
|
||||
start_time_of_protocol_run);
|
||||
|
||||
done:
|
||||
UNMOCK(networkstatus_get_live_consensus);
|
||||
UNMOCK(networkstatus_get_reasonably_live_consensus);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user