diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c index fd4d17408d..7f3f502c56 100644 --- a/src/test/test-process-util.c +++ b/src/test/test-process-util.c @@ -206,7 +206,7 @@ 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); + assert_se(mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL) >= 0); fd = mkostemp(path, O_CLOEXEC); assert_se(fd >= 0); diff --git a/src/test/test-udev.c b/src/test/test-udev.c index bed51c1270..dd630b9718 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -38,7 +38,7 @@ static int fake_filesystems(void) { if (unshare(CLONE_NEWNS) < 0) return log_error_errno(errno, "failed to call unshare(): %m"); - if (mount(NULL, "/", NULL, MS_PRIVATE|MS_REC, NULL) < 0) + if (mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL) < 0) return log_error_errno(errno, "failed to mount / as private: %m"); for (i = 0; i < ELEMENTSOF(fakefss); i++) {