Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net tests: use rump_server_add_iface to create interfaces



details:   https://anonhg.NetBSD.org/src/rev/16ceb8a7f36f
branches:  trunk
changeset: 453586:16ceb8a7f36f
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Aug 19 03:22:05 2019 +0000

description:
tests: use rump_server_add_iface to create interfaces

diffstat:

 tests/net/arp/t_arp.sh             |   6 +++---
 tests/net/carp/t_basic.sh          |   6 +++---
 tests/net/if_bridge/t_bridge.sh    |   4 ++--
 tests/net/if_bridge/t_rtable.sh    |   4 ++--
 tests/net/if_gif/t_gif.sh          |   8 ++++----
 tests/net/if_ipsec/t_ipsec.sh      |   8 ++++----
 tests/net/if_ipsec/t_ipsec_natt.sh |   4 ++--
 tests/net/if_ipsec/t_ipsec_pfil.sh |   4 ++--
 tests/net/if_l2tp/t_l2tp.sh        |   6 +++---
 tests/net/if_pppoe/t_pppoe.sh      |   6 +++---
 tests/net/if_tap/t_tap.sh          |   8 ++++----
 tests/net/ipsec/t_ipsec_gif.sh     |  10 +++++-----
 tests/net/ipsec/t_ipsec_l2tp.sh    |  18 +++++++++---------
 tests/net/ipsec/t_ipsec_natt.sh    |   6 +++---
 14 files changed, 49 insertions(+), 49 deletions(-)

diffs (truncated from 424 to 300 lines):

diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/arp/t_arp.sh
--- a/tests/net/arp/t_arp.sh    Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/arp/t_arp.sh    Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_arp.sh,v 1.37 2019/05/13 17:55:08 bad Exp $
+#      $NetBSD: t_arp.sh,v 1.38 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -485,7 +485,7 @@
        # Test#1: First setup an endpoint then create proxy arp entry
        #
        export RUMP_SERVER=$SOCKDST
-       atf_check -s exit:0 rump.ifconfig tap1 create
+       rump_server_add_iface $SOCKDST tap1
        atf_check -s exit:0 rump.ifconfig tap1 $IP4DST_PROXYARP1/24 up
        atf_check -s exit:0 rump.ifconfig -w 10
 
@@ -536,7 +536,7 @@
        atf_check -s exit:0 -x "cat ./out |grep -q '$pkt'"
 
        export RUMP_SERVER=$SOCKDST
-       atf_check -s exit:0 rump.ifconfig tap2 create
+       rump_server_add_iface $SOCKDST tap2
        atf_check -s exit:0 rump.ifconfig tap2 $IP4DST_PROXYARP2/24 up
        atf_check -s exit:0 rump.ifconfig -w 10
 
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/carp/t_basic.sh
--- a/tests/net/carp/t_basic.sh Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/carp/t_basic.sh Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_basic.sh,v 1.7 2017/08/03 03:16:26 ozaki-r Exp $
+#      $NetBSD: t_basic.sh,v 1.8 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -60,7 +60,7 @@
                atf_check -s exit:0 -o match:'0.->.1' \
                    rump.sysctl -w net.inet.carp.log=1
        fi
-       atf_check -s exit:0 rump.ifconfig $carpif create
+       rump_server_add_iface $sock $carpif
        if [ $carpdevip = yes ]; then
                atf_check -s exit:0 rump.ifconfig shmif0 $ip/24 up
                atf_check -s exit:0 rump.ifconfig $carpif \
@@ -200,7 +200,7 @@
                atf_check -s exit:0 -o match:'0.->.1' \
                    rump.sysctl -w net.inet.carp.log=1
        fi
