[CRIU] [PATCH v3 6/6] zdtm: Add proc-self01 test

Kirill Tkhai ktkhai at virtuozzo.com
Sat Apr 1 04:38:06 PDT 2017


Check, that fdstore-keeped user ns files are opened
correct after restore.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 test/zdtm/static/Makefile      |    2 ++
 test/zdtm/static/proc-self.c   |    4 ++++
 test/zdtm/static/proc-self01.c |    1 +
 3 files changed, 7 insertions(+)
 create mode 120000 test/zdtm/static/proc-self01.c

diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
index 86143725..1e4a5754 100644
--- a/test/zdtm/static/Makefile
+++ b/test/zdtm/static/Makefile
@@ -101,6 +101,7 @@ TST_NOFILE	:=				\
 		pdeath_sig			\
 		file_fown			\
 		proc-self			\
+		proc-self01			\
 		eventfs00			\
 		signalfd00			\
 		inotify_irmap			\
@@ -459,6 +460,7 @@ socket-tcp6-unconn:	CFLAGS += -D ZDTM_IPV6
 
 pty-console:		CFLAGS += -D ZDTM_DEV_CONSOLE
 userns02:		CFLAGS += -D USERNS02
+proc-self01:		override CFLAGS += -D PROC_SELF01
 
 $(LIB):	force
 	$(Q) $(MAKE) -C $(LIBDIR)
diff --git a/test/zdtm/static/proc-self.c b/test/zdtm/static/proc-self.c
index 54cc5f1f..f6cf5f16 100644
--- a/test/zdtm/static/proc-self.c
+++ b/test/zdtm/static/proc-self.c
@@ -16,7 +16,11 @@
 const char *test_doc	= "Check for /proc/self/ns path restore";
 const char *test_author	= "Cyrill Gorcunov <gorcunov at openvz.org>";
 
+#ifdef PROC_SELF01
+const char nspath[] = "/proc/self/ns/user";
+#else
 const char nspath[] = "/proc/self/ns/net";
+#endif
 
 int read_fd_link(int lfd, char *buf, size_t size)
 {
diff --git a/test/zdtm/static/proc-self01.c b/test/zdtm/static/proc-self01.c
new file mode 120000
index 00000000..3ac971a4
--- /dev/null
+++ b/test/zdtm/static/proc-self01.c
@@ -0,0 +1 @@
+proc-self.c
\ No newline at end of file



More information about the CRIU mailing list