summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2025-07-23 18:17:48 +0300
committerPablo Neira Ayuso <pablo@netfilter.org>2025-07-25 19:40:49 +0300
commit8d1c91850d064944ab214b2fbfffb7fc08a11d65 (patch)
tree9d963ae066264f44c57622a68e942e99fb46c99e /tools/testing
parentbf58e667af7d96c8eb9411f926a0a0955f41ce21 (diff)
downloadlinux-8d1c91850d064944ab214b2fbfffb7fc08a11d65.tar.xz
selftests: netfilter: Ignore tainted kernels in interface stress test
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>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/selftests/net/netfilter/nft_interface_stress.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/netfilter/nft_interface_stress.sh b/tools/testing/selftests/net/netfilter/nft_interface_stress.sh
index 5ff7be9daeee..c0fffaa6dbd9 100755
--- a/tools/testing/selftests/net/netfilter/nft_interface_stress.sh
+++ b/tools/testing/selftests/net/netfilter/nft_interface_stress.sh
@@ -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
}