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

Andrey Vagin avagin at openvz.org
Thu Sep 17 08:09:04 PDT 2015


From: Andrew Vagin <avagin at openvz.org>

Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 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.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.opts    | 1 +
 test/zdtm/live/static/socket-tcpbuf6-local.c    | 1 +
 test/zdtm/live/static/socket-tcpbuf6-local.opts | 1 +
 9 files changed, 24 insertions(+), 1 deletion(-)
 create mode 120000 test/zdtm/live/static/socket-tcp-local.c
 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.opts
 create mode 120000 test/zdtm/live/static/socket-tcpbuf6-local.c
 create mode 120000 test/zdtm/live/static/socket-tcpbuf6-local.opts

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 9bbeb2a..9f1c8a1 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 3e78eb2..7a97b0e 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			\
 		sock_opts00			\
 		sock_opts01			\
@@ -329,6 +332,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.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 ca5939e..3726842 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)) {
 		err("pipe() failed");
 		return 1;
@@ -71,7 +75,9 @@ int main(int argc, char **argv)
 		err("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) {
 		err("initializing server failed");
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.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-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.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