]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: ignore some mount errors in test-udev 3008/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Sun, 10 Apr 2016 19:29:17 +0000 (19:29 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Sun, 10 Apr 2016 20:01:27 +0000 (20:01 +0000)
Fixes:
$ sudo make distcheck
...
FAIL: test/udev-test.pl
...

$ vi systemd-229/_build/sub/test/udev-test.pl.log
...
failed to mount empty
/home/ubuntu/systemd/systemd-229/_inst/lib/udev/rules.d No such file or directory
...
failed to mount empty
/home/ubuntu/systemd/systemd-229/_inst/lib/udev/rules.d No such file or directory
...
414 errors occurred

src/test/test-udev.c

index 8522e9925cf48c2e0055a778032d557757193a54..e5f0d00b94961ff1f9e0787c59b5656466c19a8a 100644 (file)
@@ -39,12 +39,13 @@ static int fake_filesystems(void) {
                 const char *src;
                 const char *target;
                 const char *error;
+                bool ignore_mount_error;
         } fakefss[] = {
-                { "test/tmpfs/sys", "/sys",                   "failed to mount test /sys" },
-                { "test/tmpfs/dev", "/dev",                   "failed to mount test /dev" },
-                { "test/run",       "/run",                   "failed to mount test /run" },
-                { "test/run",       "/etc/udev/rules.d",      "failed to mount empty /etc/udev/rules.d" },
-                { "test/run",       UDEVLIBEXECDIR "/rules.d","failed to mount empty " UDEVLIBEXECDIR "/rules.d" },
+                { "test/tmpfs/sys", "/sys",                    "failed to mount test /sys",                        false },
+                { "test/tmpfs/dev", "/dev",                    "failed to mount test /dev",                        false },
+                { "test/run",       "/run",                    "failed to mount test /run",                        false },
+                { "test/run",       "/etc/udev/rules.d",       "failed to mount empty /etc/udev/rules.d",          true },
+                { "test/run",       UDEVLIBEXECDIR "/rules.d", "failed to mount empty " UDEVLIBEXECDIR "/rules.d", true },
         };
         unsigned int i;
         int err;
@@ -66,8 +67,10 @@ static int fake_filesystems(void) {
                 err = mount(fakefss[i].src, fakefss[i].target, NULL, MS_BIND, NULL);
                 if (err < 0) {
                         err = -errno;
-                        fprintf(stderr, "%s %m\n", fakefss[i].error);
-                        return err;
+                        fprintf(stderr, "%s %m%s\n", fakefss[i].error, fakefss[i].ignore_mount_error ? ", ignoring" : "");
+                        if (!fakefss[i].ignore_mount_error)
+                                return err;
+                        err = 0;
                 }
         }
 out: