[CRIU] [PATCH] zdtm: add a new test, where both sides of a tcp connection is dumped

Andrey Vagin avagin at openvz.org
Tue Aug 20 02:23:59 EDT 2013


Reported-by: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm.sh                                | 1 +
 test/zdtm/live/static/Makefile              | 2 ++
 test/zdtm/live/static/socket-tcpbuf-local.c | 1 +
 test/zdtm/live/static/socket-tcpbuf.c       | 8 ++++++++
 4 files changed, 12 insertions(+)
 create mode 120000 test/zdtm/live/static/socket-tcpbuf-local.c

diff --git a/test/zdtm.sh b/test/zdtm.sh
index ae0d7e5..a03db39 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -104,6 +104,7 @@ static/socket-tcp6
 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 9c2c581..44d016f 100644
--- a/test/zdtm/live/static/Makefile
+++ b/test/zdtm/live/static/Makefile
@@ -54,6 +54,7 @@ TST_NOFILE	=				\
 		socket-tcp			\
 		socket-tcp6			\
 		socket-tcpbuf			\
+		socket-tcpbuf-local		\
 		socket-tcpbuf6			\
 		sock_opts00			\
 		sock_opts01			\
@@ -238,6 +239,7 @@ sem:			override CFLAGS += -DNEW_IPC_NS
 posix_timers:		override LDLIBS += -lrt
 socket-tcp6: override CFLAGS += -D ZDTM_IPV6
 socket-tcpbuf6: override CFLAGS += -D ZDTM_IPV6
+socket-tcpbuf-local: override CFLAGS += -D ZDTM_TCP_LOCAL
 socket_listen6: override CFLAGS += -D ZDTM_IPV6
 sigpending:		override LDLIBS += -lrt
 
diff --git a/test/zdtm/live/static/socket-tcpbuf-local.c b/test/zdtm/live/static/socket-tcpbuf-local.c
new file mode 120000
index 0000000..58c46c7
--- /dev/null
+++ b/test/zdtm/live/static/socket-tcpbuf-local.c
@@ -0,0 +1 @@
+socket-tcpbuf.c
\ No newline at end of file
diff --git a/test/zdtm/live/static/socket-tcpbuf.c b/test/zdtm/live/static/socket-tcpbuf.c
index c2f7c43..a4c451a 100644
--- a/test/zdtm/live/static/socket-tcpbuf.c
+++ b/test/zdtm/live/static/socket-tcpbuf.c
@@ -96,6 +96,10 @@ int main(int argc, char **argv)
 	int sk_bsize;
 	int ret, snd_size, rcv_size;
 
+#ifdef ZDTM_TCP_LOCAL
+	test_init(argc, argv);
+#endif
+
 	if (pipe(pfd)) {
 		err("pipe() failed");
 		return 1;
@@ -109,7 +113,9 @@ int main(int argc, char **argv)
 		int size;
 		char c;
 
+#ifndef ZDTM_TCP_LOCAL
 		test_ext_init(argc, argv);
+#endif
 
 		close(pfd[1]);
 		if (read(pfd[0], &port, sizeof(port)) != sizeof(port)) {
@@ -154,7 +160,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");
-- 
1.8.3.1



More information about the CRIU mailing list