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.
This commit is contained in:
Evegeny Vereshchagin 2018-03-09 00:44:57 +00:00
parent 586fb20fd1
commit 112cc3b5b2

View 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;
}