]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
selftests: netfilter: skip br_netfilter queue tests if kernel is tainted
authorFlorian Westphal <fw@strlen.de>
Tue, 11 Mar 2025 11:52:45 +0000 (12:52 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 12 Mar 2025 14:28:34 +0000 (15:28 +0100)
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>
tools/testing/selftests/net/netfilter/br_netfilter.sh
tools/testing/selftests/net/netfilter/br_netfilter_queue.sh
tools/testing/selftests/net/netfilter/nft_queue.sh

index c28379a965d838d55f6e4b427bb9d8f249601eb4..1559ba275105edc9795c79cb7b1e63d5d6dd41f7 100755 (executable)
@@ -13,6 +13,12 @@ source lib.sh
 
 checktool "nft --version" "run test without nft tool"
 
+read t < /proc/sys/kernel/tainted
+if [ "$t" -ne 0 ];then
+       echo SKIP: kernel is tainted
+       exit $ksft_skip
+fi
+
 cleanup() {
        cleanup_all_ns
 }
@@ -165,6 +171,7 @@ if [ "$t" -eq 0 ];then
        echo PASS: kernel not tainted
 else
        echo ERROR: kernel is tainted
+       dmesg
        ret=1
 fi
 
index 6a764d70ab06f984d0a07faa4791fe4741b9001b..4788641717d9352ddc1851d9a25534bc5d09181c 100755 (executable)
@@ -4,6 +4,12 @@ source lib.sh
 
 checktool "nft --version" "run test without nft tool"
 
+read t < /proc/sys/kernel/tainted
+if [ "$t" -ne 0 ];then
+       echo SKIP: kernel is tainted
+       exit $ksft_skip
+fi
+
 cleanup() {
        cleanup_all_ns
 }
@@ -72,6 +78,7 @@ if [ "$t" -eq 0 ];then
        echo PASS: kernel not tainted
 else
        echo ERROR: kernel is tainted
+       dmesg
        exit 1
 fi
 
index 785e3875a6da4b1938da797d94be22829034c85a..784d1b46912b018260bbf2c8f8907accad943cb1 100755 (executable)
@@ -593,6 +593,7 @@ EOF
                echo "PASS: queue program exiting while packets queued"
        else
                echo "TAINT: queue program exiting while packets queued"
+               dmesg
                ret=1
        fi
 }