diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-09-05 12:29:24 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-09-11 09:42:19 -0400 |
commit | 5ffe6ec0e34fdddbc56d7699ce21c3a763f22198 (patch) | |
tree | 10d4b93ad4df72330c72da5eb7691950e61ec988 /src/test | |
parent | d545fe1992432004689c66372f1a61e7c3fb7899 (diff) | |
download | tor-5ffe6ec0e34fdddbc56d7699ce21c3a763f22198.tar.gz tor-5ffe6ec0e34fdddbc56d7699ce21c3a763f22198.zip |
Test: Make sure NOLIST options are not listed.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_config.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c index 58e05e5094..9b715b2ecf 100644 --- a/src/test/test_config.c +++ b/src/test/test_config.c @@ -5983,6 +5983,31 @@ test_config_kvline_parse(void *arg) tor_free(enc); } +static void +test_config_getinfo_config_names(void *arg) +{ + (void)arg; + char *answer = NULL; + const char *error = NULL; + int rv; + + rv = getinfo_helper_config(NULL, "config/names", &answer, &error); + tt_int_op(rv, OP_EQ, 0); + tt_ptr_op(error, OP_EQ, NULL); + + // ContactInfo should be listed. + tt_assert(strstr(answer, "\nContactInfo String\n")); + + // V1AuthoritativeDirectory should not be listed, since it is obsolete. + tt_assert(! strstr(answer, "V1AuthoritativeDirectory")); + + // ___UsingTestNetworkDefaults should not be listed, since it is invisible. + tt_assert(! strstr(answer, "UsingTestNetworkDefaults")); + + done: + tor_free(answer); +} + #define CONFIG_TEST(name, flags) \ { #name, test_config_ ## name, flags, NULL, NULL } @@ -6035,5 +6060,6 @@ struct testcase_t config_tests[] = { CONFIG_TEST(compute_max_mem_in_queues, 0), CONFIG_TEST(extended_fmt, 0), CONFIG_TEST(kvline_parse, 0), + CONFIG_TEST(getinfo_config_names, 0), END_OF_TESTCASES }; |