-       atf_check -s exit:0 rump.ifconfig $carpif create
+       rump_server_add_iface $sock $carpif
        if [ $carpdevip = yes ]; then
                atf_check -s exit:0 rump.ifconfig shmif0 inet6 $ip up
                atf_check -s exit:0 rump.ifconfig $carpif inet6 \
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_bridge/t_bridge.sh
--- a/tests/net/if_bridge/t_bridge.sh   Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_bridge/t_bridge.sh   Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_bridge.sh,v 1.18 2018/02/01 05:22:01 ozaki-r Exp $
+#      $NetBSD: t_bridge.sh,v 1.19 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -169,7 +169,7 @@
 setup_bridge()
 {
        export RUMP_SERVER=$SOCK2
-       atf_check -s exit:0 rump.ifconfig bridge0 create
+       rump_server_add_iface $SOCK2 bridge0
        atf_check -s exit:0 rump.ifconfig bridge0 up
 
        export LD_PRELOAD=/usr/lib/librumphijack.so
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_bridge/t_rtable.sh
--- a/tests/net/if_bridge/t_rtable.sh   Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_bridge/t_rtable.sh   Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_rtable.sh,v 1.6 2019/07/09 02:50:24 ozaki-r Exp $
+#      $NetBSD: t_rtable.sh,v 1.7 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -79,7 +79,7 @@
 {
 
        export RUMP_SERVER=$SOCK2
-       atf_check -s exit:0 rump.ifconfig bridge0 create
+       rump_server_add_iface $SOCK2 bridge0
        atf_check -s exit:0 rump.ifconfig bridge0 up
 
        export LD_PRELOAD=/usr/lib/librumphijack.so
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_gif/t_gif.sh
--- a/tests/net/if_gif/t_gif.sh Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_gif/t_gif.sh Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_gif.sh,v 1.12 2018/02/01 05:22:01 ozaki-r Exp $
+#      $NetBSD: t_gif.sh,v 1.13 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -221,7 +221,7 @@
        peernet=${7}
 
        export RUMP_SERVER=${sock}
-       atf_check -s exit:0 rump.ifconfig gif0 create
+       rump_server_add_iface $sock gif0
        atf_check -s exit:0 rump.ifconfig gif0 tunnel ${src} ${dst}
        if [ ${inner} = "ipv6" ]; then
                atf_check -s exit:0 rump.ifconfig gif0 inet6 ${addr}/128 ${remote}
@@ -335,7 +335,7 @@
        dst=${6}
 
        export RUMP_SERVER=${sock}
-       atf_check -s exit:0 rump.ifconfig gif1 create
+       rump_server_add_iface $sock gif1
        atf_check -s exit:0 rump.ifconfig gif1 tunnel ${src} ${dst}
        if [ ${inner} = "ipv6" ]; then
                atf_check -s exit:0 rump.ifconfig gif1 inet6 ${addr}/128 ${remote}
@@ -422,7 +422,7 @@
        dst=${7}
 
        export RUMP_SERVER=${sock}
-       atf_check -s exit:0 rump.ifconfig ${gif} create
+       rump_server_add_iface $sock $gif
        atf_check -s exit:0 rump.ifconfig ${gif} tunnel ${src} ${dst}
        if [ ${inner} = "ipv6" ]; then
                atf_check -s exit:0 rump.ifconfig ${gif} inet6 ${addr}/128 ${remote}
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_ipsec/t_ipsec.sh
--- a/tests/net/if_ipsec/t_ipsec.sh     Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_ipsec/t_ipsec.sh     Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec.sh,v 1.9 2019/01/15 05:34:37 knakahara Exp $
+#      $NetBSD: t_ipsec.sh,v 1.10 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -243,7 +243,7 @@
        local peernet=${7}
 
        export RUMP_SERVER=${sock}
-       atf_check -s exit:0 rump.ifconfig ipsec0 create
+       rump_server_add_iface $sock ipsec0
        atf_check -s exit:0 rump.ifconfig ipsec0 tunnel ${src} ${dst}
        if [ ${inner} = "ipv6" ]; then
                atf_check -s exit:0 rump.ifconfig ipsec0 inet6 ${addr}/128 ${remote}
@@ -426,7 +426,7 @@
        local dst=${6}
 
        export RUMP_SERVER=${sock}
-       atf_check -s exit:0 rump.ifconfig ipsec1 create
+       rump_server_add_iface $sock ipsec1
        atf_check -s exit:0 rump.ifconfig ipsec1 tunnel ${src} ${dst}
        if [ ${inner} = "ipv6" ]; then
                atf_check -s exit:0 rump.ifconfig ipsec1 inet6 ${addr}/128 ${remote}
@@ -568,7 +568,7 @@
        local dir=${10}
 
        export RUMP_SERVER=${sock}
-       atf_check -s exit:0 rump.ifconfig ${ipsec} create
+       rump_server_add_iface $sock $ipsec
        atf_check -s exit:0 rump.ifconfig ${ipsec} tunnel ${src} ${dst}
        if [ ${inner} = "ipv6" ]; then
                atf_check -s exit:0 rump.ifconfig ${ipsec} inet6 ${addr}/128 ${remote}
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_ipsec/t_ipsec_natt.sh
--- a/tests/net/if_ipsec/t_ipsec_natt.sh        Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_ipsec/t_ipsec_natt.sh        Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec_natt.sh,v 1.2 2018/12/26 08:59:41 knakahara Exp $
+#      $NetBSD: t_ipsec_natt.sh,v 1.3 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2018 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -61,7 +61,7 @@
        local peer_ip=$8
 
        export RUMP_SERVER=$sock
-       atf_check -s exit:0 rump.ifconfig ipsec$ifid create
+       rump_server_add_iface $sock ipsec$ifid
        atf_check -s exit:0 rump.ifconfig ipsec$ifid link0 # enable NAT-T
        atf_check -s exit:0 rump.ifconfig ipsec$ifid tunnel ${src_ip},${src_port} ${dst_ip},${dst_port}
        atf_check -s exit:0 rump.ifconfig ipsec$ifid ${ipsecif_ip}/32
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_ipsec/t_ipsec_pfil.sh
--- a/tests/net/if_ipsec/t_ipsec_pfil.sh        Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_ipsec/t_ipsec_pfil.sh        Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec_pfil.sh,v 1.1 2019/01/17 02:49:11 knakahara Exp $
+#      $NetBSD: t_ipsec_pfil.sh,v 1.2 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2019 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -75,7 +75,7 @@
        local dst=$4
        local peernet=$5
 
-       atf_check -s exit:0 rump.ifconfig ipsec0 create
+       rump_server_add_iface $RUMP_SERVER ipsec0
        atf_check -s exit:0 rump.ifconfig ipsec0 tunnel $src $dst
        atf_check -s exit:0 rump.ifconfig ipsec0 inet ${addr}/32 $remote
        atf_check -s exit:0 -o ignore rump.route add -inet $peernet $addr
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_l2tp/t_l2tp.sh
--- a/tests/net/if_l2tp/t_l2tp.sh       Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_l2tp/t_l2tp.sh       Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_l2tp.sh,v 1.4 2018/02/01 05:22:01 ozaki-r Exp $
+#      $NetBSD: t_l2tp.sh,v 1.5 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -227,12 +227,12 @@
 
        export RUMP_SERVER=${sock}
 
-       atf_check -s exit:0 rump.ifconfig l2tp0 create
+       rump_server_add_iface $sock l2tp0
        atf_check -s exit:0 rump.ifconfig l2tp0 tunnel ${src} ${dst}
        atf_check -s exit:0 rump.ifconfig l2tp0 session ${src_session} ${dst_session}
        atf_check -s exit:0 rump.ifconfig l2tp0 up
 
-       atf_check -s exit:0 rump.ifconfig bridge0 create
+       rump_server_add_iface $sock bridge0
        atf_check -s exit:0 rump.ifconfig bridge0 up
        export LD_PRELOAD=/usr/lib/librumphijack.so
        atf_check -s exit:0 brconfig bridge0 add shmif0
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_pppoe/t_pppoe.sh
--- a/tests/net/if_pppoe/t_pppoe.sh     Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_pppoe/t_pppoe.sh     Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_pppoe.sh,v 1.18 2018/02/01 05:22:01 ozaki-r Exp $
+#      $NetBSD: t_pppoe.sh,v 1.19 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -79,7 +79,7 @@
        export RUMP_SERVER=$SERVER
        atf_check -s exit:0 rump.ifconfig shmif0 up
 
-       atf_check -s exit:0 rump.ifconfig pppoe0 create
+       rump_server_add_iface $SERVER pppoe0
        $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
            inet $SERVER_IP $CLIENT_IP down
        atf_check -s exit:0 rump.ifconfig pppoe0 link0
@@ -93,7 +93,7 @@
        export RUMP_SERVER=$CLIENT
        atf_check -s exit:0 rump.ifconfig shmif0 up
 
-       atf_check -s exit:0 rump.ifconfig pppoe0 create
+       rump_server_add_iface $CLIENT pppoe0
        $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
            inet 0.0.0.0 0.0.0.1 down
 
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/if_tap/t_tap.sh
--- a/tests/net/if_tap/t_tap.sh Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/if_tap/t_tap.sh Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_tap.sh,v 1.9 2019/05/13 17:55:08 bad Exp $
+#      $NetBSD: t_tap.sh,v 1.10 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -97,7 +97,7 @@
        export RUMP_SERVER=${SOCK_LOCAL}
        atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL delete
        atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL delete
-       atf_check -s exit:0 rump.ifconfig tap0 create
+       rump_server_add_iface $SOCK_LOCAL tap0
        atf_check -s exit:0 rump.ifconfig tap0 $IP4_TAP
        atf_check -s exit:0 rump.ifconfig tap0 inet6 $IP6_TAP
        atf_check -s exit:0 rump.ifconfig tap0 up
@@ -142,13 +142,13 @@
        atf_check -s exit:0 rump.ifconfig shmif0 $IP4_LOCAL
        atf_check -s exit:0 rump.ifconfig shmif0 inet6 $IP6_LOCAL
        atf_check -s exit:0 rump.ifconfig shmif0 up
-       atf_check -s exit:0 rump.ifconfig tap0 create
+       rump_server_add_iface $SOCK_LOCAL tap0
        atf_check -s exit:0 rump.ifconfig tap0 $IP4_TAP
        atf_check -s exit:0 rump.ifconfig tap0 inet6 $IP6_TAP
        atf_check -s exit:0 rump.ifconfig tap0 up
        atf_check -s exit:0 rump.ifconfig -w 10
 
-       atf_check -s exit:0 rump.ifconfig bridge0 create
+       rump_server_add_iface $SOCK_LOCAL bridge0
        atf_check -s exit:0 rump.ifconfig bridge0 up
        export LD_PRELOAD=/usr/lib/librumphijack.so
        atf_check -s exit:0 brconfig bridge0 add shmif0
diff -r 54417aa236a6 -r 16ceb8a7f36f tests/net/ipsec/t_ipsec_gif.sh
--- a/tests/net/ipsec/t_ipsec_gif.sh    Mon Aug 19 03:21:13 2019 +0000
+++ b/tests/net/ipsec/t_ipsec_gif.sh    Mon Aug 19 03:22:05 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec_gif.sh,v 1.7 2017/08/03 03:16:27 ozaki-r Exp $
+#      $NetBSD: t_ipsec_gif.sh,v 1.8 2019/08/19 03:22:05 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -98,7 +98,7 @@
        export RUMP_SERVER=$SOCK_TUN_LOCAL
        atf_check -s exit:0 rump.ifconfig shmif0 $ip_gw_local/24
        atf_check -s exit:0 rump.ifconfig shmif1 $ip_gwlo_tun/24
-       atf_check -s exit:0 rump.ifconfig gif0 create
+       rump_server_add_iface $SOCK_TUN_LOCAL gif0
        atf_check -s exit:0 rump.ifconfig gif0 \
            tunnel $ip_gwlo_tun $ip_gwre_tun



Home | Main Index | Thread Index | Old Index