]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: rtnetlink: skip tests if tools or feats are missing
authorAlessandro Ratti <alessandro@0x65c.net>
Fri, 22 Aug 2025 14:03:40 +0000 (16:03 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 25 Aug 2025 22:22:18 +0000 (15:22 -0700)
commite79012967b26134f507efe93ec4b4e6c13d92950
tree058f471905150a6af659835f30ee836ee55cbfdb
parent6e8e6baf16ce7d2310959ae81d0194a56874e0d2
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>
tools/testing/selftests/net/rtnetlink.sh