Commit a3f7a16f authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: check that overmounted parts of tmpfs are restored

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 65d35459
...@@ -97,6 +97,19 @@ done: ...@@ -97,6 +97,19 @@ done:
return 1; return 1;
} }
/* Check that over-mounted files are restored on tmpfs */
mkdir(MPTS_ROOT"/dev/overmount", 0600);
fd = open(MPTS_ROOT"/dev/overmount/test.over", O_WRONLY | O_CREAT);
if (fd == -1) {
err("Unable to open "MPTS_ROOT"/dev/overmount\n");
return -1;
}
close(fd);
if (mount("none", MPTS_ROOT"/dev/overmount", "tmpfs", 0, "") < 0) {
err("Can't mount "MPTS_ROOT"/dev/overmount\n");
return 1;
}
if (mount("none", MPTS_ROOT"/kernel", "proc", 0, "") < 0) { if (mount("none", MPTS_ROOT"/kernel", "proc", 0, "") < 0) {
fail("Can't mount proc"); fail("Can't mount proc");
return 1; return 1;
...@@ -125,6 +138,15 @@ done: ...@@ -125,6 +138,15 @@ done:
return 1; return 1;
} }
if (umount(MPTS_ROOT"/dev/overmount") == -1) {
err("Can't umount "MPTS_ROOT"/dev/overmount\n");
return -1;
}
if (access(MPTS_ROOT"/dev/overmount/test.over", F_OK)) {
fail(MPTS_ROOT"/dev/overmount/test.over");
return -1;
}
pass(); pass();
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment