[5/5] zdtm: Add proc-self01 test

Submitted by Kirill Tkhai on March 24, 2017, 9:35 a.m.

Details

Message ID 149034812267.30232.13907228900720519956.stgit@localhost.localdomain
State New
Series "Restore of "/proc/self/ns/net" fixes"
Headers show

Commit Message

Kirill Tkhai March 24, 2017, 9:35 a.m.
Check, that fdstore-keeped user ns files are opened
correct after restore.

Signed-off-by: Kirill Tkhai <ktkhai@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

Patch hide | download patch | download mbox

diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
index 02bf54d3..68a6846d 100644
--- a/test/zdtm/static/Makefile
+++ b/test/zdtm/static/Makefile
@@ -107,6 +107,7 @@  TST_NOFILE	:=				\
 		pdeath_sig			\
 		file_fown			\
 		proc-self			\
+		proc-self01			\
 		eventfs00			\
 		signalfd00			\
 		inotify_irmap			\
@@ -468,6 +469,7 @@  socket-tcp6-unconn:	override CFLAGS += -D ZDTM_IPV6
 
 pty-console:		override CFLAGS += -D ZDTM_DEV_CONSOLE
 userns02:		override 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@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