]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: make / private after creating a mount namespace
authorEvegeny Vereshchagin <evvers@ya.ru>
Fri, 9 Mar 2018 01:10:42 +0000 (01:10 +0000)
committerEvegeny Vereshchagin <evvers@ya.ru>
Fri, 9 Mar 2018 14:39:26 +0000 (14:39 +0000)
so that the test never affects the root namespace.

src/test/test-process-util.c

index 0e5a9d811d77b20e616d2c25f8f25cb219111fb4..1a0164e601f2230abdca613c4899e3df6532b6f5 100644 (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);