Skip to content

Commit 9ab3676

Browse files
committed
selftests: netfilter: skip br_netfilter queue tests if kernel is tainted
JIRA: https://issues.redhat.com/browse/RHEL-107520 commit c21b02f Author: Florian Westphal <fw@strlen.de> Date: Tue, 11 Mar 2025 12:52:45 +0100 selftests: netfilter: skip br_netfilter queue tests if kernel is tainted These scripts fail if the kernel is tainted which leads to wrong test failure reports in CI environments when an unrelated test triggers some splat. Check taint state at start of script and SKIP if its already dodgy. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 5577c57 commit 9ab3676

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ source lib.sh
1313

1414
checktool "nft --version" "run test without nft tool"
1515

16+
read t < /proc/sys/kernel/tainted
17+
if [ "$t" -ne 0 ];then
18+
echo SKIP: kernel is tainted
19+
exit $ksft_skip
20+
fi
21+
1622
cleanup() {
1723
cleanup_all_ns
1824
}
@@ -161,6 +167,7 @@ if [ "$t" -eq 0 ];then
161167
echo PASS: kernel not tainted
162168
else
163169
echo ERROR: kernel is tainted
170+
dmesg
164171
ret=1
165172
fi
166173

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ source lib.sh
44

55
checktool "nft --version" "run test without nft tool"
66

7+
read t < /proc/sys/kernel/tainted
8+
if [ "$t" -ne 0 ];then
9+
echo SKIP: kernel is tainted
10+
exit $ksft_skip
11+
fi
12+
713
cleanup() {
814
cleanup_all_ns
915
}
@@ -72,6 +78,7 @@ if [ "$t" -eq 0 ];then
7278
echo PASS: kernel not tainted
7379
else
7480
echo ERROR: kernel is tainted
81+
dmesg
7582
exit 1
7683
fi
7784

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ EOF
407407
echo "PASS: queue program exiting while packets queued"
408408
else
409409
echo "TAINT: queue program exiting while packets queued"
410+
dmesg
410411
ret=1
411412
fi
412413
}

0 commit comments

Comments
 (0)