[CRIU] [PATCH 1/4] zdtm: Tune mountpoints test

Pavel Emelyanov xemul at parallels.com
Thu Oct 8 13:07:15 PDT 2015


I constantly have binfmt_misc off on my set ups :) Looks like this fs is
far from being default for systems, so to make the test work (we plan to
rewrite it anyway) let's make this fs being optional.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 test/zdtm/live/static/mountpoints.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/test/zdtm/live/static/mountpoints.c b/test/zdtm/live/static/mountpoints.c
index 1e2c3c6..6aa9751 100644
--- a/test/zdtm/live/static/mountpoints.c
+++ b/test/zdtm/live/static/mountpoints.c
@@ -73,7 +73,7 @@ int ns_child(void *_arg)
 static int test_fn(int argc, char **argv)
 {
 	FILE *f;
-	int fd, tmpfs_fd;
+	int fd, tmpfs_fd, have_bfmtm = 0;
 	unsigned fs_cnt, fs_cnt_last = 0;
 	struct ns_exec_args args;
 	mode_t old_mask;
@@ -268,10 +268,8 @@ done:
 	}
 
 	if (mount("none", MPTS_ROOT"/kernel/sys/fs/binfmt_misc",
-					"binfmt_misc", 0, "") < 0) {
-		fail("Can't mount binfmt_misc");
-		return 1;
-	}
+					"binfmt_misc", 0, "") == 0)
+		have_bfmtm = 1;
 
 	unlink("/dev/null");
 	/*
@@ -305,6 +303,11 @@ done:
 		return 1;
 	}
 
+	if (have_bfmtm && access(MPTS_ROOT"/kernel/sys/fs/binfmt_misc/register", F_OK)) {
+		fail("No binfmt_misc after restore");
+		return 1;
+	}
+
 	if (umount(MPTS_ROOT"/dev/overmount") == -1) {
 		err("Can't umount "MPTS_ROOT"/dev/overmount\n");
 		return -1;
-- 
1.9.3




More information about the CRIU mailing list