[CRIU] [PATCH 25/27] zdtm: check opened files in a second mntns

Andrey Vagin avagin at openvz.org
Thu Apr 10 04:04:08 PDT 2014


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

diff --git a/test/zdtm/live/static/mountpoints.c b/test/zdtm/live/static/mountpoints.c
index 620115c..ac04698 100644
--- a/test/zdtm/live/static/mountpoints.c
+++ b/test/zdtm/live/static/mountpoints.c
@@ -31,6 +31,7 @@ int ns_child(void *_arg)
 {
 	struct stat st;
 	pid_t pid;
+	int fd, ufd;
 
 	mkdir(MPTS_ROOT"/dev/mntns2", 0600);
 	if (mount("none", MPTS_ROOT"/dev/mntns2", "tmpfs", 0, "") < 0) {
@@ -40,6 +41,15 @@ int ns_child(void *_arg)
 
 	mkdir(MPTS_ROOT"/dev/mntns2/test", 0600);
 
+	fd = open(MPTS_ROOT"/dev/mntns2/test/test.file", O_WRONLY | O_CREAT, 0666);
+	if (fd < 0)
+		return 1;
+
+	ufd = open(MPTS_ROOT"/dev/mntns2/test/test.file.unlinked", O_WRONLY | O_CREAT, 0666);
+	if (ufd < 0)
+		return 1;
+	unlink(MPTS_ROOT"/dev/mntns2/test/test.file.unlinked");
+
 	pid = fork();
 
 	test_waitsig();
-- 
1.8.5.3



More information about the CRIU mailing list