From 83fa962c1af086a72c0a0ef1a9df12032e9a73ac Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 23 Sep 2019 12:29:25 +1000 Subject: [PATCH] test: a file with no config options, at the end of an %include directory (The file must contain whitespace or comments to trigger the bug.) Regression test for 31408. --- src/test/conf_examples/include_bug_31408/expected | 2 ++ .../conf_examples/include_bug_31408/included/01_nickname.inc | 1 + .../conf_examples/include_bug_31408/included/02_no_configs.inc | 3 +++ src/test/conf_examples/include_bug_31408/torrc | 2 ++ 4 files changed, 8 insertions(+) create mode 100644 src/test/conf_examples/include_bug_31408/expected create mode 100644 src/test/conf_examples/include_bug_31408/included/01_nickname.inc create mode 100644 src/test/conf_examples/include_bug_31408/included/02_no_configs.inc create mode 100644 src/test/conf_examples/include_bug_31408/torrc diff --git a/src/test/conf_examples/include_bug_31408/expected b/src/test/conf_examples/include_bug_31408/expected new file mode 100644 index 0000000000..2e822f1a78 --- /dev/null +++ b/src/test/conf_examples/include_bug_31408/expected @@ -0,0 +1,2 @@ +Nickname test31408 +ORPort 31408 diff --git a/src/test/conf_examples/include_bug_31408/included/01_nickname.inc b/src/test/conf_examples/include_bug_31408/included/01_nickname.inc new file mode 100644 index 0000000000..508dd89a35 --- /dev/null +++ b/src/test/conf_examples/include_bug_31408/included/01_nickname.inc @@ -0,0 +1 @@ +Nickname test31408 diff --git a/src/test/conf_examples/include_bug_31408/included/02_no_configs.inc b/src/test/conf_examples/include_bug_31408/included/02_no_configs.inc new file mode 100644 index 0000000000..140e927f19 --- /dev/null +++ b/src/test/conf_examples/include_bug_31408/included/02_no_configs.inc @@ -0,0 +1,3 @@ +# Bug 31048 is triggered when the last file in a config directory: +# * contains no configuration options, +# * but is non-empty: that is, it contains comments or whitespace. diff --git a/src/test/conf_examples/include_bug_31408/torrc b/src/test/conf_examples/include_bug_31408/torrc new file mode 100644 index 0000000000..a42685e93c --- /dev/null +++ b/src/test/conf_examples/include_bug_31408/torrc @@ -0,0 +1,2 @@ +%include "included" +ORPort 31408