Source-Changes-HG archive

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

[src/trunk]: src/tests/net/if_vlan Added tests for changing a MTU when the vl...



details:   https://anonhg.NetBSD.org/src/rev/e6683dfbc29a
branches:  trunk
changeset: 380031:e6683dfbc29a
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Fri Jul 02 04:38:10 2021 +0000

description:
Added tests for changing a MTU when the vlan(4) is added to bridge(4)

The tests is for PR kern/56292

diffstat:

 tests/net/if_vlan/t_vlan.sh |  51 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 42 insertions(+), 9 deletions(-)

diffs (75 lines):

diff -r 219f6a59a15e -r e6683dfbc29a tests/net/if_vlan/t_vlan.sh
--- a/tests/net/if_vlan/t_vlan.sh       Fri Jul 02 03:30:46 2021 +0000
+++ b/tests/net/if_vlan/t_vlan.sh       Fri Jul 02 04:38:10 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_vlan.sh,v 1.17 2020/03/08 09:05:33 nisimura Exp $
+#      $NetBSD: t_vlan.sh,v 1.18 2021/07/02 04:38:10 yamaguchi Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -669,6 +669,7 @@ vlan_configs6_cleanup()
 vlan_bridge_body_common()
 {
        local atf_ifconfig="atf_check -s exit:0 rump.ifconfig"
+       local atf_brconfig="atf_check -s exit:0 $HIJACKING /sbin/brconfig"
 
        rump_server_add_iface $SOCK_LOCAL shmif0 $BUS
 
@@ -681,17 +682,49 @@ vlan_bridge_body_common()
        $DEBUG && rump.ifconfig vlan0
 
        $atf_ifconfig bridge0 create
-       # Adjust to the MTU of a vlan on a shmif
+       $atf_ifconfig bridge0 up
+
+       #
+       # Add vlan to bridge member
+       #
        $atf_ifconfig bridge0 mtu 1496
-       $atf_ifconfig bridge0 up
-       # Test brconfig add
-       atf_check -s exit:0 $HIJACKING brconfig bridge0 add vlan0
+       atf_check -s exit:0 -o match:'mtu 1496' rump.ifconfig vlan0
+
+       $atf_brconfig bridge0 add vlan0
+       $DEBUG && brconfig bridge0
+       $atf_brconfig bridge0 delete vlan0
+
+       #
+       # decrease MTU on adding to bridge member
+       #
+       $atf_ifconfig bridge0 mtu 1495
+       atf_check -s exit:0 -o match:'mtu 1496' rump.ifconfig vlan0
+
+       $atf_brconfig bridge0 add vlan0
        $DEBUG && brconfig bridge0
-       # Test brconfig delete
-       atf_check -s exit:0 $HIJACKING brconfig bridge0 delete vlan0
+       atf_check -s exit:0 -o match:'mtu 1495' rump.ifconfig vlan0
+       $atf_brconfig bridge0 delete vlan0
+
+       #
+       # increase MTU on adding to bridge member
+       #
+       $atf_ifconfig bridge0 mtu 1496
+       $atf_ifconfig vlan0 mtu 1495
+       $atf_brconfig bridge0 add vlan0
 
-       atf_check -s exit:0 $HIJACKING brconfig bridge0 add vlan0
-       # Test vlan destruction with bridge
+       $DEBUG && brconfig bridge0
+       atf_check -s exit:0 -o match:'mtu 1496' rump.ifconfig vlan0
+       $atf_brconfig bridge0 delete vlan0
+
+       $atf_ifconfig bridge0 mtu 1497
+       atf_check -s not-exit:0 -o ignore -e ignore \
+           /sbin/brconfig bridge0 add vlan0
+
+       #
+       # Destroy a vlan interface that is bridge member
+       #
+       $atf_ifconfig bridge0 mtu 1496
+       $atf_brconfig bridge0 add vlan0
        $atf_ifconfig vlan0 destroy
 
        rump_server_destroy_ifaces



Home | Main Index | Thread Index | Old Index