aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_hs_common.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-17 16:19:32 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-17 16:19:32 -0400
commite2b744ce38edb8901cff3288634c4ebb5b4568b9 (patch)
tree9af8bf64a8ed5412ea7b55bd08f3e390867ce770 /src/test/test_hs_common.c
parent12afdcc15a8429bcc50d9287321849b6fa924c2f (diff)
parent14b507e5207ce7e581c5fc773921f8cf65d08247 (diff)
downloadtor-e2b744ce38edb8901cff3288634c4ebb5b4568b9.tar.gz
tor-e2b744ce38edb8901cff3288634c4ebb5b4568b9.zip
Merge branch 'bug25552_ope_squashed'
Diffstat (limited to 'src/test/test_hs_common.c')
-rw-r--r--src/test/test_hs_common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c
index f17cc8aeb3..c1001ee5c4 100644
--- a/src/test/test_hs_common.c
+++ b/src/test/test_hs_common.c
@@ -1344,6 +1344,10 @@ run_reachability_scenario(const reachability_cfg_t *cfg, int num_scenario)
&mock_service_ns->fresh_until);
voting_schedule_recalculate_timing(get_options(),
mock_service_ns->valid_after);
+ /* Check that service is in the right time period point */
+ tt_int_op(hs_in_period_between_tp_and_srv(mock_service_ns, 0), OP_EQ,
+ cfg->service_in_new_tp);
+
/* Set client consensus time. */
set_consensus_times(cfg->client_valid_after,
&mock_client_ns->valid_after);
@@ -1353,10 +1357,7 @@ run_reachability_scenario(const reachability_cfg_t *cfg, int num_scenario)
&mock_client_ns->fresh_until);
voting_schedule_recalculate_timing(get_options(),
mock_client_ns->valid_after);
-
- /* New time period checks for this scenario. */
- tt_int_op(hs_in_period_between_tp_and_srv(mock_service_ns, 0), OP_EQ,
- cfg->service_in_new_tp);
+ /* Check that client is in the right time period point */
tt_int_op(hs_in_period_between_tp_and_srv(mock_client_ns, 0), OP_EQ,
cfg->client_in_new_tp);
@@ -1367,7 +1368,8 @@ run_reachability_scenario(const reachability_cfg_t *cfg, int num_scenario)
mock_service_ns->sr_info.previous_srv = cfg->service_previous_srv;
/* Initialize a service to get keys. */
- service = helper_init_service(time(NULL));
+ update_approx_time(mock_service_ns->valid_after);
+ service = helper_init_service(mock_service_ns->valid_after+1);
/*
* === Client setup ===