Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: rtnetlink: skip tests if tools or feats are missing

Some rtnetlink selftests assume the presence of ifconfig and iproute2
support for the `proto` keyword in `ip address` commands. These
assumptions can cause test failures on modern systems (e.g. Debian
Bookworm) where:

- ifconfig is not installed by default
- The iproute2 version lacks support for address protocol

This patch improves test robustness by:

- Skipping kci_test_promote_secondaries if ifconfig is missing
- Skipping do_test_address_proto if ip address help does not mention
proto

These changes ensure the tests degrade gracefully by reporting SKIP
instead of FAIL when prerequisites are not met, improving portability
across systems.

Reviewed-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
Link: https://patch.msgid.link/20250822140633.891360-2-alessandro@0x65c.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alessandro Ratti and committed by
Jakub Kicinski
e7901296 6e8e6baf

+11
+11
tools/testing/selftests/net/rtnetlink.sh
··· 325 325 326 326 kci_test_promote_secondaries() 327 327 { 328 + run_cmd ifconfig "$devdummy" 329 + if [ $ret -ne 0 ]; then 330 + end_test "SKIP: ifconfig not installed" 331 + return $ksft_skip 332 + fi 328 333 promote=$(sysctl -n net.ipv4.conf.$devdummy.promote_secondaries) 329 334 330 335 sysctl -q net.ipv4.conf.$devdummy.promote_secondaries=1 ··· 1207 1202 local count 1208 1203 local ret=0 1209 1204 local err 1205 + 1206 + run_cmd_grep 'proto' ip address help 1207 + if [ $? -ne 0 ];then 1208 + end_test "SKIP: addr proto ${what}: iproute2 too old" 1209 + return $ksft_skip 1210 + fi 1210 1211 1211 1212 ip address add dev "$devdummy" "$addr3" 1212 1213 check_err $?