From: Lennart Poettering Date: Thu, 3 Sep 2020 14:53:22 +0000 (+0200) Subject: udev-test: make sure we run udev tests with selinux assumed off X-Git-Tag: v247-rc1~303^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=415df097feafcb033e25152f4767802a6ceb8b5d;p=thirdparty%2Fsystemd.git 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) --- diff --git a/src/test/meson.build b/src/test/meson.build index 835be6466ed..70450ea1c5a 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -757,7 +757,8 @@ tests += [ librt, libblkid, libkmod, - libacl], + libacl, + libselinux], '', 'manual', '-DLOG_REALM=LOG_REALM_UDEV'], [['src/test/test-id128.c'], diff --git a/src/test/test-udev.c b/src/test/test-udev.c index c0b215dadc4..a9eda104376 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -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]);