[tor-commits] [tor/master] Fix existing options_validate unit tests for ClientUseIPv4
nickm at torproject.org
nickm at torproject.org
Thu Feb 11 17:46:33 UTC 2016
commit 13db39b8563b42cdf47b1feb546d33217c30c824
Author: teor (Tim Wilson-Brown) <teor2345 at gmail.com>
Date: Fri Jan 29 08:13:11 2016 +1100
Fix existing options_validate unit tests for ClientUseIPv4
---
src/test/test_options.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/test/test_options.c b/src/test/test_options.c
index 275fee2..35f9f67 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -327,6 +327,7 @@ fixed_get_uname(void)
"V3AuthVoteDelay 20\n" \
"V3AuthDistDelay 20\n" \
"V3AuthNIntervalsValid 3\n" \
+ "ClientUseIPv4 1\n" \
"VirtualAddrNetworkIPv4 127.192.0.0/10\n" \
"VirtualAddrNetworkIPv6 [FE80::]/10\n" \
"SchedulerHighWaterMark__ 42\n" \
@@ -1698,6 +1699,10 @@ test_options_validate__reachable_addresses(void *ignored)
tt_str_op(tdata->opt->ReachableAddresses->value, OP_EQ, "*:82");
tor_free(msg);
+#define SERVERS_REACHABLE_MSG "Servers must be able to freely connect to" \
+ " the rest of the Internet, so they must not set Reachable*Addresses or" \
+ " FascistFirewall or FirewallPorts or ClientUseIPv4 0."
+
free_options_test_data(tdata);
tdata = get_options_test_data("ReachableAddresses *:82\n"
"ORListenAddress 127.0.0.1:5555\n"
@@ -1709,9 +1714,7 @@ test_options_validate__reachable_addresses(void *ignored)
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, "Servers must be able to freely connect to the rest of"
- " the Internet, so they must not set Reachable*Addresses or"
- " FascistFirewall.");
+ tt_str_op(msg, OP_EQ, SERVERS_REACHABLE_MSG);
tor_free(msg);
free_options_test_data(tdata);
@@ -1725,9 +1728,7 @@ test_options_validate__reachable_addresses(void *ignored)
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, "Servers must be able to freely connect to the rest of"
- " the Internet, so they must not set Reachable*Addresses or"
- " FascistFirewall.");
+ tt_str_op(msg, OP_EQ, SERVERS_REACHABLE_MSG);
tor_free(msg);
free_options_test_data(tdata);
@@ -1741,9 +1742,7 @@ test_options_validate__reachable_addresses(void *ignored)
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, "Servers must be able to freely connect to the rest of"
- " the Internet, so they must not set Reachable*Addresses or"
- " FascistFirewall.");
+ tt_str_op(msg, OP_EQ, SERVERS_REACHABLE_MSG);
tor_free(msg);
done:
@@ -1760,6 +1759,7 @@ test_options_validate__use_bridges(void *ignored)
char *msg;
options_test_data_t *tdata = get_options_test_data(
"UseBridges 1\n"
+ "ClientUseIPv4 1\n"
"ORListenAddress 127.0.0.1:5555\n"
"ORPort 955\n"
"MaxClientCircuitsPending 1\n"
More information about the tor-commits
mailing list