aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_entrynodes.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2021-07-12 11:45:31 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2021-07-12 12:22:58 +0300
commit7f701794e7d8ce5cb4feb0b6fb1d4b00b68e5c5b (patch)
tree5560f9a1325cf33e5007cddca9857391e6955b2e /src/test/test_entrynodes.c
parent7ec9a68477d3c5b6937fa39445dc6b95415abb39 (diff)
downloadtor-7f701794e7d8ce5cb4feb0b6fb1d4b00b68e5c5b.tar.gz
tor-7f701794e7d8ce5cb4feb0b6fb1d4b00b68e5c5b.zip
Add a switch to toggle the feature on/off
Diffstat (limited to 'src/test/test_entrynodes.c')
-rw-r--r--src/test/test_entrynodes.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 4d353e8480..118b66dfa7 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -3099,7 +3099,22 @@ test_entry_guard_layer2_guards(void *arg)
(void) arg;
MOCK(router_have_minimum_dir_info, mock_router_have_minimum_dir_info);
- /* Create the guardset */
+ /* First check the enable/disable switch */
+ get_options_mutable()->VanguardsLiteEnabled = 0;
+ tt_int_op(vanguards_lite_is_enabled(), OP_EQ, 0);
+
+ get_options_mutable()->VanguardsLiteEnabled = 1;
+ tt_int_op(vanguards_lite_is_enabled(), OP_EQ, 1);
+
+ get_options_mutable()->VanguardsLiteEnabled = -1;
+ tt_int_op(vanguards_lite_is_enabled(), OP_EQ, 1);
+
+ /* OK now let's move to actual testing */
+
+ /* Remove restrictions to route around Big Fake Network restrictions */
+ get_options_mutable()->EnforceDistinctSubnets = 0;
+
+ /* Create the L2 guardset */
maintain_layer2_guards();
const routerset_t *l2_guards = get_layer2_guards();