diff --git a/test/TEST-13-NSPAWN-SMOKE/test.sh b/test/TEST-13-NSPAWN-SMOKE/test.sh index 3d1e50447c..65c1e9be3d 100755 --- a/test/TEST-13-NSPAWN-SMOKE/test.sh +++ b/test/TEST-13-NSPAWN-SMOKE/test.sh @@ -17,7 +17,7 @@ test_append_files() { busybox="$(type -P busybox-static || type -P busybox)" inst_simple "$busybox" "$(dirname "$busybox")/busybox" - if selinuxenabled >/dev/null; then + if command -v selinuxenabled >/dev/null && selinuxenabled; then image_install selinuxenabled cp -ar /etc/selinux "$workspace/etc/selinux" fi diff --git a/test/units/testsuite-13.sh b/test/units/testsuite-13.sh index 487cc549f4..fb0b3cda16 100755 --- a/test/units/testsuite-13.sh +++ b/test/units/testsuite-13.sh @@ -112,7 +112,7 @@ EOF } function check_selinux { - if ! selinuxenabled; then + if ! command -v selinuxenabled >/dev/null || ! selinuxenabled; then echo >&2 "SELinux is not enabled, skipping SELinux-related tests" return 0 fi