[CRIU] [PATCH 1/4] zdtm: allow to execute tcp tests in network namespaces

Andrey Vagin avagin at openvz.org
Tue Nov 17 12:19:36 PST 2015


From: Andrew Vagin <avagin at openvz.org>

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/zdtm.sh                                    | 5 ++++-
 test/zdtm/live/static/Makefile                  | 6 ++++++
 test/zdtm/live/static/socket-tcp-local.c        | 1 +
 test/zdtm/live/static/socket-tcp-local.desc     | 1 +
 test/zdtm/live/static/socket-tcp-local.opts     | 1 +
 test/zdtm/live/static/socket-tcp.c              | 8 ++++++++
 test/zdtm/live/static/socket-tcp6-local.c       | 1 +
 test/zdtm/live/static/socket-tcp6-local.desc    | 1 +
 test/zdtm/live/static/socket-tcp6-local.opts    | 1 +
 test/zdtm/live/static/socket-tcpbuf-local.desc  | 2 +-
 test/zdtm/live/static/socket-tcpbuf6-local.c    | 1 +
 test/zdtm/live/static/socket-tcpbuf6-local.desc | 1 +
 test/zdtm/live/static/socket-tcpbuf6-local.opts | 1 +
 13 files changed, 28 insertions(+), 2 deletions(-)
 create mode 120000 test/zdtm/live/static/socket-tcp-local.c
 create mode 100644 test/zdtm/live/static/socket-tcp-local.desc
 create mode 120000 test/zdtm/live/static/socket-tcp-local.opts
 create mode 120000 test/zdtm/live/static/socket-tcp6-local.c
 create mode 120000 test/zdtm/live/static/socket-tcp6-local.desc
 create mode 120000 test/zdtm/live/static/socket-tcp6-local.opts
 create mode 120000 test/zdtm/live/static/socket-tcpbuf6-local.c
 create mode 120000 test/zdtm/live/static/socket-tcpbuf6-local.desc
 create mode 120000 test/zdtm/live/static/socket-tcpbuf6-local.opts

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 81aacff..6718421 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -147,6 +147,10 @@ generate_test_list()
 		static/dumpable01
 		static/dumpable02
 		static/deleted_dev
+		static/socket-tcpbuf-local
+		static/socket-tcpbuf6-local
+		static/socket-tcp-local
+		static/socket-tcp6-local
 	"
 
 	#
@@ -182,7 +186,6 @@ generate_test_list()
 		streaming/socket-tcp
 		streaming/socket-tcp6
 		static/socket-tcpbuf
-		static/socket-tcpbuf-local
 		static/socket-tcpbuf6
 		static/pty03
 		static/mountpoints
diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile
index 1747f81..23ec5a1 100644
--- a/test/zdtm/live/static/Makefile
+++ b/test/zdtm/live/static/Makefile
@@ -61,8 +61,11 @@ TST_NOFILE	=				\
 		socket_queues02			\
 		socket-tcp			\
 		socket-tcp6			\
+		socket-tcp-local		\
+		socket-tcp6-local		\
 		socket-tcpbuf			\
 		socket-tcpbuf-local		\
+		socket-tcpbuf6-local		\
 		socket-tcpbuf6			\
 		socket-closed-tcp		\
 		sock_opts00			\
@@ -339,6 +342,9 @@ posix_timers:		override LDLIBS += -lrt -pthread
 socket-tcp6: override CFLAGS += -D ZDTM_IPV6
 socket-tcpbuf6: override CFLAGS += -D ZDTM_IPV6
 socket-tcpbuf-local: override CFLAGS += -D ZDTM_TCP_LOCAL
+socket-tcpbuf6-local: override CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV6
+socket-tcp6-local: override CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV6
+socket-tcp-local: override CFLAGS += -D ZDTM_TCP_LOCAL
 socket_listen6: override CFLAGS += -D ZDTM_IPV6
 sigpending:		override LDLIBS += -lrt
 vdso01:			override LDLIBS += -lrt
