tools/testing/selftests/net/test_bridge_backup_port.sh
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/test_bridge_backup_port.sh
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/test_bridge_backup_port.sh- Extension
.sh- Size
- 29041 bytes
- Lines
- 799
- 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
#
# This test is for checking bridge backup port and backup nexthop ID
# functionality. The topology consists of two bridge (VTEPs) connected using
# VXLAN. The test checks that when the switch port (swp1) is down, traffic is
# redirected to the VXLAN port (vx0). When a backup nexthop ID is configured,
# the test checks that traffic is redirected with the correct nexthop
# information.
#
# +------------------------------------+ +------------------------------------+
# | + swp1 + vx0 | | + swp1 + vx0 |
# | | | | | | | |
# | | br0 | | | | | |
# | +------------+-----------+ | | +------------+-----------+ |
# | | | | | |
# | | | | | |
# | + | | + |
# | br0 | | br0 |
# | + | | + |
# | | | | | |
# | | | | | |
# | + | | + |
# | br0.10 | | br0.10 |
# | 192.0.2.65/28 | | 192.0.2.66/28 |
# | | | |
# | | | |
# | 192.0.2.33 | | 192.0.2.34 |
# | + lo | | + lo |
# | | | |
# | | | |
# | 192.0.2.49/28 | | 192.0.2.50/28 |
# | veth0 +-------+ veth0 |
# | | | |
# | sw1 | | sw2 |
# +------------------------------------+ +------------------------------------+
source lib.sh
ret=0
# All tests in this script. Can be overridden with -t option.
TESTS="
backup_port
backup_nhid
backup_nhid_invalid
backup_nhid_ping
backup_nhid_torture
"
VERBOSE=0
PAUSE_ON_FAIL=no
PAUSE=no
PING_TIMEOUT=5
################################################################################
# Utilities
log_test()
{
local rc=$1
local expected=$2
local msg="$3"
if [ ${rc} -eq ${expected} ]; then
printf "TEST: %-60s [ OK ]\n" "${msg}"
nsuccess=$((nsuccess+1))
else
ret=1
nfail=$((nfail+1))
printf "TEST: %-60s [FAIL]\n" "${msg}"
if [ "$VERBOSE" = "1" ]; then
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.