[CRIU] [PATCH 1/5] zdtm: Test for manual ext-mount-map option

Pavel Emelyanov xemul at virtuozzo.com
Tue Oct 25 08:26:59 PDT 2016


The same as for --ext-mount-map auto, but with manual key:val
setting in .desc file.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>

---
 test/zdtm/static/Makefile            |  2 ++
 test/zdtm/static/mnt_ext_auto.c      | 10 ++++++++--
 test/zdtm/static/mnt_ext_manual.c    |  1 +
 test/zdtm/static/mnt_ext_manual.desc |  1 +
 4 files changed, 12 insertions(+), 2 deletions(-)
 create mode 120000 test/zdtm/static/mnt_ext_manual.c
 create mode 100644 test/zdtm/static/mnt_ext_manual.desc

diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
index e2717a0..86c67d1 100644
--- a/test/zdtm/static/Makefile
+++ b/test/zdtm/static/Makefile
@@ -246,6 +246,7 @@ TST_DIR		=				\
 		mntns_root_bind02		\
 		mntns_overmount			\
 		mntns_shared_vs_private		\
+		mnt_ext_manual			\
 		mnt_ext_auto			\
 		mnt_ext_master			\
 		mnt_ext_dev			\
@@ -395,6 +396,7 @@ socket-tcp6-local: override CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV6
 socket-tcp-local: override CFLAGS += -D ZDTM_TCP_LOCAL
 socket-tcp-nfconntrack: override CFLAGS += -D ZDTM_TCP_LOCAL -DZDTM_CONNTRACK
 socket_listen6: override CFLAGS += -D ZDTM_IPV6
+mnt_ext_manual: override CFLAGS += -D ZDTM_EXTMAP_MANUAL
 sigpending:		override LDLIBS += -lrt
 vdso01:			override LDLIBS += -lrt
 mntns_link_remap:	override CFLAGS += -DZDTM_LINK_REMAP
diff --git a/test/zdtm/static/mnt_ext_auto.c b/test/zdtm/static/mnt_ext_auto.c
index 42fb363..c361b97 100644
--- a/test/zdtm/static/mnt_ext_auto.c
+++ b/test/zdtm/static/mnt_ext_auto.c
@@ -11,10 +11,16 @@
 
 #include "zdtmtst.h"
 
-const char *test_doc	= "Check --mnt-ext-map auto";
+const char *test_doc	= "Check --mnt-ext-map";
 const char *test_author	= "Andrew Vagin <avagin at gmail.com>";
 
+#ifdef ZDTM_EXTMAP_MANUAL
+char *dirname = "mnt_ext_manual.test";
+#define DDIR	"mtest"
+#else
 char *dirname = "mnt_ext_auto.test";
+#define DDIR	"atest"
+#endif
 TEST_OPTION(dirname, string, "directory name", 1);
 
 int main(int argc, char ** argv)
@@ -35,7 +41,7 @@ int main(int argc, char ** argv)
 		goto test;
 
 	mkdir(dname, 755);
-	sprintf(src, "%s/test", dname);
+	sprintf(src, "%s/%s", dname, DDIR);
 	if (mount("zdtm_auto_ext_mnt", dname, "tmpfs", 0, NULL)) {
 		pr_perror("mount");
 		return 1;
diff --git a/test/zdtm/static/mnt_ext_manual.c b/test/zdtm/static/mnt_ext_manual.c
new file mode 120000
index 0000000..9f28745
--- /dev/null
+++ b/test/zdtm/static/mnt_ext_manual.c
@@ -0,0 +1 @@
+mnt_ext_auto.c
\ No newline at end of file
diff --git a/test/zdtm/static/mnt_ext_manual.desc b/test/zdtm/static/mnt_ext_manual.desc
new file mode 100644
index 0000000..ae07b81
--- /dev/null
+++ b/test/zdtm/static/mnt_ext_manual.desc
@@ -0,0 +1 @@
+{'flavor': 'ns uns', 'feature': 'mnt_id', 'dopts': '--ext-mount-map /zdtm/static/mnt_ext_manual.test:ZDTM', 'ropts': '--ext-mount-map ZDTM:/tmp/zdtm_ext_auto.XXXXXX/mtest'}
-- 
2.5.0



More information about the CRIU mailing list