All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft] tests: shell: check for a tainted kernel
@ 2022-08-11 11:19 Florian Westphal
  0 siblings, 0 replies; only message in thread
From: Florian Westphal @ 2022-08-11 11:19 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

If a test case results in a kernel taint (WARN splat for example), make
sure the test script indicates this.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 tests/shell/run-tests.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 33006d2c63fe..931bba967b37 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -109,8 +109,22 @@ find_tests() {
 echo ""
 ok=0
 failed=0
+taint=0
+
+check_taint()
+{
+	read taint_now < /proc/sys/kernel/tainted
+	if [ $taint -ne $taint_now ] ; then
+		msg_warn "[FAILED]	kernel is tainted: $taint  -> $taint_now"
+		((failed++))
+	fi
+}
+
+check_taint
+
 for testfile in $(find_tests)
 do
+	read taint < /proc/sys/kernel/tainted
 	kernel_cleanup
 
 	msg_info "[EXECUTING]	$testfile"
@@ -155,6 +169,8 @@ do
 			msg_warn "[FAILED]	$testfile"
 		fi
 	fi
+
+	check_taint
 done
 
 echo ""
-- 
2.37.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-11 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 11:19 [PATCH nft] tests: shell: check for a tainted kernel Florian Westphal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.