Live-Patching Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg
@ 2020-07-10 18:37 Joe Lawrence
  2020-07-13 11:57 ` Kamalesh Babulal
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Joe Lawrence @ 2020-07-10 18:37 UTC (permalink / raw)
  To: live-patching; +Cc: linux-kselftest, Petr Mladek, Naresh Kamboju

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.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
---

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(-)

diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
index 36648ca367c2..408529d94ddb 100644
--- a/tools/testing/selftests/livepatch/functions.sh
+++ b/tools/testing/selftests/livepatch/functions.sh
@@ -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.]*\] //')
-- 
2.21.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg
  2020-07-10 18:37 [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg Joe Lawrence
@ 2020-07-13 11:57 ` Kamalesh Babulal
  2020-07-13 12:51 ` Yannick Cote
  2020-07-14  7:53 ` Petr Mladek
  2 siblings, 0 replies; 4+ messages in thread
From: Kamalesh Babulal @ 2020-07-13 11:57 UTC (permalink / raw)
  To: Joe Lawrence, live-patching; +Cc: linux-kselftest, Petr Mladek, Naresh Kamboju

On 11/07/20 12:07 am, Joe Lawrence wrote:
> 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.
> 
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>

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

Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>


-- 
Kamalesh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg
  2020-07-10 18:37 [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg Joe Lawrence
  2020-07-13 11:57 ` Kamalesh Babulal
@ 2020-07-13 12:51 ` Yannick Cote
  2020-07-14  7:53 ` Petr Mladek
  2 siblings, 0 replies; 4+ messages in thread
From: Yannick Cote @ 2020-07-13 12:51 UTC (permalink / raw)
  To: Joe Lawrence; +Cc: live-patching, linux-kselftest, Petr Mladek, Naresh Kamboju

On Fri, Jul 10, 2020 at 2:39 PM Joe Lawrence <joe.lawrence@redhat.com> wrote:
>
> 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.
>
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
> ---
>
> 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(-)
>
> diff --git a/tools/testing/selftests/livepatch/functions.sh b/tools/testing/selftests/livepatch/functions.sh
> index 36648ca367c2..408529d94ddb 100644
> --- a/tools/testing/selftests/livepatch/functions.sh
> +++ b/tools/testing/selftests/livepatch/functions.sh
> @@ -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.]*\] //')
> --
> 2.21.3
>

Reviewed-by: Yannick Cote <ycote@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg
  2020-07-10 18:37 [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg Joe Lawrence
  2020-07-13 11:57 ` Kamalesh Babulal
  2020-07-13 12:51 ` Yannick Cote
@ 2020-07-14  7:53 ` Petr Mladek
  2 siblings, 0 replies; 4+ messages in thread
From: Petr Mladek @ 2020-07-14  7:53 UTC (permalink / raw)
  To: Joe Lawrence; +Cc: live-patching, linux-kselftest, Naresh Kamboju

On Fri 2020-07-10 14:37:45, Joe Lawrence wrote:
> 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.
> 
> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>

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

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 18:37 [PATCH] selftests/livepatch: Use "comm" instead of "diff" for dmesg Joe Lawrence
2020-07-13 11:57 ` Kamalesh Babulal
2020-07-13 12:51 ` Yannick Cote
2020-07-14  7:53 ` Petr Mladek

Live-Patching Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/live-patching/0 live-patching/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 live-patching live-patching/ https://lore.kernel.org/live-patching \
		live-patching@vger.kernel.org
	public-inbox-index live-patching

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.live-patching


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git