summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNikolay Aleksandrov <razor@blackwall.org>2026-07-21 17:09:22 +0300
committerJakub Kicinski <kuba@kernel.org>2026-07-22 10:23:18 -0700
commit679eb1e32d2cd1707de4984ca1b6e68f3d8da1ac (patch)
tree56846a94bdc9cf327a52456fa35875c18d18b481 /tools
parent43171c97e4714bf601b468401b37732244639c21 (diff)
downloadlinux-679eb1e32d2cd1707de4984ca1b6e68f3d8da1ac.tar.gz
linux-679eb1e32d2cd1707de4984ca1b6e68f3d8da1ac.tar.bz2
linux-679eb1e32d2cd1707de4984ca1b6e68f3d8da1ac.zip
selftests: net: bridge: test ranges with PVID VLAN
Add a test with PVID VLAN that matches the flags of the VLAN following it and check if the range is properly dumped. PVID VLAN should be on its own and all VLANs should be present in the dump. Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Link: https://patch.msgid.link/20260721140922.682265-3-razor@blackwall.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/bridge_vlan_dump.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/bridge_vlan_dump.sh b/tools/testing/selftests/net/bridge_vlan_dump.sh
index ad66731d2a6f..90e18e2104e3 100755
--- a/tools/testing/selftests/net/bridge_vlan_dump.sh
+++ b/tools/testing/selftests/net/bridge_vlan_dump.sh
@@ -13,6 +13,7 @@ ALL_TESTS="
vlan_range_mcast_max_groups
vlan_range_mcast_n_groups
vlan_range_mcast_enabled
+ vlan_range_pvid
"
setup_prepare()
@@ -191,6 +192,28 @@ vlan_range_mcast_enabled()
log_test "VLAN range grouping with mcast_enabled"
}
+vlan_range_pvid()
+{
+ RET=0
+
+ ip -n "$NS" link set dev br0 type bridge vlan_default_pvid 1
+ check_err $? "Failed to configure default PVID"
+ defer ip -n "$NS" link set dev br0 type bridge vlan_default_pvid 0
+
+ bridge -n "$NS" vlan add vid 2 dev dummy0 untagged
+ check_err $? "Failed to add VLAN 2"
+ defer bridge -n "$NS" vlan del vid 2 dev dummy0
+
+ bridge -n "$NS" -d vlan show dev dummy0 |
+ grep -Eq '(^|[[:space:]])2([[:space:]]|$)'
+ check_err $? "VLAN following PVID is missing from detailed dump"
+
+ bridge -n "$NS" -d vlan show dev dummy0 | grep -q "1-2"
+ check_fail $? "PVID was incorrectly included in a VLAN range"
+
+ log_test "PVID is isolated from VLAN dump ranges"
+}
+
# Verify the newest tested option is supported
if ! bridge vlan help 2>&1 | grep -q "neigh_suppress"; then
echo "SKIP: iproute2 too old, missing per-VLAN neighbor suppression support"