test: add a custom SELinux file context

Since the test suite overhaul, the test units are now under
/usr/lib/systemd/tests/testdata/tetsuite-06.units with
system_u:object_r:lib_t context. This causes an AVC denial, since the
systemd unit files are expected to have the
system_u:object_r:systemd_unit_file_t context. Let's fix this by using a
custom file context definition.
This commit is contained in:
Frantisek Sumsal 2021-02-05 16:59:38 +01:00
parent cd2d8fea14
commit 01da74243d
2 changed files with 2 additions and 0 deletions

View file

@ -0,0 +1 @@
/usr/lib/systemd/tests/testdata/testsuite-06\.units(/.*)? system_u:object_r:systemd_unit_file_t:s0

View file

@ -37,6 +37,7 @@ test_append_files() {
mkdir $1/systemd-test-module
cp systemd_test.te $1/systemd-test-module
cp systemd_test.if $1/systemd-test-module
cp systemd_test.fc $1/systemd-test-module
dracut_install -o sesearch
dracut_install runcon
dracut_install checkmodule semodule semodule_package m4 make load_policy sefcontext_compile