1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

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