[CRIU] [PATCH 2/4] zdtm: Stop using test_init_ns by static/mountpoints

Pavel Emelyanov xemul at parallels.com
Mon Nov 30 11:38:30 PST 2015


Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 test/zdtm.sh                           |  2 +-
 test/zdtm/live/static/mountpoints.c    | 19 ++-----------------
 test/zdtm/live/static/mountpoints.desc |  2 +-
 3 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 69e2d5b..b6fd0a8 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -188,7 +188,7 @@ generate_test_list()
 		static/socket-tcpbuf
 		static/socket-tcpbuf6
 		static/pty03
-		static/mountpoints
+		ns/static/mountpoints
 		ns/static/session00
 		ns/static/session01
 		ns/static/tempfs
diff --git a/test/zdtm/live/static/mountpoints.c b/test/zdtm/live/static/mountpoints.c
index 0df5ddc..2869feb 100644
--- a/test/zdtm/live/static/mountpoints.c
+++ b/test/zdtm/live/static/mountpoints.c
@@ -70,7 +70,7 @@ int ns_child(void *_arg)
 	return 0;
 }
 
-static int test_fn(int argc, char **argv)
+int main(int argc, char **argv)
 {
 	FILE *f;
 	int fd, tmpfs_fd, have_bfmtm = 0;
@@ -79,13 +79,8 @@ static int test_fn(int argc, char **argv)
 	mode_t old_mask;
 	pid_t pid = -1;
 
-	if (!getenv("ZDTM_REEXEC")) {
-		setenv("ZDTM_REEXEC", "1", 0);
-		return execv(argv[0], argv);
-	} else
-		test_init(argc, argv);
+	test_init(argc, argv);
 
-	close(0); /* /dev/null */
 again:
 	fs_cnt = 0;
 	f = fopen("/proc/self/mountinfo", "r");
@@ -364,13 +359,3 @@ done:
 	pass();
 	return 0;
 }
-
-#define CLONE_NEWNS     0x00020000
-
-int main(int argc, char **argv)
-{
-	if (getenv("ZDTM_REEXEC"))
-		return test_fn(argc, argv);
-	test_init_ns(argc, argv, CLONE_NEWNS, test_fn);
-	return 0;
-}
diff --git a/test/zdtm/live/static/mountpoints.desc b/test/zdtm/live/static/mountpoints.desc
index fa2c82d..dfe829b 100644
--- a/test/zdtm/live/static/mountpoints.desc
+++ b/test/zdtm/live/static/mountpoints.desc
@@ -1 +1 @@
-{'flavor': 'h', 'flags': 'suid'}
+{'flavor': 'ns', 'flags': 'suid'}
-- 
1.9.3




More information about the CRIU mailing list