diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-03 10:57:44 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-03 10:57:44 -0500 |
commit | b56ce79e6310d779762478410831a594a135c0bf (patch) | |
tree | 6ed4bdeed081bf39c67ffcc2f20fc5555379cdba /src/test | |
parent | 6b3c07648ce5860f5ef0f4193eb812e971c02407 (diff) | |
download | tor-b56ce79e6310d779762478410831a594a135c0bf.tar.gz tor-b56ce79e6310d779762478410831a594a135c0bf.zip |
In networkstatus_consensus_has_ipv6 test, use approx_time()
This may (or may not) fix up some reliability issues we've been
seeing with this test on windows.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_dir.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c index 6092a5a4d0..f2223ee176 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -6256,13 +6256,13 @@ test_dir_networkstatus_consensus_has_ipv6(void *arg) MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS; /* Reasonably live */ - mock_networkstatus->valid_until = time(NULL) - 60; + mock_networkstatus->valid_until = approx_time() - 60; has_ipv6 = networkstatus_consensus_has_ipv6(get_options()); tt_assert(has_ipv6); /* Not reasonably live */ - mock_networkstatus->valid_after = time(NULL) - 24*60*60 - 3600; - mock_networkstatus->valid_until = time(NULL) - 24*60*60 - 60; + mock_networkstatus->valid_after = approx_time() - 24*60*60 - 3600; + mock_networkstatus->valid_until = approx_time() - 24*60*60 - 60; has_ipv6 = networkstatus_consensus_has_ipv6(get_options()); tt_assert(!has_ipv6); @@ -6343,7 +6343,7 @@ struct testcase_t dir_tests[] = { DIR(assumed_flags, 0), DIR(networkstatus_compute_bw_weights_v10, 0), DIR(platform_str, 0), - DIR(networkstatus_consensus_has_ipv6, 0), + DIR(networkstatus_consensus_has_ipv6, TT_FORK), END_OF_TESTCASES }; |