]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-test: make sure we run udev tests with selinux assumed off
authorLennart Poettering <lennart@poettering.net>
Thu, 3 Sep 2020 14:53:22 +0000 (16:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 3 Sep 2020 15:01:11 +0000 (17:01 +0200)
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)

src/test/meson.build
src/test/test-udev.c

index 835be6466edabe2db901cab598874ecc0716f9e0..70450ea1c5a19f63688516b121832c44e99bfbd3 100644 (file)
@@ -757,7 +757,8 @@ tests += [
           librt,
           libblkid,
           libkmod,
-          libacl],
+          libacl,
+          libselinux],
          '', 'manual', '-DLOG_REALM=LOG_REALM_UDEV'],
 
         [['src/test/test-id128.c'],
index c0b215dadc4020dc262cee426b56286e73651ca3..a9eda10437628a1025aef251f74c128428a0aa4e 100644 (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]);