mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +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:
committed by
Pavel Emelyanov
parent
65d3545945
commit
a3f7a16fe7
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user