From 4f6025498dde54761967d00801616f33cf69f71c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 23 Mar 2017 10:44:43 +0100 Subject: [PATCH 1/2] Use update_approx_time() to run a test 100 days in the past. Fixes bug21799. --- changes/bug21799 | 6 ++++++ src/test/test_entrynodes.c | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 changes/bug21799 diff --git a/changes/bug21799 b/changes/bug21799 new file mode 100644 index 000000000..ee2e904a3 --- /dev/null +++ b/changes/bug21799 @@ -0,0 +1,6 @@ + o Minor bugfixes (tests): + - Run the entry_guard_parse_from_state_full test with the time set + to a specific date. (The guard state that this test was parsing + contained guards that had expired since the test was first + written.) Fixes bug 21799; bugfix on 0.3.0.1-alpha. + diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index 249fd1f97..602aee9af 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -584,6 +584,9 @@ test_entry_guard_parse_from_state_full(void *arg) smartlist_t *text = smartlist_new(); char *joined = NULL; + // So nodes aren't expired + update_approx_time(1481621834); + MOCK(entry_guard_is_listed, mock_entry_guard_is_listed); dummy_state = state; From a5130de43297373ec93c3623689e42cc1384b3f9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 26 Mar 2017 12:30:00 +0200 Subject: [PATCH 2/2] Tweak test_entrynodes comment --- src/test/test_entrynodes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index 602aee9af..95c8f6c33 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -584,7 +584,7 @@ test_entry_guard_parse_from_state_full(void *arg) smartlist_t *text = smartlist_new(); char *joined = NULL; - // So nodes aren't expired + // So nodes aren't expired. This is Tue, 13 Dec 2016 09:37:14 GMT update_approx_time(1481621834); MOCK(entry_guard_is_listed, mock_entry_guard_is_listed);