mirror of
https://github.com/systemd/systemd.git
synced 2025-02-25 21:57:32 +03:00
test: Check that SELinux policy is available before running SELinux test (#28868)
* test: Check that SELinux policy is available before running SELinux test --------- Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
This commit is contained in:
parent
f1a621b09b
commit
5f22d16bb3
@ -7,11 +7,16 @@ IMAGE_NAME="selinux"
|
||||
TEST_NO_NSPAWN=1
|
||||
|
||||
# Requirements:
|
||||
# selinux-policy-targeted
|
||||
# A selinux policy is installed. Preferably selinux-policy-targeted, but it could work with others
|
||||
# selinux-policy-devel
|
||||
|
||||
# Check if selinux-policy-devel is installed, and if it isn't bail out early instead of failing
|
||||
test -f /usr/share/selinux/devel/include/system/systemd.if || exit 0
|
||||
# Check if
|
||||
# - selinux-policy-devel is installed and
|
||||
# - some selinux policy is installed. To keep this generic just check for the
|
||||
# existence of a directory below /etc/selinux/, indicating a SELinux policy is
|
||||
# installed
|
||||
# otherwise bail out early instead of failing
|
||||
test -f /usr/share/selinux/devel/include/system/systemd.if && find /etc/selinux -mindepth 1 -maxdepth 1 -not -empty -type d | grep -q . || exit 0
|
||||
|
||||
# shellcheck source=test/test-functions
|
||||
. "${TEST_BASE_DIR:?}/test-functions"
|
||||
|
Loading…
x
Reference in New Issue
Block a user