diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-11 14:50:06 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-09-14 19:00:41 -0400 |
commit | 7c7e8402b599515846cbb77ab4cbb5520f8463d8 (patch) | |
tree | d00a7d874775c4921a7bf3a3f2c9db357d048503 /src/test/conf_examples | |
parent | 41261c3b5cd505f5a601c319eb484866903814af (diff) | |
download | tor-7c7e8402b599515846cbb77ab4cbb5520f8463d8.tar.gz tor-7c7e8402b599515846cbb77ab4cbb5520f8463d8.zip |
Add a test script to try parsing and encoding Tor configurations
This script takes a set of example torrcs and command-lines from
src/test/conf_examples. If a success is expected, it runs "tor
--dump-config" and compares the result with the one we expect. If a
failure is expected, it runs "tor --verify-config" and greps for the
error we expect.
Diffstat (limited to 'src/test/conf_examples')
-rw-r--r-- | src/test/conf_examples/1/expected | 2 | ||||
-rw-r--r-- | src/test/conf_examples/1/torrc | 5 | ||||
-rw-r--r-- | src/test/conf_examples/2/error | 1 | ||||
-rw-r--r-- | src/test/conf_examples/2/torrc | 1 | ||||
-rw-r--r-- | src/test/conf_examples/3/cmdline | 1 | ||||
-rw-r--r-- | src/test/conf_examples/3/expected | 1 | ||||
-rw-r--r-- | src/test/conf_examples/3/torrc | 0 |
7 files changed, 11 insertions, 0 deletions
diff --git a/src/test/conf_examples/1/expected b/src/test/conf_examples/1/expected new file mode 100644 index 0000000000..9d6688a565 --- /dev/null +++ b/src/test/conf_examples/1/expected @@ -0,0 +1,2 @@ +ContactInfo tor_tellini@example.com +SocksPort 80 diff --git a/src/test/conf_examples/1/torrc b/src/test/conf_examples/1/torrc new file mode 100644 index 0000000000..bff7fa0aa2 --- /dev/null +++ b/src/test/conf_examples/1/torrc @@ -0,0 +1,5 @@ + +# Here is a simple example torrc. + SocksPort 80 + +ContactInfo "tor_tellini@example.com" diff --git a/src/test/conf_examples/2/error b/src/test/conf_examples/2/error new file mode 100644 index 0000000000..ce18b68db4 --- /dev/null +++ b/src/test/conf_examples/2/error @@ -0,0 +1 @@ +Unknown option 'JumpingJellyjars' diff --git a/src/test/conf_examples/2/torrc b/src/test/conf_examples/2/torrc new file mode 100644 index 0000000000..8ec8133b24 --- /dev/null +++ b/src/test/conf_examples/2/torrc @@ -0,0 +1 @@ +JumpingJellyjars 1 diff --git a/src/test/conf_examples/3/cmdline b/src/test/conf_examples/3/cmdline new file mode 100644 index 0000000000..5b2fadcebb --- /dev/null +++ b/src/test/conf_examples/3/cmdline @@ -0,0 +1 @@ +--socksport 99 diff --git a/src/test/conf_examples/3/expected b/src/test/conf_examples/3/expected new file mode 100644 index 0000000000..867fb8bcc8 --- /dev/null +++ b/src/test/conf_examples/3/expected @@ -0,0 +1 @@ +SocksPort 99 diff --git a/src/test/conf_examples/3/torrc b/src/test/conf_examples/3/torrc new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/test/conf_examples/3/torrc |