Skip to contentSkip to conversation

selftests/livepatch: Use "comm" instead of "diff" for dmesg

PATCH In review Joe Lawrence 4 participants 4 messages Jul 10, 2020 – Jul 14, 2020

Subsystems (2)
lore
Share & tools
lore

Joe Lawrence

author maintainer
#0 lore raw

PATCH 1/1 selftests/livepatch: Use "comm" instead of "diff" for dmesg

BusyBox diff doesn't support the GNU diff '--LTYPE-line-format' options that were used in the selftests to filter older kernel log messages from dmesg output.

Use "comm" which is more available in smaller boot environments.

---

based-on: livepatching.git/for-5.9/selftests-cleanup
merge-thru: livepatching.git

 tools/testing/selftests/livepatch/functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/livepatch/functions.sh +1 -1
index 36648ca367c2..408529d94ddb 100644
@@ -277,7 +277,7 @@ function check_result {
 	# help differentiate repeated testing runs.  Remove them with a
 	# post-comparison sed filter.
 
-	result=$(dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$SAVED_DMESG" - | \
+	result=$(dmesg | comm -13 "$SAVED_DMESG" - | \
 		 grep -e 'livepatch:' -e 'test_klp' | \
 		 grep -v '\(tainting\|taints\) kernel' | \
 		 sed 's/^\[[ 0-9.]*\] //')
Signature · 1 line
2.21.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Joe Lawrence

BusyBox diff doesn't support the GNU diff '--LTYPE-line-format' options that were used in the selftests to filter older kernel log messages from dmesg output.

Use "comm" which is more available in smaller boot environments.

LGTM. All the test passes on non-busybox environment.

Signature · 1 line
Kamalesh
Reviewed-by on v1 1/1
#2 lore raw
In reply to Joe Lawrence
Quoted 31 lines · Joe Lawrence

BusyBox diff doesn't support the GNU diff '--LTYPE-line-format' options that were used in the selftests to filter older kernel log messages from dmesg output.

Use "comm" which is more available in smaller boot environments.

---

based-on: livepatching.git/for-5.9/selftests-cleanup
merge-thru: livepatching.git

 tools/testing/selftests/livepatch/functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/livepatch/functions.sh +1 -2
index 36648ca367c2..408529d94ddb 100644
@@ -277,7 +277,7 @@ function check_result {
        # help differentiate repeated testing runs.  Remove them with a
        # post-comparison sed filter.
 
-       result=$(dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$SAVED_DMESG" - | \
+       result=$(dmesg | comm -13 "$SAVED_DMESG" - | \
                 grep -e 'livepatch:' -e 'test_klp' | \
                 grep -v '\(tainting\|taints\) kernel' | \
                 sed 's/^\[[ 0-9.]*\] //')
--
Quoted 2 lines

2.21.3

maintainer
#3 lore raw
In reply to Joe Lawrence
Quoted 8 lines · Joe Lawrence

BusyBox diff doesn't support the GNU diff '--LTYPE-line-format' options that were used in the selftests to filter older kernel log messages from dmesg output.

Use "comm" which is more available in smaller boot environments.

The patch is committed in livepatch.git, branch
for-5.9/selftests-cleanup.

Best Regards,
Petr