tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 6d52b5ce910c31962e16b654426b923a43f38201
parent 233b96d83addba8d5db49e28f4d762cf34935afc
Author: teor <teor@torproject.org>
Date:   Thu, 31 Oct 2019 17:21:10 +1000

test/parseconf: Add conf_examples for PTs

Tests relay/transport_config.c.

Part of 32213.

Diffstat:
Asrc/test/conf_examples/pt_01/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_01/expected | 0
Asrc/test/conf_examples/pt_01/torrc | 7+++++++
Asrc/test/conf_examples/pt_02/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_02/expected | 0
Asrc/test/conf_examples/pt_02/torrc | 11+++++++++++
Asrc/test/conf_examples/pt_03/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_03/expected | 1+
Asrc/test/conf_examples/pt_03/torrc | 4++++
Asrc/test/conf_examples/pt_04/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_04/expected | 3+++
Asrc/test/conf_examples/pt_04/torrc | 6++++++
Asrc/test/conf_examples/pt_05/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_05/expected | 4++++
Asrc/test/conf_examples/pt_05/torrc | 6++++++
Asrc/test/conf_examples/pt_06/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_06/expected | 6++++++
Asrc/test/conf_examples/pt_06/torrc | 9+++++++++
Asrc/test/conf_examples/pt_07/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_07/expected | 4++++
Asrc/test/conf_examples/pt_07/torrc | 6++++++
Asrc/test/conf_examples/pt_08/error | 2++
Asrc/test/conf_examples/pt_08/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_08/torrc | 5+++++
Asrc/test/conf_examples/pt_09/error_no_dirauth_relay | 1+
Asrc/test/conf_examples/pt_09/expected | 0
Asrc/test/conf_examples/pt_09/torrc | 7+++++++
27 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/src/test/conf_examples/pt_01/error_no_dirauth_relay b/src/test/conf_examples/pt_01/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_01/expected b/src/test/conf_examples/pt_01/expected diff --git a/src/test/conf_examples/pt_01/torrc b/src/test/conf_examples/pt_01/torrc @@ -0,0 +1,7 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Empty linelist values are ignored with a warning +ExtORPort +ServerTransportPlugin +ServerTransportListenAddr +ServerTransportOptions diff --git a/src/test/conf_examples/pt_02/error_no_dirauth_relay b/src/test/conf_examples/pt_02/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_02/expected b/src/test/conf_examples/pt_02/expected diff --git a/src/test/conf_examples/pt_02/torrc b/src/test/conf_examples/pt_02/torrc @@ -0,0 +1,11 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Bad options are also ignored +ExtORPort illegal_hostname_chars$()^*%(%#%)#(%* +ServerTransportPlugin bad +ServerTransportPlugin bad2 exec +ServerTransportPlugin bad3 exec / +ServerTransportListenAddr bad +ServerTransportListenAddr bad2 illegal_hostname_chars$()^*%(%#%)#(%* +ServerTransportOptions bad +ServerTransportOptions bad2 not_kv diff --git a/src/test/conf_examples/pt_03/error_no_dirauth_relay b/src/test/conf_examples/pt_03/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_03/expected b/src/test/conf_examples/pt_03/expected @@ -0,0 +1 @@ +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_03/torrc b/src/test/conf_examples/pt_03/torrc @@ -0,0 +1,4 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Plugin, but no ExtORPort +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_04/error_no_dirauth_relay b/src/test/conf_examples/pt_04/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_04/expected b/src/test/conf_examples/pt_04/expected @@ -0,0 +1,3 @@ +ExtORPortCookieAuthFile / +ExtORPort 1 +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_04/torrc b/src/test/conf_examples/pt_04/torrc @@ -0,0 +1,6 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Try a bad cookie auth file +ExtORPort 1 +ExtORPortCookieAuthFile / +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_05/error_no_dirauth_relay b/src/test/conf_examples/pt_05/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_05/expected b/src/test/conf_examples/pt_05/expected @@ -0,0 +1,4 @@ +ExtORPort 1 +Nickname Unnamed +ORPort 2 +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_05/torrc b/src/test/conf_examples/pt_05/torrc @@ -0,0 +1,6 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Try a valid minimal config +ORPort 2 +ExtORPort 1 +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_06/error_no_dirauth_relay b/src/test/conf_examples/pt_06/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_06/expected b/src/test/conf_examples/pt_06/expected @@ -0,0 +1,6 @@ +ExtORPortCookieAuthFile / +ExtORPortCookieAuthFileGroupReadable 1 +ExtORPort 1 +ServerTransportListenAddr bad3 127.0.0.1:2 +ServerTransportOptions bad3 a=b +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_06/torrc b/src/test/conf_examples/pt_06/torrc @@ -0,0 +1,9 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Try a config with all the options +ExtORPort 1 +ExtORPortCookieAuthFile / +ExtORPortCookieAuthFileGroupReadable 1 +ServerTransportPlugin bad3 exec / +ServerTransportListenAddr bad3 127.0.0.1:2 +ServerTransportOptions bad3 a=b diff --git a/src/test/conf_examples/pt_07/error_no_dirauth_relay b/src/test/conf_examples/pt_07/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_07/expected b/src/test/conf_examples/pt_07/expected @@ -0,0 +1,4 @@ +ExtORPort 2.2.2.2:1 +Nickname Unnamed +ORPort 2 +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_07/torrc b/src/test/conf_examples/pt_07/torrc @@ -0,0 +1,6 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Try a valid config with a risky ExtORPort address +ORPort 2 +ExtORPort 2.2.2.2:1 +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_08/error b/src/test/conf_examples/pt_08/error @@ -0,0 +1 @@ +ExtORPort does not support unix sockets +\ No newline at end of file diff --git a/src/test/conf_examples/pt_08/error_no_dirauth_relay b/src/test/conf_examples/pt_08/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_08/torrc b/src/test/conf_examples/pt_08/torrc @@ -0,0 +1,5 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Try an invalid config with a unix socket for ExtORPort +ExtORPort unix:/ +ServerTransportPlugin bad3 exec / diff --git a/src/test/conf_examples/pt_09/error_no_dirauth_relay b/src/test/conf_examples/pt_09/error_no_dirauth_relay @@ -0,0 +1 @@ +This tor was built with relay mode disabled. diff --git a/src/test/conf_examples/pt_09/expected b/src/test/conf_examples/pt_09/expected diff --git a/src/test/conf_examples/pt_09/torrc b/src/test/conf_examples/pt_09/torrc @@ -0,0 +1,7 @@ +# Relay PT tests +# Options from relay/transport_config.c +# Try a valid minimal config, with a bad ServerTransportListenAddr +ORPort 2 +ExtORPort 1 +ServerTransportPlugin bad3 exec / +ServerTransportListenAddr bad3 [aaaa::bbbb:ccccc]