Update the test case for MTU of lag to adapt new behavior

This commit is contained in:
yamaguchi 2023-10-18 06:41:00 +00:00
parent 2bbefb4238
commit e8037d3f57
1 changed files with 16 additions and 28 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: t_lagg.sh,v 1.9 2023/10/16 07:57:40 yamaguchi Exp $
# $NetBSD: t_lagg.sh,v 1.10 2023/10/18 06:41:00 yamaguchi Exp $
#
# Copyright (c) 2021 Internet Initiative Japan Inc.
# All rights reserved.
@ -367,6 +367,7 @@ lagg_mtu_head()
lagg_mtu_body()
{
local atf_ifconfig="atf_check -s exit:0 rump.ifconfig"
local mtu_lagg=1500
local mtu_1st=1450
local mtu_big=1460
local mtu_small=1440
@ -379,60 +380,47 @@ lagg_mtu_body()
rump_server_add_iface $SOCK_HOST0 shmif2 $BUS2
$atf_ifconfig lagg0 create
$atf_ifconfig lagg0 laggproto lacp
$atf_ifconfig lagg0 up
$atf_ifconfig shmif0 mtu $mtu_1st
$atf_ifconfig shmif1 mtu $mtu_big
$atf_ifconfig shmif2 mtu $mtu_small
atf_check -s exit:0 -o match:"mtu *1500" rump.ifconfig lagg0
# check initial MTU settings
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_big" rump.ifconfig shmif1
atf_check -s exit:0 -o match:"mtu *$mtu_small" rump.ifconfig shmif2
# copy MTU from 1st port
$atf_ifconfig lagg0 laggport shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig shmif0
# copy MTU to added port
$atf_ifconfig lagg0 laggport shmif1
$atf_ifconfig lagg0 laggport shmif2
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif1
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif2
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig shmif1
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig shmif2
# reset MTU after detaching from lagg0
$atf_ifconfig lagg0 -laggport shmif2
atf_check -s exit:0 -o match:"mtu *$mtu_small" rump.ifconfig shmif2
# change MTU of lagg0
$atf_ifconfig lagg0 up
$atf_ifconfig lagg0 mtu 1500
atf_check -s exit:0 -o match:"mtu *1500" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *1500" rump.ifconfig shmif0
atf_check -s exit:0 -o match:"mtu *1500" rump.ifconfig shmif1
mtu_lagg=1400
$atf_ifconfig lagg0 mtu $mtu_lagg
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_lagg" rump.ifconfig shmif1
# reset MTU after detching from lagg0
$atf_ifconfig lagg0 -laggport shmif0
$atf_ifconfig lagg0 -laggport shmif1
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_big" rump.ifconfig shmif1
# MTU should not be changed
atf_check -s exit:0 -o match:"mtu *1500" rump.ifconfig lagg0
# copy MTU from 1st port even when MTU of lagg0 is changhed
$atf_ifconfig lagg0 mtu 1400
atf_check -s exit:0 -o match:"mtu *1400" rump.ifconfig lagg0
$atf_ifconfig lagg0 laggport shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif0
# MTU of lagg0 need not reset
$atf_ifconfig lagg0 -laggport shmif0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig lagg0
atf_check -s exit:0 -o match:"mtu *$mtu_1st" rump.ifconfig shmif0
}
lagg_mtu_cleanup()