diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-23 15:32:48 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:06:16 -0500 |
commit | 9cad2628dd8c22d41f0e3c47bcd4c926e733f4c3 (patch) | |
tree | 55d337b8dafcc1e298be79f82e995a000610a3c9 /src/test | |
parent | a7bc73935b030100b0d7b9f39c5dec5ef6eb0a85 (diff) | |
download | tor-9cad2628dd8c22d41f0e3c47bcd4c926e733f4c3.tar.gz tor-9cad2628dd8c22d41f0e3c47bcd4c926e733f4c3.zip |
Test no-consensus case for filter.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_entrynodes.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c index 785503bd26..de36142d9a 100644 --- a/src/test/test_entrynodes.c +++ b/src/test/test_entrynodes.c @@ -1391,6 +1391,20 @@ test_entry_guard_node_filter(void *arg) } tt_int_op(num_reachable_filtered_guards(gs), OP_EQ, 1); + /* Now make sure we have no live consensus, and no nodes. Nothing should + * pass the filter any more. */ + tor_free(dummy_consensus); + dummy_consensus = NULL; + SMARTLIST_FOREACH(big_fake_net_nodes, node_t *, node, { + memset(node->identity, 0xff, 20); + }); + entry_guards_update_filtered_sets(gs); + for (i = 0; i < NUM; ++i) { + tt_assert(g[i]->is_filtered_guard == 0); + tt_assert(g[i]->is_usable_filtered_guard == 0); + } + tt_int_op(num_reachable_filtered_guards(gs), OP_EQ, 0); + done: guard_selection_free(gs); tor_free(bl); |