[PATCH net v3 1/6] selftests: net: fib_tests: skip rp_filter test if cls_basic is unavailable

Aleksei Oladko posted 6 patches 1 month ago
There is a newer version of this series
[PATCH net v3 1/6] selftests: net: fib_tests: skip rp_filter test if cls_basic is unavailable
Posted by Aleksei Oladko 1 month ago
The rp_filter test in fib_tests.sh installs tc filters using the
"basic" classifier but does not verify the corresponding kernel
module (cls_basic) is available. On kernels built without
CONFIG_NET_CLS_BASIC, the tc command fails and the rp_filter test
is reported as a failure.

Add a check for the presence of the cls_basic module and skip
the rp_filter test when the classifier is not available.

Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
---
 tools/testing/selftests/net/fib_tests.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
index c5694cc4ddd2..fa58f9b6bed0 100755
--- a/tools/testing/selftests/net/fib_tests.sh
+++ b/tools/testing/selftests/net/fib_tests.sh
@@ -441,6 +441,8 @@ fib_rp_filter_test()
 	echo
 	echo "IPv4 rp_filter tests"
 
+	modprobe cls_basic || return $ksft_skip
+
 	setup
 
 	set -e
-- 
2.43.0
Re: [PATCH net v3 1/6] selftests: net: fib_tests: skip rp_filter test if cls_basic is unavailable
Posted by Jakub Kicinski 1 month ago
On Fri,  6 Mar 2026 00:01:22 +0000 Aleksei Oladko wrote:
> --- a/tools/testing/selftests/net/fib_tests.sh
> +++ b/tools/testing/selftests/net/fib_tests.sh
> @@ -441,6 +441,8 @@ fib_rp_filter_test()
>  	echo
>  	echo "IPv4 rp_filter tests"
>  
> +	modprobe cls_basic || return $ksft_skip

tests expects all options in tools/testing/selftests/net/config
to be enabled, we don't intend to cater to custom builds