tools/testing/selftests/net/vlan_bridge_binding.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/vlan_bridge_binding.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/vlan_bridge_binding.sh- Extension
.sh- Size
- 4690 bytes
- Lines
- 259
- 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
source lib.sh
ALL_TESTS="
test_binding_on
test_binding_off
test_binding_toggle_on
test_binding_toggle_off
test_binding_toggle_on_when_upper_down
test_binding_toggle_off_when_upper_down
test_binding_toggle_on_when_lower_down
test_binding_toggle_off_when_lower_down
"
setup_prepare()
{
local port
adf_ip_link_add br up type bridge vlan_filtering 1
for port in d1 d2 d3; do
adf_ip_link_add $port type veth peer name r$port
adf_ip_link_set_up $port
adf_ip_link_set_up r$port
adf_ip_link_set_master $port br
done
adf_bridge_vlan_add vid 11 dev br self
adf_bridge_vlan_add vid 11 dev d1 master
adf_bridge_vlan_add vid 12 dev br self
adf_bridge_vlan_add vid 12 dev d2 master
adf_bridge_vlan_add vid 13 dev br self
adf_bridge_vlan_add vid 13 dev d1 master
adf_bridge_vlan_add vid 13 dev d2 master
adf_bridge_vlan_add vid 14 dev br self
adf_bridge_vlan_add vid 14 dev d1 master
adf_bridge_vlan_add vid 14 dev d2 master
adf_bridge_vlan_add vid 14 dev d3 master
}
operstate_is()
{
local dev=$1; shift
local expect=$1; shift
local operstate=$(ip -j link show $dev | jq -r .[].operstate)
if [[ $operstate == UP ]]; then
operstate=1
elif [[ $operstate == DOWN || $operstate == LOWERLAYERDOWN ]]; then
operstate=0
fi
echo -n $operstate
[[ $operstate == $expect ]]
}
check_operstate()
{
local dev=$1; shift
local expect=$1; shift
local operstate
operstate=$(busywait 1000 \
operstate_is "$dev" "$expect")
check_err $? "Got operstate of $operstate, expected $expect"
}
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.