1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 10:51:48 +02:00

tests: skip tests upon failure to set SELinux context

On some setups the root:object_r:tmp_t context is invalid.
This does indicate a limitation in the test framework,
but for now we'll relax this to skipping the tests.
The tests still run on a Fedora 25 system for example.

* tests/cp/cp-a-selinux.sh: Upon chcon error, skip rather than ERROR.
* tests/install/install-Z-selinux.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/runcon-no-reorder.sh: Likewise.
* tests/misc/selinux.sh: Likewise.
* tests/mkdir/restorecon.sh: Likewise.
This commit is contained in:
Pádraig Brady
2017-08-30 17:16:23 -07:00
parent 87a95504bb
commit 1e8c458210
6 changed files with 6 additions and 7 deletions

View File

@@ -24,7 +24,7 @@ require_selinux_
mkdir subdir || framework_failure_
ctx='root:object_r:tmp_t'
mls_enabled_ && ctx="$ctx:s0"
chcon "$ctx" subdir || framework_failure_
chcon "$ctx" subdir || skip "Failed to set context: $ctx"
cd subdir
# Since in a tmp_t dir, dirs can be created as user_tmp_t ...