mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-13 13:17:43 +03:00
Merge pull request #8403 from evverx/test-mount-util
tests: skip the rest of test_mnt_id after getting any error
This commit is contained in:
commit
fd4249da1d
@ -217,6 +217,7 @@ int main(int argc, char *argv[]) {
|
||||
free(h);
|
||||
|
||||
#if HAVE_GLIB
|
||||
#ifndef __SANITIZE_ADDRESS__
|
||||
{
|
||||
GDBusMessage *g;
|
||||
char *p;
|
||||
@ -232,6 +233,7 @@ int main(int argc, char *argv[]) {
|
||||
g_object_unref(g);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_DBUS
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -193,6 +193,8 @@ static void test_get_process_cmdline_harder(void) {
|
||||
assert_se(pid == 0);
|
||||
assert_se(unshare(CLONE_NEWNS) >= 0);
|
||||
|
||||
assert_se(mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) >= 0);
|
||||
|
||||
fd = mkostemp(path, O_CLOEXEC);
|
||||
assert_se(fd >= 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user