tools/testing/selftests/net/rtnetlink.sh

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/rtnetlink.sh
Extension
.sh
Size
44095 bytes
Lines
1683
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
#
# This test is for checking rtnetlink callpaths, and get as much coverage as possible.
#
# set -e

ALL_TESTS="
	kci_test_polrouting
	kci_test_route_get
	kci_test_addrlft
	kci_test_addrlft_route_cleanup
	kci_test_promote_secondaries
	kci_test_tc
	kci_test_gre
	kci_test_gretap
	kci_test_ip6gretap
	kci_test_erspan
	kci_test_ip6erspan
	kci_test_bridge
	kci_test_addrlabel
	kci_test_ifalias
	kci_test_vrf
	kci_test_encap
	kci_test_macsec
	kci_test_macsec_vlan
	kci_test_team_bridge_macvlan
	kci_test_bridge_promisc_netlink
	kci_test_bridge_promisc_sysfs
	kci_test_ipsec
	kci_test_ipsec_offload
	kci_test_fdb_get
	kci_test_fdb_del
	kci_test_neigh_get
	kci_test_neigh_update
	kci_test_bridge_parent_id
	kci_test_address_proto
	kci_test_enslave_bonding
	kci_test_mngtmpaddr
	kci_test_operstate
"

devdummy="test-dummy0"
VERBOSE=0
PAUSE=no
PAUSE_ON_FAIL=no

source lib.sh

# set global exit status, but never reset nonzero one.
check_err()
{
	if [ $ret -eq 0 ]; then
		ret=$1
	fi
	[ -n "$2" ] && echo "$2"
}

# same but inverted -- used when command must fail for test to pass
check_fail()
{
	if [ $1 -eq 0 ]; then
		ret=1
	fi
}

sysfs_write()
{
	local val="$1"
	local path="$2"

Annotation

Implementation Notes