2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 22:35:33 +00:00

zdtm: check that overmounted parts of tmpfs are restored

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2013-08-01 16:44:40 +04:00
committed by Pavel Emelyanov
parent 65d3545945
commit a3f7a16fe7

View File

@@ -97,6 +97,19 @@ done:
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) {
fail("Can't mount proc");
return 1;
@@ -125,6 +138,15 @@ done:
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();
return 0;
}