test: suppress not-found errors for selinuxenabled

if the binary is not available.
This commit is contained in:
Frantisek Sumsal 2022-09-02 19:39:30 +02:00
parent d1f6c3857e
commit 729292d9dd
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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