From 850a00dc07d33c6bd9af660281b4fd1baa6a0a6f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 12 Sep 2019 16:42:03 -0400 Subject: Add test for +Option, /Option, and Option Here we use these directives to replace, extend, or clear values in torrc.defaults and in torrc. --- src/test/conf_examples/ops_1/cmdline | 1 + src/test/conf_examples/ops_1/expected | 2 ++ src/test/conf_examples/ops_1/torrc | 3 +++ src/test/conf_examples/ops_2/cmdline | 1 + src/test/conf_examples/ops_2/expected | 0 src/test/conf_examples/ops_2/torrc | 3 +++ src/test/conf_examples/ops_3/cmdline | 1 + src/test/conf_examples/ops_3/expected | 3 +++ src/test/conf_examples/ops_3/torrc | 3 +++ src/test/conf_examples/ops_4/expected | 2 ++ src/test/conf_examples/ops_4/torrc | 3 +++ src/test/conf_examples/ops_4/torrc.defaults | 1 + src/test/conf_examples/ops_5/expected | 3 +++ src/test/conf_examples/ops_5/torrc | 3 +++ src/test/conf_examples/ops_5/torrc.defaults | 1 + src/test/conf_examples/ops_6/expected | 0 src/test/conf_examples/ops_6/torrc | 3 +++ src/test/conf_examples/ops_6/torrc.defaults | 1 + 18 files changed, 34 insertions(+) create mode 100644 src/test/conf_examples/ops_1/cmdline create mode 100644 src/test/conf_examples/ops_1/expected create mode 100644 src/test/conf_examples/ops_1/torrc create mode 100644 src/test/conf_examples/ops_2/cmdline create mode 100644 src/test/conf_examples/ops_2/expected create mode 100644 src/test/conf_examples/ops_2/torrc create mode 100644 src/test/conf_examples/ops_3/cmdline create mode 100644 src/test/conf_examples/ops_3/expected create mode 100644 src/test/conf_examples/ops_3/torrc create mode 100644 src/test/conf_examples/ops_4/expected create mode 100644 src/test/conf_examples/ops_4/torrc create mode 100644 src/test/conf_examples/ops_4/torrc.defaults create mode 100644 src/test/conf_examples/ops_5/expected create mode 100644 src/test/conf_examples/ops_5/torrc create mode 100644 src/test/conf_examples/ops_5/torrc.defaults create mode 100644 src/test/conf_examples/ops_6/expected create mode 100644 src/test/conf_examples/ops_6/torrc create mode 100644 src/test/conf_examples/ops_6/torrc.defaults diff --git a/src/test/conf_examples/ops_1/cmdline b/src/test/conf_examples/ops_1/cmdline new file mode 100644 index 0000000000..2bb9bfa132 --- /dev/null +++ b/src/test/conf_examples/ops_1/cmdline @@ -0,0 +1 @@ +ORPort 1000 diff --git a/src/test/conf_examples/ops_1/expected b/src/test/conf_examples/ops_1/expected new file mode 100644 index 0000000000..84be6a70e2 --- /dev/null +++ b/src/test/conf_examples/ops_1/expected @@ -0,0 +1,2 @@ +Nickname Unnamed +ORPort 1000 diff --git a/src/test/conf_examples/ops_1/torrc b/src/test/conf_examples/ops_1/torrc new file mode 100644 index 0000000000..daf8ae60fe --- /dev/null +++ b/src/test/conf_examples/ops_1/torrc @@ -0,0 +1,3 @@ +# We'll replace this option on the command line. + +ORPort 9999 diff --git a/src/test/conf_examples/ops_2/cmdline b/src/test/conf_examples/ops_2/cmdline new file mode 100644 index 0000000000..fdd48a045c --- /dev/null +++ b/src/test/conf_examples/ops_2/cmdline @@ -0,0 +1 @@ +/ORPort diff --git a/src/test/conf_examples/ops_2/expected b/src/test/conf_examples/ops_2/expected new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/conf_examples/ops_2/torrc b/src/test/conf_examples/ops_2/torrc new file mode 100644 index 0000000000..21fcc93f9a --- /dev/null +++ b/src/test/conf_examples/ops_2/torrc @@ -0,0 +1,3 @@ +# We'll remove this option on the command line, and not replace it. + +ORPort 9999 diff --git a/src/test/conf_examples/ops_3/cmdline b/src/test/conf_examples/ops_3/cmdline new file mode 100644 index 0000000000..e4965d26f8 --- /dev/null +++ b/src/test/conf_examples/ops_3/cmdline @@ -0,0 +1 @@ ++ORPort 1000 diff --git a/src/test/conf_examples/ops_3/expected b/src/test/conf_examples/ops_3/expected new file mode 100644 index 0000000000..569d26b577 --- /dev/null +++ b/src/test/conf_examples/ops_3/expected @@ -0,0 +1,3 @@ +Nickname Unnamed +ORPort 9999 +ORPort 1000 diff --git a/src/test/conf_examples/ops_3/torrc b/src/test/conf_examples/ops_3/torrc new file mode 100644 index 0000000000..14adf87d7f --- /dev/null +++ b/src/test/conf_examples/ops_3/torrc @@ -0,0 +1,3 @@ +# We will extend this option on the command line + +ORPort 9999 diff --git a/src/test/conf_examples/ops_4/expected b/src/test/conf_examples/ops_4/expected new file mode 100644 index 0000000000..bf52f6a330 --- /dev/null +++ b/src/test/conf_examples/ops_4/expected @@ -0,0 +1,2 @@ +Nickname Unnamed +ORPort 9099 diff --git a/src/test/conf_examples/ops_4/torrc b/src/test/conf_examples/ops_4/torrc new file mode 100644 index 0000000000..dcec2aa95d --- /dev/null +++ b/src/test/conf_examples/ops_4/torrc @@ -0,0 +1,3 @@ +# This value is unadorned, so replaces the one from defaults.torrc. + +ORPort 9099 diff --git a/src/test/conf_examples/ops_4/torrc.defaults b/src/test/conf_examples/ops_4/torrc.defaults new file mode 100644 index 0000000000..04cd0393c6 --- /dev/null +++ b/src/test/conf_examples/ops_4/torrc.defaults @@ -0,0 +1 @@ +ORPort 9000 diff --git a/src/test/conf_examples/ops_5/expected b/src/test/conf_examples/ops_5/expected new file mode 100644 index 0000000000..288721da53 --- /dev/null +++ b/src/test/conf_examples/ops_5/expected @@ -0,0 +1,3 @@ +Nickname Unnamed +ORPort 9000 +ORPort 9099 diff --git a/src/test/conf_examples/ops_5/torrc b/src/test/conf_examples/ops_5/torrc new file mode 100644 index 0000000000..3284fc1c55 --- /dev/null +++ b/src/test/conf_examples/ops_5/torrc @@ -0,0 +1,3 @@ +# This value has a plus, and so extends the one from defaults.torrc. + ++ORPort 9099 diff --git a/src/test/conf_examples/ops_5/torrc.defaults b/src/test/conf_examples/ops_5/torrc.defaults new file mode 100644 index 0000000000..04cd0393c6 --- /dev/null +++ b/src/test/conf_examples/ops_5/torrc.defaults @@ -0,0 +1 @@ +ORPort 9000 diff --git a/src/test/conf_examples/ops_6/expected b/src/test/conf_examples/ops_6/expected new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/conf_examples/ops_6/torrc b/src/test/conf_examples/ops_6/torrc new file mode 100644 index 0000000000..4d51caaff7 --- /dev/null +++ b/src/test/conf_examples/ops_6/torrc @@ -0,0 +1,3 @@ +# This value has a slash, and so clears the one from defaults.torrc. + +/ORPort diff --git a/src/test/conf_examples/ops_6/torrc.defaults b/src/test/conf_examples/ops_6/torrc.defaults new file mode 100644 index 0000000000..04cd0393c6 --- /dev/null +++ b/src/test/conf_examples/ops_6/torrc.defaults @@ -0,0 +1 @@ +ORPort 9000 -- cgit v1.2.3-54-g00ecf