1
1
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:
Zbigniew Jędrzejewski-Szmek 2018-03-10 09:28:16 +01:00 committed by GitHub
commit fd4249da1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -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
{

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

View File

@ -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);