[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Test no-consensus case for filter.



commit 9cad2628dd8c22d41f0e3c47bcd4c926e733f4c3
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Nov 23 15:32:48 2016 -0500

    Test no-consensus case for filter.
---
 src/test/test_entrynodes.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 785503b..de36142 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);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits