Skip to content
Snippets Groups Projects
Commit f2168d28 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Fake the current time when we're loading TEST_DESCRIPTORS.

Fixes bug 40187; bugfix on 0.4.5.1-alpha.
parent 7d8290f0
No related branches found
No related tags found
1 merge request!202Fake the current time when we're loading TEST_DESCRIPTORS.
o Minor bugfixes (testing):
- Fix unit tests that used newly generated list of routers so that they
check them with respect to the date when they were generated, not
with respect to the current time. Fixes bug 40187; bugfix on
0.4.5.1-alpha.
......@@ -113,12 +113,17 @@ helper_setup_fake_routerlist(void)
MOCK(router_descriptor_is_older_than,
router_descriptor_is_older_than_replacement);
// Pick a time when these descriptors' certificates were valid.
update_approx_time(1603981036);
/* Load all the test descriptors to the routerlist. */
retval = router_load_routers_from_string(TEST_DESCRIPTORS,
NULL, SAVED_IN_JOURNAL,
NULL, 0, NULL);
tt_int_op(retval, OP_EQ, HELPER_NUMBER_OF_DESCRIPTORS);
update_approx_time(0); // this restores the regular approx_time behavior
/* Sanity checking of routerlist and nodelist. */
our_routerlist = router_get_routerlist();
tt_int_op(smartlist_len(our_routerlist->routers), OP_EQ,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment