From: Petr Machata Date: Mon, 31 Jul 2023 15:47:15 +0000 (+0200) Subject: selftests: router_bridge: Add remastering tests X-Git-Tag: v6.6.17~4098^2~264^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb1388553ef4f30d75ed7d5b8eb55ed849f685b5;p=platform%2Fkernel%2Flinux-rpi.git selftests: router_bridge: Add remastering tests Add two tests to deslave a port from and reenslave to a bridge. This should retain the ability of the system to forward traffic, but on an offloading driver that is sensitive to ordering of operations, it might not. The first test does this configuration in a way that relies on vlan_default_pvid to assign the PVID. The second test disables that autoconfiguration and configures PVID by hand in a separate step. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/forwarding/router_bridge.sh b/tools/testing/selftests/net/forwarding/router_bridge.sh index 4f33db0..0182eb2 100755 --- a/tools/testing/selftests/net/forwarding/router_bridge.sh +++ b/tools/testing/selftests/net/forwarding/router_bridge.sh @@ -22,12 +22,18 @@ ALL_TESTS=" ping_ipv4 ping_ipv6 + config_remaster + ping_ipv4 + ping_ipv6 config_remove_pvid ping_ipv4_fails ping_ipv6_fails config_add_pvid ping_ipv4 ping_ipv6 + config_late_pvid + ping_ipv4 + ping_ipv6 " NUM_NETIFS=4 source lib.sh @@ -86,6 +92,15 @@ router_destroy() ip link del dev br1 } +config_remaster() +{ + log_info "Remaster bridge slave" + + ip link set dev $swp1 nomaster + sleep 2 + ip link set dev $swp1 master br1 +} + config_remove_pvid() { log_info "Remove PVID from the bridge" @@ -102,6 +117,17 @@ config_add_pvid() sleep 2 } +config_late_pvid() +{ + log_info "Add bridge PVID after enslaving port" + + ip link set dev $swp1 nomaster + ip link set dev br1 type bridge vlan_default_pvid 0 + sleep 2 + ip link set dev $swp1 master br1 + ip link set dev br1 type bridge vlan_default_pvid 1 +} + setup_prepare() { h1=${NETIFS[p1]}