Commit 8d1c9185 authored by Phil Sutter's avatar Phil Sutter Committed by Pablo Neira Ayuso
Browse files

selftests: netfilter: Ignore tainted kernels in interface stress test



Complain about kernel taint value only if it wasn't set at start
already.

Fixes: 73db1b5d ("selftests: netfilter: Torture nftables netdev hooks")
Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent bf58e667
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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
}