aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_config.c
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2017-10-04 08:42:05 -0500
committerTaylor Yu <catalyst@torproject.org>2017-10-04 08:42:05 -0500
commit44e4a96bb5d2a01d57084ec8beb14e4518644614 (patch)
tree760a1a6ddec8ab00b395cdaaa51631fd86f7701d /src/test/test_config.c
parent55e5446f8dfdb8606310041567c06ccaf9c0d80a (diff)
downloadtor-44e4a96bb5d2a01d57084ec8beb14e4518644614.tar.gz
tor-44e4a96bb5d2a01d57084ec8beb14e4518644614.zip
Don't expect permission failure if running as root
Skip test_config_include_no_permission() when running as root, because it will get an unexpected success from config_get_lines_include(). This affects some continuous integration setups. Fixes bug 23758.
Diffstat (limited to 'src/test/test_config.c')
-rw-r--r--src/test/test_config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/test_config.c b/src/test/test_config.c
index e9cdf9ddb1..b035070a10 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -4957,7 +4957,11 @@ test_config_include_no_permission(void *data)
config_line_t *result = NULL;
char *folder_path = NULL;
- char *dir = tor_strdup(get_fname("test_include_forbidden_folder"));
+ char *dir = NULL;
+ if (geteuid() == 0)
+ tt_skip();
+
+ dir = tor_strdup(get_fname("test_include_forbidden_folder"));
tt_ptr_op(dir, OP_NE, NULL);
tt_int_op(mkdir(dir, 0700), OP_EQ, 0);