Skip to content

Commit

Permalink
Don't expect permission failure if running as root
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tlyu committed Oct 4, 2017
1 parent 55e5446 commit 44e4a96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changes/bug23758
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
o Minor bugfixes (testing):
- Skip a test that would fail if run as root (because it expects a
permissions error). This affects some continuous integration setups.
Fixes bug 23758; bugfix on 0.3.2.2-alpha.
6 changes: 5 additions & 1 deletion src/test/test_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44e4a96

Please sign in to comment.