Skip to content

Commit c401088

Browse files
joe-lawrencepmladek
authored andcommitted
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 <joe.lawrence@redhat.com> Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Reviewed-by: Yannick Cote <ycote@redhat.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20200618181040.21132-3-joe.lawrence@redhat.com
1 parent 2eeb0d4 commit c401088

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/testing/selftests/livepatch/functions.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ function check_result {
277277
# post-comparison sed filter.
278278

279279
result=$(dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$SAVED_DMESG" - | \
280-
grep -v 'tainting' | grep -e 'livepatch:' -e 'test_klp' | \
280+
grep -e 'livepatch:' -e 'test_klp' | \
281+
grep -v '\(tainting\|taints\) kernel' | \
281282
sed 's/^\[[ 0-9.]*\] //')
282283

283284
if [[ "$expect" == "$result" ]] ; then

0 commit comments

Comments
 (0)