Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/livepatch: Do not check order when using "comm" for dmesg checking

check_result() uses "comm" to check expected results of selftests output
in dmesg. Everything works fine if timestamps in dmesg are unique. If
not, like in this example

[ 86.844422] test_klp_callbacks_demo: pre_unpatch_callback: test_klp_callbacks_mod -> [MODULE_STATE_LIVE] Normal state
[ 86.844422] livepatch: 'test_klp_callbacks_demo': starting unpatching transition

, "comm" fails with "comm: file 2 is not in sorted order". Suppress the
order checking with --nocheck-order option.

Fixes: 2f3f651f3756 ("selftests/livepatch: Use "comm" instead of "diff" for dmesg")
Signed-off-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Miroslav Benes and committed by
Jiri Kosina
884ee754 1e21b5c7

+1 -1
+1 -1
tools/testing/selftests/livepatch/functions.sh
··· 278 278 # help differentiate repeated testing runs. Remove them with a 279 279 # post-comparison sed filter. 280 280 281 - result=$(dmesg | comm -13 "$SAVED_DMESG" - | \ 281 + result=$(dmesg | comm --nocheck-order -13 "$SAVED_DMESG" - | \ 282 282 grep -e 'livepatch:' -e 'test_klp' | \ 283 283 grep -v '\(tainting\|taints\) kernel' | \ 284 284 sed 's/^\[[ 0-9.]*\] //')