diff options
author | Neel Chauhan <neel@neelc.org> | 2017-01-12 09:35:27 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-14 14:55:23 -0500 |
commit | 9e5512b48d072e3fd21f1f1884f706c5330e0935 (patch) | |
tree | c94b4acfa64054348219b6696b1a944fb89c8d5c /src/test/test_options.c | |
parent | c4d06c267879c6d23f1cdf0d0ca19167cb677ed5 (diff) | |
download | tor-9e5512b48d072e3fd21f1f1884f706c5330e0935.tar.gz tor-9e5512b48d072e3fd21f1f1884f706c5330e0935.zip |
Disallow setting UseBridges to 1 and UseEntryGuards to 0
Diffstat (limited to 'src/test/test_options.c')
-rw-r--r-- | src/test/test_options.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/test/test_options.c b/src/test/test_options.c index ce5e1ed62c..41c015bdd4 100644 --- a/src/test/test_options.c +++ b/src/test/test_options.c @@ -333,7 +333,8 @@ fixed_get_uname(void) "VirtualAddrNetworkIPv4 127.192.0.0/10\n" \ "VirtualAddrNetworkIPv6 [FE80::]/10\n" \ "SchedulerHighWaterMark__ 42\n" \ - "SchedulerLowWaterMark__ 10\n" + "SchedulerLowWaterMark__ 10\n" \ + "UseEntryGuards 1\n" typedef struct { or_options_t *old_opt; @@ -1938,6 +1939,19 @@ test_options_validate__use_bridges(void *ignored) tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES "UseBridges 1\n" "Bridge 10.0.0.1\n" + "UseEntryGuards 0\n" + ); + + ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg); + tt_int_op(ret, OP_EQ, -1); + tt_str_op(msg, OP_EQ, + "Setting UseBridges requires also setting UseEntryGuards."); + tor_free(msg); + + free_options_test_data(tdata); + tdata = get_options_test_data(TEST_OPTIONS_DEFAULT_VALUES + "UseBridges 1\n" + "Bridge 10.0.0.1\n" "Bridge !!!\n" ); |