Refactor the policy so that it is easier to work with.
Leverage the refactoring to fully support running the testsuite
as sysadm_u:sysadm_r:sysadm_t.
The gist of this work lies in unifying how test domains are defined,
deduplicating the various boilerplate spread out all across the
individual files (and not even used consistently), and in abstracting
the policy caller domain/role away from the individual test policies
into testgeneral.te. Some tests also had to be massaged to not
hard-code unconfined* and be generic against the context of the
testsuite caller.
The series also extends the CI to test running the testsuite as sysadm_*
and also verify that no unconfined_t/sysadm_t unexpected denials are
produced (which would usually indicate a missing dontaudit rule in the
testsuite policy).
This series aims for two things:
The gist of this work lies in unifying how test domains are defined, deduplicating the various boilerplate spread out all across the individual files (and not even used consistently), and in abstracting the policy caller domain/role away from the individual test policies into testgeneral.te. Some tests also had to be massaged to not hard-code unconfined* and be generic against the context of the testsuite caller.
The series also extends the CI to test running the testsuite as sysadm_* and also verify that no unconfined_t/sysadm_t unexpected denials are produced (which would usually indicate a missing dontaudit rule in the testsuite policy).
Originally posted at https://lore.kernel.org/selinux/20220729120229.207584-1-omosnace@redhat.com/T/, but the mailing list bounced some of the patches, so I'm opening a PR instead...