diff options
author | Jim Meyering <meyering@redhat.com> | 2009-08-26 10:06:53 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-08-26 10:06:53 +0200 |
commit | d6639ee63bc9321bc73ad453a266e45a89823a22 (patch) | |
tree | 50eea2cb0b99ff8450078dc958b594def74ff83b /tests/test-lib.sh | |
parent | be8531206b0554bdac6cfb8809c4a2dab56b5a52 (diff) | |
download | coreutils-d6639ee63bc9321bc73ad453a266e45a89823a22.tar.xz |
tests: mkdir/selinux: avoid spurious failure on some SELinux systems
* tests/test-lib.sh (require_selinux_enforcing_): New function.
* tests/mkdir/selinux: Use it.
Otherwise, this test would fail on Rawhide with SELinux disabled.
Diffstat (limited to 'tests/test-lib.sh')
-rw-r--r-- | tests/test-lib.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test-lib.sh b/tests/test-lib.sh index ad7a0e907..4419742ea 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -47,6 +47,14 @@ require_acl_() || skip_test_ "This test requires a local user named bin." } +# Skip this test if we're not in SELinux "enforcing" mode. +require_selinux_enforcing_() +{ + test "$(getenforce)" = Enforcing \ + || skip_test_ "This test is useful only with SELinux in Enforcing mode." +} + + require_openat_support_() { # Skip this test if your system has neither the openat-style functions |