]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: skip the rest of test_mnt_id after getting any error
authorEvegeny Vereshchagin <evvers@ya.ru>
Fri, 9 Mar 2018 00:44:57 +0000 (00:44 +0000)
committerEvegeny Vereshchagin <evvers@ya.ru>
Fri, 9 Mar 2018 14:39:11 +0000 (14:39 +0000)
This mainly gets around a kernel bug making it possible to
have non-existent paths in /proc/self/mountinfo, but it should also
prevent flaky failures that can happen if something changes immediately
after or during reading /proc/self/mountinfo.

Closes https://github.com/systemd/systemd/issues/8286.

src/test/test-mount-util.c

index c95baa81a7176de3de8168ca62309bf2d00db72e..5f2ad7c7194e8798c9ae96cb8d119aedd5cb1946 100644 (file)
@@ -80,12 +80,8 @@ static void test_mnt_id(void) {
                 int mnt_id = PTR_TO_INT(k), mnt_id2;
 
                 r = path_get_mnt_id(p, &mnt_id2);
-                if (r == -EOPNOTSUPP) { /* kernel or file system too old? */
-                        log_debug("%s doesn't support mount IDs\n", p);
-                        continue;
-                }
-                if (IN_SET(r, -EACCES, -EPERM)) {
-                        log_debug("Can't access %s\n", p);
+                if (r < 0) {
+                        log_debug_errno(r, "Failed to get the mnt id of %s: %m\n", p);
                         continue;
                 }