mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
zdtm: add a new test, where both sides of a tcp connection is dumped
Reported-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
4329287717
commit
0c5b606b48
@@ -104,6 +104,7 @@ static/socket-tcp6
|
|||||||
streaming/socket-tcp
|
streaming/socket-tcp
|
||||||
streaming/socket-tcp6
|
streaming/socket-tcp6
|
||||||
static/socket-tcpbuf
|
static/socket-tcpbuf
|
||||||
|
static/socket-tcpbuf-local
|
||||||
static/socket-tcpbuf6
|
static/socket-tcpbuf6
|
||||||
static/pty03
|
static/pty03
|
||||||
static/mountpoints
|
static/mountpoints
|
||||||
|
@@ -54,6 +54,7 @@ TST_NOFILE = \
|
|||||||
socket-tcp \
|
socket-tcp \
|
||||||
socket-tcp6 \
|
socket-tcp6 \
|
||||||
socket-tcpbuf \
|
socket-tcpbuf \
|
||||||
|
socket-tcpbuf-local \
|
||||||
socket-tcpbuf6 \
|
socket-tcpbuf6 \
|
||||||
sock_opts00 \
|
sock_opts00 \
|
||||||
sock_opts01 \
|
sock_opts01 \
|
||||||
@@ -238,6 +239,7 @@ sem: override CFLAGS += -DNEW_IPC_NS
|
|||||||
posix_timers: override LDLIBS += -lrt
|
posix_timers: override LDLIBS += -lrt
|
||||||
socket-tcp6: override CFLAGS += -D ZDTM_IPV6
|
socket-tcp6: override CFLAGS += -D ZDTM_IPV6
|
||||||
socket-tcpbuf6: 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
|
socket_listen6: override CFLAGS += -D ZDTM_IPV6
|
||||||
sigpending: override LDLIBS += -lrt
|
sigpending: override LDLIBS += -lrt
|
||||||
|
|
||||||
|
1
test/zdtm/live/static/socket-tcpbuf-local.c
Symbolic link
1
test/zdtm/live/static/socket-tcpbuf-local.c
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
socket-tcpbuf.c
|
@@ -96,6 +96,10 @@ int main(int argc, char **argv)
|
|||||||
int sk_bsize;
|
int sk_bsize;
|
||||||
int ret, snd_size, rcv_size;
|
int ret, snd_size, rcv_size;
|
||||||
|
|
||||||
|
#ifdef ZDTM_TCP_LOCAL
|
||||||
|
test_init(argc, argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (pipe(pfd)) {
|
if (pipe(pfd)) {
|
||||||
err("pipe() failed");
|
err("pipe() failed");
|
||||||
return 1;
|
return 1;
|
||||||
@@ -109,7 +113,9 @@ int main(int argc, char **argv)
|
|||||||
int size;
|
int size;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
|
#ifndef ZDTM_TCP_LOCAL
|
||||||
test_ext_init(argc, argv);
|
test_ext_init(argc, argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
close(pfd[1]);
|
close(pfd[1]);
|
||||||
if (read(pfd[0], &port, sizeof(port)) != sizeof(port)) {
|
if (read(pfd[0], &port, sizeof(port)) != sizeof(port)) {
|
||||||
@@ -154,7 +160,9 @@ int main(int argc, char **argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ZDTM_TCP_LOCAL
|
||||||
test_init(argc, argv);
|
test_init(argc, argv);
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
|
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
|
||||||
err("initializing server failed");
|
err("initializing server failed");
|
||||||
|
Reference in New Issue
Block a user