aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-23 10:04:23 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-16 11:06:15 -0500
commitac67819396ac9e96c3dd65a5b5b23715e11eeec5 (patch)
tree5a3611b18c2c093e6c054a369e219c6dbb8816f0 /src/test
parentf71be7434074a1b7f8508b96cbf55cee44afb993 (diff)
downloadtor-ac67819396ac9e96c3dd65a5b5b23715e11eeec5.tar.gz
tor-ac67819396ac9e96c3dd65a5b5b23715e11eeec5.zip
Make sure primary-guards are up-to-date when we inspect them.
(Plus some magic to prevent and detect recursive invocation of entry_guards_update_primary(), since that can cause some pretty tricky misbehavior.)
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_entrynodes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index d8b9ccb7e6..cdf8672f11 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -1839,6 +1839,7 @@ test_entry_guard_sample_reachable_filtered(void *arg)
g->pb.path_bias_disabled = 1;
entry_guards_update_filtered_sets(gs);
+ gs->primary_guards_up_to_date = 1;
tt_int_op(num_reachable_filtered_guards(gs), OP_EQ, n_guards - 1);
tt_int_op(smartlist_len(gs->sampled_entry_guards), OP_EQ, n_guards);
@@ -1851,7 +1852,7 @@ test_entry_guard_sample_reachable_filtered(void *arg)
} tests[] = {
{ 0, -1 },
{ SAMPLE_EXCLUDE_CONFIRMED, 1 },
- { SAMPLE_EXCLUDE_PRIMARY, 2 },
+ { SAMPLE_EXCLUDE_PRIMARY|SAMPLE_NO_UPDATE_PRIMARY, 2 },
{ SAMPLE_EXCLUDE_PENDING, 0 },
{ -1, -1},
};