From: Frantisek Sumsal Date: Fri, 2 Sep 2022 17:39:30 +0000 (+0200) Subject: test: suppress not-found errors for `selinuxenabled` X-Git-Tag: v252-rc1~266^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=729292d9ddc2ac390749af5deb232c5e749aef6f;p=thirdparty%2Fsystemd.git test: suppress not-found errors for `selinuxenabled` if the binary is not available. --- diff --git a/test/TEST-13-NSPAWN-SMOKE/test.sh b/test/TEST-13-NSPAWN-SMOKE/test.sh index 3d1e50447c7..65c1e9be3d2 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 487cc549f4d..fb0b3cda167 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