diff --git a/test/zdtm/live/static/socket-tcp-local.c b/test/zdtm/live/static/socket-tcp-local.c
new file mode 120000
index 0000000..8cb60dd
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcp-local.c
@@ -0,0 +1 @@
+socket-tcp.c
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcp-local.desc b/test/zdtm/live/static/socket-tcp-local.desc
new file mode 100644
index 0000000..7790127
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcp-local.desc
@@ -0,0 +1 @@
+{'flavor': 'h ns uns', 'opts': '--tcp-established'}
diff --git a/test/zdtm/live/static/socket-tcp-local.opts b/test/zdtm/live/static/socket-tcp-local.opts
new file mode 120000
index 0000000..5f40ff8
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcp-local.opts
@@ -0,0 +1 @@
+socket-tcp.opts
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcp.c b/test/zdtm/live/static/socket-tcp.c
index fd2f61e..ea669d9 100644
--- a/test/zdtm/live/static/socket-tcp.c
+++ b/test/zdtm/live/static/socket-tcp.c
@@ -61,6 +61,10 @@ int main(int argc, char **argv)
 	int val;
 	socklen_t optlen;
 
+#ifdef ZDTM_TCP_LOCAL
+	test_init(argc, argv);
+#endif
+
 	if (pipe(pfd)) {
 		pr_perror("pipe() failed");
 		return 1;
@@ -71,7 +75,9 @@ int main(int argc, char **argv)
 		pr_perror("fork() failed");
 		return 1;
 	} else if (extpid == 0) {
+#ifndef ZDTM_TCP_LOCAL
 		test_ext_init(argc, argv);
+#endif
 
 		close(pfd[1]);
 		if (read(pfd[0], &port, sizeof(port)) != sizeof(port)) {
@@ -115,7 +121,9 @@ int main(int argc, char **argv)
 		return 0;
 	}
 
+#ifndef ZDTM_TCP_LOCAL
 	test_init(argc, argv);
+#endif
 
 	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed\n");
diff --git a/test/zdtm/live/static/socket-tcp6-local.c b/test/zdtm/live/static/socket-tcp6-local.c
new file mode 120000
index 0000000..8cb60dd
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcp6-local.c
@@ -0,0 +1 @@
+socket-tcp.c
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcp6-local.desc b/test/zdtm/live/static/socket-tcp6-local.desc
new file mode 120000
index 0000000..c915663
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcp6-local.desc
@@ -0,0 +1 @@
+socket-tcp-local.desc
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcp6-local.opts b/test/zdtm/live/static/socket-tcp6-local.opts
new file mode 120000
index 0000000..5f40ff8
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcp6-local.opts
@@ -0,0 +1 @@
+socket-tcp.opts
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcpbuf-local.desc b/test/zdtm/live/static/socket-tcpbuf-local.desc
index 214675e..7790127 100644
--- a/test/zdtm/live/static/socket-tcpbuf-local.desc
+++ b/test/zdtm/live/static/socket-tcpbuf-local.desc
@@ -1 +1 @@
-{'flavor': 'h', 'opts': '--tcp-established'}
+{'flavor': 'h ns uns', 'opts': '--tcp-established'}
diff --git a/test/zdtm/live/static/socket-tcpbuf6-local.c b/test/zdtm/live/static/socket-tcpbuf6-local.c
new file mode 120000
index 0000000..58c46c7
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcpbuf6-local.c
@@ -0,0 +1 @@
+socket-tcpbuf.c
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcpbuf6-local.desc b/test/zdtm/live/static/socket-tcpbuf6-local.desc
new file mode 120000
index 0000000..3c9afd2
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcpbuf6-local.desc
@@ -0,0 +1 @@
+socket-tcpbuf-local.desc
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcpbuf6-local.opts b/test/zdtm/live/static/socket-tcpbuf6-local.opts
new file mode 120000
index 0000000..ed66097
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcpbuf6-local.opts
@@ -0,0 +1 @@
+socket-tcpbuf.opts
\ No newline at end of file
-- 
2.4.3



More information about the CRIU mailing list