4 TEST_DESCRIPTION
="SELinux tests"
10 # selinux-policy-targeted
11 # selinux-policy-devel
13 # Check if selinux-policy-devel is installed, and if it isn't bail out early instead of failing
14 test -f /usr
/share
/selinux
/devel
/include
/system
/systemd.
if ||
exit 0
16 # shellcheck source=test/test-functions
17 .
"${TEST_BASE_DIR:?}/test-functions"
20 KERNEL_APPEND
="${KERNEL_APPEND:=} selinux=1 security=selinux"
24 local workspace
="${1:?}"
25 local policy_headers_dir
=/usr
/share
/selinux
/devel
26 local modules_dir
=/var
/lib
/selinux
29 # Make sure we never expand this to "/..."
30 rm -rf "${workspace:?}/$modules_dir"
32 if ! cp -ar "$modules_dir" "$workspace/$modules_dir"; then
33 dfatal
"Failed to copy $modules_dir"
37 rm -rf "${workspace:?}/$policy_headers_dir"
38 inst_dir
/usr
/share
/selinux
40 if ! cp -ar "$policy_headers_dir" "$workspace/$policy_headers_dir"; then
41 dfatal
"Failed to copy $policy_headers_dir"
45 mkdir
"$workspace/systemd-test-module"
46 cp systemd_test.te
"$workspace/systemd-test-module"
47 cp systemd_test.
if "$workspace/systemd-test-module"
48 cp systemd_test.
fc "$workspace/systemd-test-module"
49 image_install
-o sesearch
51 image_install checkmodule semodule semodule_package
m4 make load_policy sefcontext_compile
52 image_install
-o /usr
/libexec
/selinux
/hll
/pp
# Fedora/RHEL/...
53 image_install
-o /usr
/lib
/selinux
/hll
/pp
# Debian/Ubuntu/...