Skip to content

Commit c21b02f

Browse files
Florian Westphalummakynes
authored andcommitted
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>
1 parent d653bfe commit c21b02f

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
}
@@ -165,6 +171,7 @@ if [ "$t" -eq 0 ];then
165171
echo PASS: kernel not tainted
166172
else
167173
echo ERROR: kernel is tainted
174+
dmesg
168175
ret=1
169176
fi
170177

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
@@ -593,6 +593,7 @@ EOF
593593
echo "PASS: queue program exiting while packets queued"
594594
else
595595
echo "TAINT: queue program exiting while packets queued"
596+
dmesg
596597
ret=1
597598
fi
598599
}

0 commit comments

Comments
 (0)