live-patching.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/livepatch: filter 'taints' from dmesg comparison
@ 2019-11-06 22:28 Joe Lawrence
  2019-11-07  8:42 ` Miroslav Benes
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Joe Lawrence @ 2019-11-06 22:28 UTC (permalink / raw)
  To: live-patching, linux-kselftest; +Cc: shuah

The livepatch selftests compare expected dmesg output to verify kernel
behavior.  They currently filter out "tainting kernel with
TAINT_LIVEPATCH" messages which may be logged when loading livepatch
modules.

Further filter the log to also drop "loading out-of-tree module taints
kernel" messages in case the klp_test modules have been build without
the in-tree module flag.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
---

Note: I stumbled across this in a testing scenario and thought it might
be generally useful to extend this admittedly fragile mechanism.  Since
there are no related livepatch-core changes, this can go through Shuah's
kselftest tree if she prefers.  -- Joe

 tools/testing/selftests/livepatch/functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
index 79b0affd21fb..57975c323542 100644
--- a/tools/testing/selftests/livepatch/functions.sh
+++ b/tools/testing/selftests/livepatch/functions.sh
@@ -221,7 +221,7 @@ function check_result {
 	local expect="$*"
 	local result
 
-	result=$(dmesg | grep -v 'tainting' | grep -e 'livepatch:' -e 'test_klp' | sed 's/^\[[ 0-9.]*\] //')
+	result=$(dmesg | grep -ve '\<taints\>' -ve '\<tainting\>' | grep -e 'livepatch:' -e 'test_klp' | sed 's/^\[[ 0-9.]*\] //')
 
 	if [[ "$expect" == "$result" ]] ; then
 		echo "ok"
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-11-07 15:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 22:28 [PATCH] selftests/livepatch: filter 'taints' from dmesg comparison Joe Lawrence
2019-11-07  8:42 ` Miroslav Benes
2019-11-07 14:40   ` Joe Lawrence
2019-11-07 14:53     ` Miroslav Benes
2019-11-07 15:13       ` Joe Lawrence
2019-11-07 15:24         ` Miroslav Benes
2019-11-07 15:33           ` Joe Lawrence
2019-11-07 12:22 ` Kamalesh Babulal
2019-11-07 15:29 ` Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).