Commit 884ee754 authored by Miroslav Benes's avatar Miroslav Benes Committed by Jiri Kosina

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: 2f3f651f ("selftests/livepatch: Use "comm" instead of "diff" for dmesg")
Signed-off-by: default avatarMiroslav Benes <mbenes@suse.cz>
Acked-by: default avatarJoe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 1e21b5c7
...@@ -278,7 +278,7 @@ function check_result { ...@@ -278,7 +278,7 @@ function check_result {
# help differentiate repeated testing runs. Remove them with a # help differentiate repeated testing runs. Remove them with a
# post-comparison sed filter. # post-comparison sed filter.
result=$(dmesg | comm -13 "$SAVED_DMESG" - | \ result=$(dmesg | comm --nocheck-order -13 "$SAVED_DMESG" - | \
grep -e 'livepatch:' -e 'test_klp' | \ grep -e 'livepatch:' -e 'test_klp' | \
grep -v '\(tainting\|taints\) kernel' | \ grep -v '\(tainting\|taints\) kernel' | \
sed 's/^\[[ 0-9.]*\] //') sed 's/^\[[ 0-9.]*\] //')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment