Source-Changes-HG archive

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

[src/trunk]: src/tests/net Commonalize and add tests of creating/destroying i...



details:   https://anonhg.NetBSD.org/src/rev/db9b6bf3577a
branches:  trunk
changeset: 829446:db9b6bf3577a
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Feb 01 05:22:01 2018 +0000

description:
Commonalize and add tests of creating/destroying interfaces

diffstat:

 tests/net/if_bridge/t_bridge.sh |  27 ++++++++++++++++++++++++-
 tests/net/if_gif/t_gif.sh       |  28 +++++++++++++++++++++++++-
 tests/net/if_ipsec/t_ipsec.sh   |  28 +++++++++++++++++++++++++-
 tests/net/if_l2tp/t_l2tp.sh     |  28 +++++++++++++++++++++++++-
 tests/net/if_loop/t_basic.sh    |   9 +------
 tests/net/if_pppoe/t_pppoe.sh   |  27 ++++++++++++++++++++++++-
 tests/net/if_tap/t_tap.sh       |  20 +----------------
 tests/net/if_tun/Makefile       |   7 ++++-
 tests/net/if_tun/t_tun.sh       |   9 +------
 tests/net/if_vlan/t_vlan.sh     |   5 +++-
 tests/net/net_common.sh         |  44 ++++++++++++++++++++++++++++++++++++++++-
 11 files changed, 191 insertions(+), 41 deletions(-)

diffs (truncated from 435 to 300 lines):

diff -r 13d836f9e037 -r db9b6bf3577a tests/net/if_bridge/t_bridge.sh
--- a/tests/net/if_bridge/t_bridge.sh   Thu Feb 01 03:32:31 2018 +0000
+++ b/tests/net/if_bridge/t_bridge.sh   Thu Feb 01 05:22:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_bridge.sh,v 1.17 2017/03/11 04:24:52 ozaki-r Exp $
+#      $NetBSD: t_bridge.sh,v 1.18 2018/02/01 05:22:01 ozaki-r Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,11 +40,19 @@
 DEBUG=${DEBUG:-false}
 TIMEOUT=5
 
+atf_test_case bridge_create_destroy cleanup
 atf_test_case bridge_ipv4 cleanup
 atf_test_case bridge_ipv6 cleanup
 atf_test_case bridge_member_ipv4 cleanup
 atf_test_case bridge_member_ipv6 cleanup
 
+bridge_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying bridge interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
 bridge_ipv4_head()
 {
        atf_set "descr" "Does simple if_bridge tests"
@@ -312,6 +320,14 @@
        rump.ifconfig -v shmif0
 }
 
+bridge_create_destroy_body()
+{
+
+       rump_server_start $SOCK1 bridge
+
+       test_create_destroy_common $SOCK1 bridge0
+}
+
 bridge_ipv4_body()
 {
        setup
@@ -392,6 +408,13 @@
        rump_server_destroy_ifaces
 }
 
+bridge_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 bridge_ipv4_cleanup()
 {
 
@@ -422,6 +445,8 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case bridge_create_destroy
        atf_add_test_case bridge_ipv4
        atf_add_test_case bridge_ipv6
        atf_add_test_case bridge_member_ipv4
diff -r 13d836f9e037 -r db9b6bf3577a tests/net/if_gif/t_gif.sh
--- a/tests/net/if_gif/t_gif.sh Thu Feb 01 03:32:31 2018 +0000
+++ b/tests/net/if_gif/t_gif.sh Thu Feb 01 05:22:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_gif.sh,v 1.11 2017/08/03 03:16:26 ozaki-r Exp $
+#      $NetBSD: t_gif.sh,v 1.12 2018/02/01 05:22:01 ozaki-r Exp $
 #
 # Copyright (c) 2015 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -64,6 +64,29 @@
 DEBUG=${DEBUG:-false}
 TIMEOUT=5
 
+atf_test_case gif_create_destroy cleanup
+gif_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying gif interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
+gif_create_destroy_body()
+{
+
+       rump_server_start $SOCK1 netinet6 gif
+
+       test_create_destroy_common $SOCK1 gif0 true
+}
+
+gif_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 setup_router()
 {
        sock=${1}
@@ -757,6 +780,9 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case gif_create_destroy
+
        add_test_allproto basic "basic tests"
        add_test_allproto ioctl "ioctl tests"
        add_test_allproto recursive "recursive check tests"
diff -r 13d836f9e037 -r db9b6bf3577a tests/net/if_ipsec/t_ipsec.sh
--- a/tests/net/if_ipsec/t_ipsec.sh     Thu Feb 01 03:32:31 2018 +0000
+++ b/tests/net/if_ipsec/t_ipsec.sh     Thu Feb 01 05:22:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_ipsec.sh,v 1.2 2018/01/11 07:58:22 ozaki-r Exp $
+#      $NetBSD: t_ipsec.sh,v 1.3 2018/02/01 05:22:01 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -64,6 +64,29 @@
 DEBUG=${DEBUG:-false}
 TIMEOUT=7
 
+atf_test_case ipsecif_create_destroy cleanup
+ipsecif_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying gif interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
+ipsecif_create_destroy_body()
+{
+
+       rump_server_start $SOCK1 ipsec
+
+       test_create_destroy_common $SOCK1 ipsec0
+}
+
+ipsecif_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 setup_router()
 {
        local sock=${1}
@@ -919,6 +942,9 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case ipsecif_create_destroy
+
        add_test_allproto basic "basic tests"
        add_test_allproto ioctl "ioctl tests"
        add_test_allproto recursive "recursive check tests"
diff -r 13d836f9e037 -r db9b6bf3577a tests/net/if_l2tp/t_l2tp.sh
--- a/tests/net/if_l2tp/t_l2tp.sh       Thu Feb 01 03:32:31 2018 +0000
+++ b/tests/net/if_l2tp/t_l2tp.sh       Thu Feb 01 05:22:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_l2tp.sh,v 1.3 2017/08/03 03:16:26 ozaki-r Exp $
+#      $NetBSD: t_l2tp.sh,v 1.4 2018/02/01 05:22:01 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -49,6 +49,29 @@
 TIMEOUT=5
 DEBUG=${DEBUG:-false}
 
+atf_test_case l2tp_create_destroy cleanup
+l2tp_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying l2tp interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
+l2tp_create_destroy_body()
+{
+
+       rump_server_start $LAC1SOCK l2tp
+
+       test_create_destroy_common $LAC1SOCK l2tp0
+}
+
+l2tp_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 setup_lac()
 {
        sock=${1}
@@ -435,6 +458,9 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case l2tp_create_destroy
+
        add_test_allproto basic "basic tests"
 #      add_test_allproto recursive "recursive check tests"
 }
diff -r 13d836f9e037 -r db9b6bf3577a tests/net/if_loop/t_basic.sh
--- a/tests/net/if_loop/t_basic.sh      Thu Feb 01 03:32:31 2018 +0000
+++ b/tests/net/if_loop/t_basic.sh      Thu Feb 01 05:22:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_basic.sh,v 1.1 2017/02/28 03:32:11 ozaki-r Exp $
+#      $NetBSD: t_basic.sh,v 1.2 2018/02/01 05:22:01 ozaki-r Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -41,12 +41,7 @@
 
        rump_server_start $SOCK_LOCAL netinet6
 
-       export RUMP_SERVER=${SOCK_LOCAL}
-
-       atf_check -s exit:0 rump.ifconfig lo1 create
-       atf_check -s exit:0 rump.ifconfig lo1 up
-       atf_check -s exit:0 rump.ifconfig lo1 down
-       atf_check -s exit:0 rump.ifconfig lo1 destroy
+       test_create_destroy_common $SOCK_LOCAL lo1 true
 }
 
 loop_create_destroy_cleanup()
diff -r 13d836f9e037 -r db9b6bf3577a tests/net/if_pppoe/t_pppoe.sh
--- a/tests/net/if_pppoe/t_pppoe.sh     Thu Feb 01 03:32:31 2018 +0000
+++ b/tests/net/if_pppoe/t_pppoe.sh     Thu Feb 01 05:22:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_pppoe.sh,v 1.17 2017/03/28 01:27:46 ozaki-r Exp $
+#      $NetBSD: t_pppoe.sh,v 1.18 2018/02/01 05:22:01 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -39,6 +39,29 @@
 WAITTIME=10
 DEBUG=${DEBUG:-false}
 
+atf_test_case pppoe_create_destroy cleanup
+pppoe_create_destroy_head()
+{
+
+       atf_set "descr" "Test creating/destroying pppoe interfaces"
+       atf_set "require.progs" "rump_server"
+}
+
+pppoe_create_destroy_body()
+{
+
+       rump_server_start $CLIENT netinet6 pppoe
+
+       test_create_destroy_common $CLIENT pppoe0 true
+}
+
+pppoe_create_destroy_cleanup()
+{
+
+       $DEBUG && dump
+       cleanup
+}
+
 setup()
 {
        inet=true
@@ -403,6 +426,8 @@
 
 atf_init_test_cases()
 {
+
+       atf_add_test_case pppoe_create_destroy
        atf_add_test_case pppoe_pap
        atf_add_test_case pppoe_chap
        atf_add_test_case pppoe6_pap
diff -r 13d836f9e037 -r db9b6bf3577a tests/net/if_tap/t_tap.sh
--- a/tests/net/if_tap/t_tap.sh Thu Feb 01 03:32:31 2018 +0000
+++ b/tests/net/if_tap/t_tap.sh Thu Feb 01 05:22:01 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_tap.sh,v 1.6 2016/11/25 08:51:16 ozaki-r Exp $
+#      $NetBSD: t_tap.sh,v 1.7 2018/02/01 05:22:02 ozaki-r Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -51,23 +51,7 @@
 
        rump_server_start $SOCK_LOCAL netinet6 tap
 
-       export RUMP_SERVER=${SOCK_LOCAL}
-



Home | Main Index | Thread Index | Old Index