Skip to content

Commit 8d1c918

Browse files
Phil Sutterummakynes
authored andcommitted
selftests: netfilter: Ignore tainted kernels in interface stress test
Complain about kernel taint value only if it wasn't set at start already. Fixes: 73db1b5 ("selftests: netfilter: Torture nftables netdev hooks") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent bf58e66 commit 8d1c918

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/testing/selftests/net/netfilter/nft_interface_stress.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ source lib.sh
1010
checktool "nft --version" "run test without nft tool"
1111
checktool "iperf3 --version" "run test without iperf3 tool"
1212

13+
read kernel_tainted < /proc/sys/kernel/tainted
14+
1315
# how many seconds to torture the kernel?
1416
# default to 80% of max run time but don't exceed 48s
1517
TEST_RUNTIME=$((${kselftest_timeout:-60} * 8 / 10))
@@ -135,7 +137,8 @@ else
135137
wait
136138
fi
137139

138-
[[ $(</proc/sys/kernel/tainted) -eq 0 ]] || {
140+
141+
[[ $kernel_tainted -eq 0 && $(</proc/sys/kernel/tainted) -ne 0 ]] && {
139142
echo "FAIL: Kernel is tainted!"
140143
exit $ksft_fail
141144
}

0 commit comments

Comments
 (0)