summaryrefslogtreecommitdiffstats
path: root/src/test/test-mount-util.c
diff options
context:
space:
mode:
authorEvegeny Vereshchagin <evvers@ya.ru>2018-03-09 01:44:57 +0100
committerEvegeny Vereshchagin <evvers@ya.ru>2018-03-09 15:39:11 +0100
commit112cc3b5b2f61475afed6b082e917001710470bf (patch)
treeee48792490cb2833bf5b43430701e53f84d6ecfb /src/test/test-mount-util.c
parentMerge pull request #8372 from keszybz/two-cleanups (diff)
downloadsystemd-112cc3b5b2f61475afed6b082e917001710470bf.tar.xz
systemd-112cc3b5b2f61475afed6b082e917001710470bf.zip
tests: skip the rest of test_mnt_id after getting any error
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.
Diffstat (limited to 'src/test/test-mount-util.c')
-rw-r--r--src/test/test-mount-util.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/test/test-mount-util.c b/src/test/test-mount-util.c
index c95baa81a7..5f2ad7c719 100644
--- a/src/test/test-mount-util.c
+++ b/src/test/test-mount-util.c
@@ -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;
}