udev-test: make sure we run udev tests with selinux assumed off

This is cleaner that way given that we create our own half-virtualizes
device tree, and really shouldn't pull selinux labelling and access
control into that, we can only lose, in particular as our overmounted
/sys/ actually lacks /sys/fs/selinux.

(This fixes udev test woes introduced by #16821 where suddenly the test
would fail because libselinux assumed selinux was on, but selinuxfs
wasn't actually available)
This commit is contained in:
Lennart Poettering 2020-09-03 16:53:22 +02:00
parent 86e443de2f
commit 415df097fe
2 changed files with 8 additions and 1 deletions

View file

@ -757,7 +757,8 @@ tests += [
librt,
libblkid,
libkmod,
libacl],
libacl,
libselinux],
'', 'manual', '-DLOG_REALM=LOG_REALM_UDEV'],
[['src/test/test-id128.c'],

View file

@ -71,6 +71,12 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return r;
/* Let's make sure the test runs with selinux assumed disabled. */
#if HAVE_SELINUX
fini_selinuxmnt();
#endif
mac_selinux_retest();
if (argc == 2) {
if (!streq(argv[1], "check")) {
log_error("Unknown argument: %s", argv[1]);