diff options
author | David Goulet <dgoulet@torproject.org> | 2018-09-24 09:48:28 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-16 08:03:55 -0400 |
commit | 38599de2dd4d7bc4e8e8e888ff3731c1ffac7255 (patch) | |
tree | 920dd19371cc4ab39e506bb78b3f1229fad1d2d9 /src/test/test_hs_service.c | |
parent | 633e99575ff5576ea01cc03c085b22776972bcc3 (diff) | |
download | tor-38599de2dd4d7bc4e8e8e888ff3731c1ffac7255.tar.gz tor-38599de2dd4d7bc4e8e8e888ff3731c1ffac7255.zip |
test: Update approx_time before the test starts
This way we have the same time source when the IP is created and tested later.
Fixes #27810
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_hs_service.c')
-rw-r--r-- | src/test/test_hs_service.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c index d715f90d97..7972434d69 100644 --- a/src/test/test_hs_service.c +++ b/src/test/test_hs_service.c @@ -492,6 +492,8 @@ test_helper_functions(void *arg) MOCK(node_get_by_id, mock_node_get_by_id); hs_service_init(); + time_t now = time(NULL); + update_approx_time(now); service = helper_create_service(); @@ -551,7 +553,6 @@ test_helper_functions(void *arg) /* Testing can_service_launch_intro_circuit() */ { - time_t now = time(NULL); /* Put the start of the retry period back in time, we should be allowed. * to launch intro circuit. */ service->state.num_intro_circ_launched = 2; @@ -575,7 +576,6 @@ test_helper_functions(void *arg) /* Testing intro_point_should_expire(). */ { - time_t now = time(NULL); /* Just some basic test of the current state. */ tt_u64_op(ip->introduce2_max, OP_GE, INTRO_POINT_MIN_LIFETIME_INTRODUCTIONS); |