tools/testing/selftests/net/fdb_flush.sh

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/fdb_flush.sh
Extension
.sh
Size
21544 bytes
Lines
814
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
#
# This test is for checking functionality of flushing FDB entries.
# Check that flush works as expected with all the supported arguments and verify
# some combinations of arguments.

source lib.sh

FLUSH_BY_STATE_TESTS="
	vxlan_test_flush_by_permanent
	vxlan_test_flush_by_nopermanent
	vxlan_test_flush_by_static
	vxlan_test_flush_by_nostatic
	vxlan_test_flush_by_dynamic
	vxlan_test_flush_by_nodynamic
"

FLUSH_BY_FLAG_TESTS="
	vxlan_test_flush_by_extern_learn
	vxlan_test_flush_by_noextern_learn
	vxlan_test_flush_by_router
	vxlan_test_flush_by_norouter
"

TESTS="
	vxlan_test_flush_by_dev
	vxlan_test_flush_by_vni
	vxlan_test_flush_by_src_vni
	vxlan_test_flush_by_port
	vxlan_test_flush_by_dst_ip
	vxlan_test_flush_by_nhid
	$FLUSH_BY_STATE_TESTS
	$FLUSH_BY_FLAG_TESTS
	vxlan_test_flush_by_several_args
	vxlan_test_flush_by_remote_attributes
	bridge_test_flush_by_dev
	bridge_test_flush_by_vlan
	bridge_vxlan_test_flush
"

: ${VERBOSE:=0}
: ${PAUSE_ON_FAIL:=no}
: ${PAUSE:=no}
: ${VXPORT:=4789}

run_cmd()
{
	local cmd="$1"
	local out
	local rc
	local stderr="2>/dev/null"

	if [ "$VERBOSE" = "1" ]; then
		printf "COMMAND: $cmd\n"
		stderr=
	fi

	out=$(eval $cmd $stderr)
	rc=$?
	if [ "$VERBOSE" = "1" -a -n "$out" ]; then
		echo "    $out"
	fi

	return $rc
}

log_test()
{
	local rc=$1

Annotation

Implementation Notes