selinux-policy: do not test watch in systemd-timesyncd on RHEL < 9

The watch permissions are present only in RHEL 9 and Fedora,
so the subtests for watch should not be executed in the systemd-timesyncd
test on a system with RHEL up to version 8.
This commit is contained in:
Zdenek Pytela 2021-07-01 17:12:48 +02:00 committed by mmalik
commit 134253d980

View file

@ -102,12 +102,14 @@ rlJournalStart
rlSESearchRule "allow systemd_timedated_t efivarfs_t : file { getattr open read } [ ]"
rlPhaseEnd
if ! rlIsRHEL '<9' ; then
rlPhaseStartTest "bz#1949315"
rlSEMatchPathCon "/" "root_t"
rlSEMatchPathCon "/run" "var_run_t"
rlSESearchRule "allow systemd_timedated_t root_t : dir { watch } [ ]"
rlSESearchRule "allow systemd_timedated_t var_run_t : dir { watch } [ ]"
rlPhaseEnd
fi
if systemctl list-units | grep -q ${SERVICE_NAME} ; then
rlPhaseStartTest "real scenario -- standalone service"