From: Joe Lawrence Date: Thu, 18 Jun 2020 18:10:39 +0000 (-0400) Subject: selftests/livepatch: refine dmesg 'taints' in dmesg comparison X-Git-Tag: v5.9-rc1~126^2~3 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c401088f0f1887761b8472352fd4f23595a74149;p=linux-block.git selftests/livepatch: refine dmesg 'taints' in dmesg comparison The livepatch selftests currently grep on "taints" to filter out "tainting kernel with TAINT_LIVEPATCH" messages which may be logged when loading livepatch modules. Further filter the log to drop "loading out-of-tree module taints kernel" in the rare case the klp_test modules have been built out-of-tree. Look for the longer "taints kernel" or "tainting kernel" strings to avoid inadvertent partial matching. Signed-off-by: Joe Lawrence Reviewed-by: Kamalesh Babulal Reviewed-by: Yannick Cote Reviewed-by: Petr Mladek Acked-by: Miroslav Benes Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20200618181040.21132-3-joe.lawrence@redhat.com --- diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh index bf73ec4f4a71..5e5a79179fc1 100644 --- a/tools/testing/selftests/livepatch/functions.sh +++ b/tools/testing/selftests/livepatch/functions.sh @@ -277,7 +277,8 @@ function check_result { # post-comparison sed filter. result=$(dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$SAVED_DMESG" - | \ - grep -v 'tainting' | grep -e 'livepatch:' -e 'test_klp' | \ + grep -e 'livepatch:' -e 'test_klp' | \ + grep -v '\(tainting\|taints\) kernel' | \ sed 's/^\[[ 0-9.]*\] //') if [[ "$expect" == "$result" ]] ; then