[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] test/parseconf: Add failure cases in conf_failures/



commit c7838c71fb3d023c8e255896118c59ed8af688eb
Author: teor <teor@xxxxxxxxxxxxxx>
Date:   Thu Nov 14 10:59:15 2019 +1000

    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(+)

diff --git a/src/test/conf_failures/README b/src/test/conf_failures/README
new file mode 100644
index 000000000..0da470eeb
--- /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 000000000..569a631e8
--- /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 000000000..e69de29bb
diff --git a/src/test/conf_failures/fail-error/error b/src/test/conf_failures/fail-error/error
new file mode 100644
index 000000000..4c0be9783
--- /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 000000000..bb6fe186a
--- /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 000000000..e69de29bb
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 000000000..bb6fe186a
--- /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 000000000..e69de29bb
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 000000000..bb6fe186a
--- /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 000000000..e69de29bb
diff --git a/src/test/conf_failures/fail-expected/expected b/src/test/conf_failures/fail-expected/expected
new file mode 100644
index 000000000..67be85f12
--- /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 000000000..e69de29bb



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits