[CRIU] [PATCH 3/3] zdtm: check bind-mounted files in static/mountpoints

Andrey Vagin avagin at openvz.org
Mon Jun 16 07:40:05 PDT 2014


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/mountpoints.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/test/zdtm/live/static/mountpoints.c b/test/zdtm/live/static/mountpoints.c
index 65c2eb3..ecf33f0 100644
--- a/test/zdtm/live/static/mountpoints.c
+++ b/test/zdtm/live/static/mountpoints.c
@@ -249,6 +249,24 @@ done:
 	}
 	mkdir(MPTS_ROOT"/dev/slave/test.mnt.slave/test.slave", 0600);
 
+	fd = open(MPTS_ROOT"/dev/bmfile", O_CREAT | O_WRONLY);
+	if (fd < 0) {
+		err("Can't create " MPTS_ROOT "/dev/share-1/bmfile");
+		return 1;
+	}
+	close(fd);
+
+	fd = open(MPTS_ROOT"/dev/bmfile-mount", O_CREAT | O_WRONLY);
+	if (fd < 0) {
+		err("Can't create " MPTS_ROOT "/dev/share-1/bmfile");
+		return 1;
+	}
+	close(fd);
+
+	if (mount(MPTS_ROOT"/dev/bmfile", MPTS_ROOT"/dev/bmfile-mount", NULL, MS_BIND, NULL) < 0) {
+		fail("Can't mount tmpfs");
+		return 1;
+	}
 
 	if (mount("none", MPTS_ROOT"/kernel", "proc", 0, "") < 0) {
 		fail("Can't mount proc");
-- 
1.8.5.3



More information about the CRIU mailing list