]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests: netfilter: Ignore tainted kernels in interface stress test
authorPhil Sutter <phil@nwl.cc>
Wed, 23 Jul 2025 15:17:48 +0000 (17:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 25 Jul 2025 16:40:49 +0000 (18:40 +0200)
Complain about kernel taint value only if it wasn't set at start
already.

Fixes: 73db1b5dab6f ("selftests: netfilter: Torture nftables netdev hooks")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tools/testing/selftests/net/netfilter/nft_interface_stress.sh

index 5ff7be9daeee1c06581c9ad64204a8a30dd3c409..c0fffaa6dbd9a8dd722710d091f3ff5d9aa1da1c 100755 (executable)
@@ -10,6 +10,8 @@ source lib.sh
 checktool "nft --version" "run test without nft tool"
 checktool "iperf3 --version" "run test without iperf3 tool"
 
+read kernel_tainted < /proc/sys/kernel/tainted
+
 # how many seconds to torture the kernel?
 # default to 80% of max run time but don't exceed 48s
 TEST_RUNTIME=$((${kselftest_timeout:-60} * 8 / 10))
@@ -135,7 +137,8 @@ else
        wait
 fi
 
-[[ $(</proc/sys/kernel/tainted) -eq 0 ]] || {
+
+[[ $kernel_tainted -eq 0 && $(</proc/sys/kernel/tainted) -ne 0 ]] && {
        echo "FAIL: Kernel is tainted!"
        exit $ksft_fail
 }