tools/testing/selftests/net/bridge_vlan_dump.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/bridge_vlan_dump.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/bridge_vlan_dump.sh- Extension
.sh- Size
- 7220 bytes
- Lines
- 205
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
#
# Test bridge VLAN range grouping. VLANs are collapsed into a range entry in
# the dump if they have the same per-VLAN options. These tests verify that
# VLANs with different per-VLAN option values are not grouped together.
# shellcheck disable=SC1091,SC2034,SC2154,SC2317
source lib.sh
ALL_TESTS="
vlan_range_neigh_suppress
vlan_range_mcast_max_groups
vlan_range_mcast_n_groups
vlan_range_mcast_enabled
"
setup_prepare()
{
setup_ns NS
defer cleanup_all_ns
ip -n "$NS" link add name br0 type bridge vlan_filtering 1 \
vlan_default_pvid 0 mcast_snooping 1 mcast_vlan_snooping 1
ip -n "$NS" link set dev br0 up
ip -n "$NS" link add name dummy0 type dummy
ip -n "$NS" link set dev dummy0 master br0
ip -n "$NS" link set dev dummy0 up
}
vlan_range_neigh_suppress()
{
RET=0
# Add two new consecutive VLANs for range grouping test
bridge -n "$NS" vlan add vid 10 dev dummy0
defer bridge -n "$NS" vlan del vid 10 dev dummy0
bridge -n "$NS" vlan add vid 11 dev dummy0
defer bridge -n "$NS" vlan del vid 11 dev dummy0
# Configure different neigh_suppress values and verify no range grouping
bridge -n "$NS" vlan set vid 10 dev dummy0 neigh_suppress on
check_err $? "Failed to set neigh_suppress for VLAN 10"
bridge -n "$NS" vlan set vid 11 dev dummy0 neigh_suppress off
check_err $? "Failed to set neigh_suppress for VLAN 11"
# Verify VLANs are not shown as a range, but individual entries exist
bridge -n "$NS" -d vlan show dev dummy0 | grep -q "10-11"
check_fail $? "VLANs with different neigh_suppress incorrectly grouped"
bridge -n "$NS" -d vlan show dev dummy0 | grep -Eq "^\S+\s+10$|^\s+10$"
check_err $? "VLAN 10 individual entry not found"
bridge -n "$NS" -d vlan show dev dummy0 | grep -Eq "^\S+\s+11$|^\s+11$"
check_err $? "VLAN 11 individual entry not found"
# Configure same neigh_suppress value and verify range grouping
bridge -n "$NS" vlan set vid 11 dev dummy0 neigh_suppress on
check_err $? "Failed to set neigh_suppress for VLAN 11"
bridge -n "$NS" -d vlan show dev dummy0 | grep -q "10-11"
check_err $? "VLANs with same neigh_suppress not grouped"
log_test "VLAN range grouping with neigh_suppress"
}
vlan_range_mcast_max_groups()
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.