Commit 00413cb5 authored by Andrei Vagin's avatar Andrei Vagin

test: check ipv6 sockets which handle ipv4 connections

A server socket is created with AF_INET6, but a client
socket is create with AF_INET.
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 6e770e50
......@@ -26,6 +26,7 @@ TST_NOFILE := \
sched_policy00 \
socket_listen \
socket_listen6 \
socket_listen4v6 \
socket_udp \
socket6_udp \
socket_udp_shutdown \
......@@ -65,27 +66,35 @@ TST_NOFILE := \
socket-tcp \
socket-tcp-reseted \
socket-tcp6 \
socket-tcp4v6 \
socket-tcp-local \
socket-tcp-reuseport \
socket-tcp-nfconntrack \
socket-tcp6-local \
socket-tcp4v6-local \
socket-tcpbuf \
socket-tcpbuf-local \
socket-tcpbuf6-local \
socket-tcpbuf6 \
socket-tcp-fin-wait1 \
socket-tcp6-fin-wait1 \
socket-tcp4v6-fin-wait1 \
socket-tcp-fin-wait2 \
socket-tcp6-fin-wait2 \
socket-tcp4v6-fin-wait2 \
socket-tcp-close-wait \
socket-tcp6-close-wait \
socket-tcp4v6-close-wait \
socket-tcp-last-ack \
socket-tcp6-last-ack \
socket-tcp4v6-last-ack \
socket-tcp-closing \
socket-tcp6-closing \
socket-tcp4v6-closing \
socket-tcp-closed \
socket-tcp-closed-last-ack \
socket-tcp6-closed \
socket-tcp4v6-closed \
socket-tcp-close0 \
socket-tcp-close1 \
socket-tcp-unconn \
......@@ -435,14 +444,18 @@ sem: CFLAGS += -DNEW_IPC_NS
posix_timers: LDLIBS += -lrt -pthread
remap_dead_pid_root: CFLAGS += -DREMAP_PID_ROOT
socket-tcp6: CFLAGS += -D ZDTM_IPV6
socket-tcp4v6: CFLAGS += -D ZDTM_IPV4V6
socket-tcpbuf6: CFLAGS += -D ZDTM_IPV6
socket-tcpbuf-local: CFLAGS += -D ZDTM_TCP_LOCAL
socket-tcpbuf6-local: CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV6
socket-tcp6-local: CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV6
socket-tcp4v6-local: CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV4V6
socket-tcp-local: CFLAGS += -D ZDTM_TCP_LOCAL
socket-tcp-nfconntrack: CFLAGS += -D ZDTM_TCP_LOCAL -DZDTM_CONNTRACK
socket_listen6: CFLAGS += -D ZDTM_IPV6
socket_listen4v6: CFLAGS += -D ZDTM_IPV4V6
socket-tcp6-closed: CFLAGS += -D ZDTM_IPV6
socket-tcp6-closed: CFLAGS += -D ZDTM_IPV4V6
socket-tcp-closed-last-ack: CFLAGS += -D ZDTM_TCP_LAST_ACK
mnt_ext_manual: CFLAGS += -D ZDTM_EXTMAP_MANUAL
sigpending: LDLIBS += -lrt
......@@ -474,12 +487,17 @@ socket-tcp-fin-wait1: CFLAGS += -D ZDTM_TCP_FIN_WAIT1
socket-tcp-fin-wait2: CFLAGS += -D ZDTM_TCP_FIN_WAIT2
socket-tcp6-fin-wait1: CFLAGS += -D ZDTM_TCP_FIN_WAIT1 -D ZDTM_IPV6
socket-tcp6-fin-wait2: CFLAGS += -D ZDTM_TCP_FIN_WAIT2 -D ZDTM_IPV6
socket-tcp4v6-fin-wait1: CFLAGS += -D ZDTM_TCP_FIN_WAIT1 -D ZDTM_IPV4V6
socket-tcp4v6-fin-wait2: CFLAGS += -D ZDTM_TCP_FIN_WAIT2 -D ZDTM_IPV4V6
socket-tcp-close-wait: CFLAGS += -D ZDTM_TCP_CLOSE_WAIT
socket-tcp6-close-wait: CFLAGS += -D ZDTM_TCP_CLOSE_WAIT -D ZDTM_IPV6
socket-tcp4v6-close-wait: CFLAGS += -D ZDTM_TCP_CLOSE_WAIT -D ZDTM_IPV4V6
socket-tcp-last-ack: CFLAGS += -D ZDTM_TCP_LAST_ACK
socket-tcp6-last-ack: CFLAGS += -D ZDTM_TCP_LAST_ACK -D ZDTM_IPV6
socket-tcp6-closing: CFLAGS += -D ZDTM_IPV6
socket-tcp6-unconn: CFLAGS += -D ZDTM_IPV6
socket-tcp4v6-last-ack: CFLAGS += -D ZDTM_TCP_LAST_ACK -D ZDTM_IPV4V6
socket-tcp4v6-closing: CFLAGS += -D ZDTM_IPV4V6
pty-console: CFLAGS += -D ZDTM_DEV_CONSOLE
......
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check sockets in TCP_WAIT_STOP and TCP_LAST_ACK states\n";
......@@ -186,7 +191,7 @@ int main(int argc, char **argv)
if (!newns)
test_init(argc, argv);
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed");
return 1;
}
......
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check closed tcp sockets\n";
......@@ -45,7 +50,7 @@ int main(int argc, char **argv)
return 1;
}
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed\n");
return 1;
}
......
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check sockets in the TCP_CLOSING state\n";
......@@ -160,7 +165,7 @@ int main(int argc, char **argv)
if (!newns)
test_init(argc, argv);
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed");
return 1;
}
......
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check sockets in TCP_FIN_WAIT* states\n";
......@@ -159,7 +164,7 @@ int main(int argc, char **argv)
if (!newns)
test_init(argc, argv);
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed");
return 1;
}
......
{'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'}
{'flavor': 'h ns uns', 'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'}
......@@ -6,11 +6,15 @@
#include <stdlib.h>
#include <sys/wait.h>
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check, that a reseted TCP connection can be restored\n";
......@@ -35,7 +39,7 @@ int main(int argc, char **argv)
test_init(argc, argv);
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed\n");
return 1;
}
......
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check unconnected tcp sockets\n";
......@@ -42,7 +47,7 @@ int main(int argc, char **argv)
return 1;
}
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed\n");
return 1;
}
......
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check unconnected tcp sockets\n";
......@@ -41,7 +46,7 @@ int main(int argc, char **argv)
return 1;
}
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed\n");
return 1;
}
......
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "Check, that a TCP connection can be restored\n";
......@@ -135,7 +140,7 @@ int main(int argc, char **argv)
test_init(argc, argv);
#endif
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed\n");
return 1;
}
......
socket-tcp-close-wait.c
\ No newline at end of file
socket-tcp6-close-wait.desc
\ No newline at end of file
socket-tcp-closed.c
\ No newline at end of file
socket-tcp6-closed.desc
\ No newline at end of file
socket-tcp-closing.c
\ No newline at end of file
socket-tcp6-closing.desc
\ No newline at end of file
socket-tcp-fin-wait1.c
\ No newline at end of file
socket-tcp6-fin-wait1.desc
\ No newline at end of file
socket-tcp-fin-wait2.c
\ No newline at end of file
socket-tcp6-fin-wait2.desc
\ No newline at end of file
socket-tcp-last-ack.c
\ No newline at end of file
socket-tcp6-last-ack.desc
\ No newline at end of file
socket-tcp.c
\ No newline at end of file
socket-tcp6-local.desc
\ No newline at end of file
socket-tcp.c
\ No newline at end of file
socket-tcp6.desc
\ No newline at end of file
#include "zdtmtst.h"
#ifdef ZDTM_IPV6
#ifdef ZDTM_IPV4V6
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET6
#elif defined(ZDTM_IPV6)
#define ZDTM_FAMILY AF_INET6
#define ZDTM_SRV_FAMILY AF_INET6
#else
#define ZDTM_FAMILY AF_INET
#define ZDTM_SRV_FAMILY AF_INET
#endif
const char *test_doc = "static test for listening socket\n";
......@@ -43,7 +48,7 @@ int main(int argc, char **argv)
test_init(argc, argv);
if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
pr_err("initializing server failed\n");
return 1;
}
......
socket_listen.c
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment