tools/testing/selftests/net/forwarding/bridge_activity_notify.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/forwarding/bridge_activity_notify.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/forwarding/bridge_activity_notify.sh
Extension
.sh
Size
4534 bytes
Lines
171
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.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

# +-----------------------+                          +------------------------+
# | H1 (vrf)              |                          | H2 (vrf)               |
# | 192.0.2.1/28          |                          | 192.0.2.2/28           |
# |    + $h1              |                          |    + $h2               |
# +----|------------------+                          +----|-------------------+
#      |                                                  |
# +----|--------------------------------------------------|-------------------+
# | SW |                                                  |                   |
# | +--|--------------------------------------------------|-----------------+ |
# | |  + $swp1                   BR1 (802.1d)             + $swp2           | |
# | |                                                                       | |
# | +-----------------------------------------------------------------------+ |
# +---------------------------------------------------------------------------+

ALL_TESTS="
	new_inactive_test
	existing_active_test
	norefresh_test
"

NUM_NETIFS=4
source lib.sh

h1_create()
{
	adf_simple_if_init "$h1" 192.0.2.1/28
}

h2_create()
{
	adf_simple_if_init "$h2" 192.0.2.2/28
}

switch_create()
{
	adf_ip_link_add br1 type bridge vlan_filtering 0 mcast_snooping 0 \
		ageing_time "$LOW_AGEING_TIME"
	adf_ip_link_set_up br1

	adf_ip_link_set_master "$swp1" br1
	adf_ip_link_set_up "$swp1"

	adf_ip_link_set_master "$swp2" br1
	adf_ip_link_set_up "$swp2"
}

setup_prepare()
{
	h1=${NETIFS[p1]}
	swp1=${NETIFS[p2]}

	swp2=${NETIFS[p3]}
	h2=${NETIFS[p4]}

	adf_vrf_prepare

	h1_create
	h2_create
	switch_create
}

fdb_active_wait()
{
	local mac=$1; shift

	bridge -d fdb get "$mac" br br1 | grep -q -v "inactive"
}

Annotation

Implementation Notes