2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

zdtm: Add tun_ns test

tun test in nested net ns wrapper.

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
ktkhai: Makefile hunks
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
This commit is contained in:
Andrew Vagin 2018-03-02 15:46:53 +03:00 committed by Andrei Vagin
parent 80eaf6c90a
commit d5fe28da67
2 changed files with 7 additions and 1 deletions

View File

@ -157,6 +157,7 @@ TST_NOFILE := \
grow_map02 \
grow_map03 \
tun \
tun_ns \
stopped \
stopped01 \
stopped02 \
@ -483,6 +484,7 @@ 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
tun_ns: CFLAGS += -DTUN_NS
mnt_ext_manual: CFLAGS += -D ZDTM_EXTMAP_MANUAL
sigpending: LDLIBS += -lrt
vdso01: LDLIBS += -lrt

View File

@ -5,6 +5,7 @@
#include <sys/socket.h>
#include <linux/if.h>
#include <linux/if_tun.h>
#include <sched.h>
#include "zdtmtst.h"
@ -118,7 +119,10 @@ int main(int argc, char **argv)
char addr[ETH_ALEN], a2[ETH_ALEN];
test_init(argc, argv);
#ifdef TUN_NS
unshare(CLONE_NEWNET);
system("ip link set up dev lo");
#endif
/* fd[0] -- opened file */
fds[0] = __open_tun();
if (fds[0] < 0) {