[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] test/parseconf: Update config parsing tests for 32410
commit a0820bc00df38883555a6307f2e1fe3bdf32ef81
Author: teor <teor@xxxxxxxxxxxxxx>
Date: Thu Nov 7 11:44:51 2019 +1000
test/parseconf: Update config parsing tests for 32410
---
src/test/conf_examples/badnick_1/error_no_dirauth_relay | 1 -
src/test/conf_examples/badnick_1/expected_no_dirauth_relay | 1 +
src/test/conf_examples/badnick_1/torrc | 2 ++
src/test/conf_examples/badnick_2/error_no_dirauth_relay | 1 -
src/test/conf_examples/badnick_2/expected_no_dirauth_relay | 1 +
src/test/conf_examples/badnick_2/torrc | 2 ++
src/test/conf_examples/contactinfo_notutf8/error_no_dirauth_relay | 1 -
.../conf_examples/contactinfo_notutf8/expected_no_dirauth_relay | 1 +
src/test/conf_examples/contactinfo_notutf8/torrc | 4 ++++
src/test/conf_examples/example_1/error_no_dirauth_relay | 1 -
src/test/conf_examples/example_3/error_no_dirauth_relay | 1 -
src/test/conf_examples/pt_01/error_no_dirauth_relay | 1 -
src/test/conf_examples/pt_02/error_no_dirauth_relay | 1 -
src/test/conf_examples/pt_02/expected_no_dirauth_relay | 8 ++++++++
src/test/conf_examples/pt_02/torrc | 2 ++
src/test/conf_examples/pt_03/error_no_dirauth_relay | 1 -
src/test/conf_examples/pt_04/error_no_dirauth_relay | 1 -
src/test/conf_examples/pt_06/error_no_dirauth_relay | 1 -
src/test/conf_examples/pt_08/error_no_dirauth_relay | 1 -
src/test/conf_examples/pt_08/expected_no_dirauth_relay | 2 ++
src/test/conf_examples/pt_08/torrc | 2 ++
src/test/conf_examples/relay_01/error_no_dirauth_relay | 1 -
22 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/test/conf_examples/badnick_1/error_no_dirauth_relay b/src/test/conf_examples/badnick_1/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/badnick_1/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/badnick_1/expected_no_dirauth_relay b/src/test/conf_examples/badnick_1/expected_no_dirauth_relay
new file mode 100644
index 000000000..b00be15c2
--- /dev/null
+++ b/src/test/conf_examples/badnick_1/expected_no_dirauth_relay
@@ -0,0 +1 @@
+Nickname TooManyCharactersInThisNickname
diff --git a/src/test/conf_examples/badnick_1/torrc b/src/test/conf_examples/badnick_1/torrc
index 41ee4894f..087e3f2ff 100644
--- a/src/test/conf_examples/badnick_1/torrc
+++ b/src/test/conf_examples/badnick_1/torrc
@@ -1,2 +1,4 @@
# This nickname is too long; we won't accept it.
+# (Unless the relay module is disabled, because Nickname is a
+# relay-only option. We'll ignore all relay-only options in #32395.)
Nickname TooManyCharactersInThisNickname
diff --git a/src/test/conf_examples/badnick_2/error_no_dirauth_relay b/src/test/conf_examples/badnick_2/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/badnick_2/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/badnick_2/expected_no_dirauth_relay b/src/test/conf_examples/badnick_2/expected_no_dirauth_relay
new file mode 100644
index 000000000..08dcdc33a
--- /dev/null
+++ b/src/test/conf_examples/badnick_2/expected_no_dirauth_relay
@@ -0,0 +1 @@
+Nickname has a space
diff --git a/src/test/conf_examples/badnick_2/torrc b/src/test/conf_examples/badnick_2/torrc
index 07acc6169..51a5f96c0 100644
--- a/src/test/conf_examples/badnick_2/torrc
+++ b/src/test/conf_examples/badnick_2/torrc
@@ -1,2 +1,4 @@
# this nickname has spaces in it and won't work.
+# (Unless the relay module is disabled, because Nickname is a
+# relay-only option. We'll ignore all relay-only options in #32395.)
Nickname has a space
diff --git a/src/test/conf_examples/contactinfo_notutf8/error_no_dirauth_relay b/src/test/conf_examples/contactinfo_notutf8/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/contactinfo_notutf8/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/contactinfo_notutf8/expected_no_dirauth_relay b/src/test/conf_examples/contactinfo_notutf8/expected_no_dirauth_relay
new file mode 100644
index 000000000..cc8bd7b8e
--- /dev/null
+++ b/src/test/conf_examples/contactinfo_notutf8/expected_no_dirauth_relay
@@ -0,0 +1 @@
+ContactInfo "\304\353\304\353\304\353@xxxxxxxxxxx"
diff --git a/src/test/conf_examples/contactinfo_notutf8/torrc b/src/test/conf_examples/contactinfo_notutf8/torrc
index 2ee4d093c..0176a56a9 100644
--- a/src/test/conf_examples/contactinfo_notutf8/torrc
+++ b/src/test/conf_examples/contactinfo_notutf8/torrc
@@ -1 +1,5 @@
+# We only accept ContactInfo in UTF-8 (or 7-bit ASCII)
+# (Unless the relay module is disabled, because ContactInfo is a
+# relay-only option. We'll ignore all relay-only options in #32395.
+# But at the moment, tor canonicalises and quotes the string.)
ContactInfo ÄëÄëÄë@example.com
diff --git a/src/test/conf_examples/example_1/error_no_dirauth_relay b/src/test/conf_examples/example_1/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/example_1/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/example_3/error_no_dirauth_relay b/src/test/conf_examples/example_3/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/example_3/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/pt_01/error_no_dirauth_relay b/src/test/conf_examples/pt_01/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/pt_01/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/pt_02/error_no_dirauth_relay b/src/test/conf_examples/pt_02/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/pt_02/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/pt_02/expected_no_dirauth_relay b/src/test/conf_examples/pt_02/expected_no_dirauth_relay
new file mode 100644
index 000000000..f5cd26e6b
--- /dev/null
+++ b/src/test/conf_examples/pt_02/expected_no_dirauth_relay
@@ -0,0 +1,8 @@
+ExtORPort illegal_hostname_chars$()^*%(%
+ServerTransportListenAddr bad
+ServerTransportListenAddr bad2 illegal_hostname_chars$()^*%(%
+ServerTransportOptions bad
+ServerTransportOptions bad2 not_kv
+ServerTransportPlugin bad
+ServerTransportPlugin bad2 exec
+ServerTransportPlugin bad3 exec /
diff --git a/src/test/conf_examples/pt_02/torrc b/src/test/conf_examples/pt_02/torrc
index d047d615f..825f2c4be 100644
--- a/src/test/conf_examples/pt_02/torrc
+++ b/src/test/conf_examples/pt_02/torrc
@@ -1,6 +1,8 @@
# Relay PT tests
# Options from relay/transport_config.c
# Bad options are also ignored
+# (Unless the relay module is disabled, because they are relay-only
+# options. We'll ignore all relay-only options in #32395.)
ExtORPort illegal_hostname_chars$()^*%(%#%)#(%*
ServerTransportPlugin bad
ServerTransportPlugin bad2 exec
diff --git a/src/test/conf_examples/pt_03/error_no_dirauth_relay b/src/test/conf_examples/pt_03/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/pt_03/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/pt_04/error_no_dirauth_relay b/src/test/conf_examples/pt_04/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/pt_04/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/pt_06/error_no_dirauth_relay b/src/test/conf_examples/pt_06/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/pt_06/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/pt_08/error_no_dirauth_relay b/src/test/conf_examples/pt_08/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/pt_08/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
diff --git a/src/test/conf_examples/pt_08/expected_no_dirauth_relay b/src/test/conf_examples/pt_08/expected_no_dirauth_relay
new file mode 100644
index 000000000..9a1a9bd1e
--- /dev/null
+++ b/src/test/conf_examples/pt_08/expected_no_dirauth_relay
@@ -0,0 +1,2 @@
+ExtORPort unix:/
+ServerTransportPlugin bad3 exec /
diff --git a/src/test/conf_examples/pt_08/torrc b/src/test/conf_examples/pt_08/torrc
index bf36a185a..6f1d79d70 100644
--- a/src/test/conf_examples/pt_08/torrc
+++ b/src/test/conf_examples/pt_08/torrc
@@ -1,5 +1,7 @@
# Relay PT tests
# Options from relay/transport_config.c
# Try an invalid config with a unix socket for ExtORPort
+# (Unless the relay module is disabled, because they are relay-only
+# options. We'll ignore all relay-only options in #32395.)
ExtORPort unix:/
ServerTransportPlugin bad3 exec /
diff --git a/src/test/conf_examples/relay_01/error_no_dirauth_relay b/src/test/conf_examples/relay_01/error_no_dirauth_relay
deleted file mode 100644
index 9f9c0fd8f..000000000
--- a/src/test/conf_examples/relay_01/error_no_dirauth_relay
+++ /dev/null
@@ -1 +0,0 @@
-This tor was built with relay mode disabled.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits