Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bbd65ad

Browse files
author
Edward Thomson
committed
tests: skip the unreadable file tests as root
When running as root, skip the unreadable file tests, because, well, they're probably _not_ unreadable to root unless you've got some crazy NSA clearance-level honoring operating system shit going on.
1 parent 0e00eec commit bbd65ad

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/iterator/workdir.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,11 @@ void test_iterator_workdir__skips_unreadable_dirs(void)
673673
if (!cl_is_chmod_supported())
674674
return;
675675

676+
#ifndef GIT_WIN32
677+
if (geteuid() == 0)
678+
cl_skip();
679+
#endif
680+
676681
g_repo = cl_git_sandbox_init("empty_standard_repo");
677682

678683
cl_must_pass(p_mkdir("empty_standard_repo/r", 0777));

tests/status/worktree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,9 @@ void test_status_worktree__unreadable(void)
10481048
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
10491049
status_entry_counts counts = {0};
10501050

1051+
if (geteuid() == 0)
1052+
cl_skip();
1053+
10511054
/* Create directory with no read permission */
10521055
cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", 0777));
10531056
cl_git_mkfile("empty_standard_repo/no_permission/foo", "dummy");

0 commit comments

Comments
 (0)