From c7838c71fb3d023c8e255896118c59ed8af688eb Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 14 Nov 2019 10:59:15 +1000 Subject: [PATCH] test/parseconf: Add failure cases in conf_failures/ These failure cases can be used to test the failure behaviour and failure logs of test_parseconf.sh. See the README for details. Part of 32451. --- src/test/conf_failures/README | 5 +++++ src/test/conf_failures/fail-error-success/error | 1 + src/test/conf_failures/fail-error-success/torrc | 0 src/test/conf_failures/fail-error/error | 1 + src/test/conf_failures/fail-error/torrc | 1 + src/test/conf_failures/fail-expected-error/expected | 0 src/test/conf_failures/fail-expected-error/torrc | 1 + src/test/conf_failures/fail-expected-log/expected | 0 src/test/conf_failures/fail-expected-log/expected_log | 1 + src/test/conf_failures/fail-expected-log/torrc | 0 src/test/conf_failures/fail-expected/expected | 1 + src/test/conf_failures/fail-expected/torrc | 0 12 files changed, 11 insertions(+) create mode 100644 src/test/conf_failures/README create mode 100644 src/test/conf_failures/fail-error-success/error create mode 100644 src/test/conf_failures/fail-error-success/torrc create mode 100644 src/test/conf_failures/fail-error/error create mode 100644 src/test/conf_failures/fail-error/torrc create mode 100644 src/test/conf_failures/fail-expected-error/expected create mode 100644 src/test/conf_failures/fail-expected-error/torrc create mode 100644 src/test/conf_failures/fail-expected-log/expected create mode 100644 src/test/conf_failures/fail-expected-log/expected_log create mode 100644 src/test/conf_failures/fail-expected-log/torrc create mode 100644 src/test/conf_failures/fail-expected/expected create mode 100644 src/test/conf_failures/fail-expected/torrc diff --git a/src/test/conf_failures/README b/src/test/conf_failures/README new file mode 100644 index 0000000000..0da470eeb4 --- /dev/null +++ b/src/test/conf_failures/README @@ -0,0 +1,5 @@ +This directory contains typical test_parseconf.sh failure cases. + +If these directories are copied into conf_examples, test_parseconf.sh will +fail. Use these failure cases to make sure test_parseconf.sh handles failures +correctly, and produces useful output. diff --git a/src/test/conf_failures/fail-error-success/error b/src/test/conf_failures/fail-error-success/error new file mode 100644 index 0000000000..569a631e86 --- /dev/null +++ b/src/test/conf_failures/fail-error-success/error @@ -0,0 +1 @@ +Tor diff --git a/src/test/conf_failures/fail-error-success/torrc b/src/test/conf_failures/fail-error-success/torrc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/conf_failures/fail-error/error b/src/test/conf_failures/fail-error/error new file mode 100644 index 0000000000..4c0be97832 --- /dev/null +++ b/src/test/conf_failures/fail-error/error @@ -0,0 +1 @@ +no match diff --git a/src/test/conf_failures/fail-error/torrc b/src/test/conf_failures/fail-error/torrc new file mode 100644 index 0000000000..bb6fe186a4 --- /dev/null +++ b/src/test/conf_failures/fail-error/torrc @@ -0,0 +1 @@ +bad bad bad diff --git a/src/test/conf_failures/fail-expected-error/expected b/src/test/conf_failures/fail-expected-error/expected new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/conf_failures/fail-expected-error/torrc b/src/test/conf_failures/fail-expected-error/torrc new file mode 100644 index 0000000000..bb6fe186a4 --- /dev/null +++ b/src/test/conf_failures/fail-expected-error/torrc @@ -0,0 +1 @@ +bad bad bad diff --git a/src/test/conf_failures/fail-expected-log/expected b/src/test/conf_failures/fail-expected-log/expected new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/conf_failures/fail-expected-log/expected_log b/src/test/conf_failures/fail-expected-log/expected_log new file mode 100644 index 0000000000..bb6fe186a4 --- /dev/null +++ b/src/test/conf_failures/fail-expected-log/expected_log @@ -0,0 +1 @@ +bad bad bad diff --git a/src/test/conf_failures/fail-expected-log/torrc b/src/test/conf_failures/fail-expected-log/torrc new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/conf_failures/fail-expected/expected b/src/test/conf_failures/fail-expected/expected new file mode 100644 index 0000000000..67be85f127 --- /dev/null +++ b/src/test/conf_failures/fail-expected/expected @@ -0,0 +1 @@ +bad diff --git a/src/test/conf_failures/fail-expected/torrc b/src/test/conf_failures/fail-expected/torrc new file mode 100644 index 0000000000..e69de29bb2