[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87k0zsbubg.fsf@mpe.ellerman.id.au>
Date: Sat, 27 Jun 2020 21:51:31 +1000
From: Michael Ellerman <mpe@...erman.id.au>
To: Kees Cook <keescook@...omium.org>, Shuah Khan <shuah@...nel.org>
Cc: Naresh Kamboju <naresh.kamboju@...aro.org>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests/lkdtm: Use "comm" instead of "diff" for dmesg
Kees Cook <keescook@...omium.org> writes:
> Instead of full GNU diff (which smaller boot environments may not have),
> use "comm" which is more available.
Although using "comm" requires CONFIG_PRINTK_TIME=y doesn't it?
Which is probably fine, but should be mentioned.
And I guess for completeness you could add:
diff --git a/tools/testing/selftests/lkdtm/config b/tools/testing/selftests/lkdtm/config
index d874990e442b..ae88bfb163ff 100644
--- a/tools/testing/selftests/lkdtm/config
+++ b/tools/testing/selftests/lkdtm/config
@@ -1 +1,2 @@
CONFIG_LKDTM=y
+CONFIG_PRINTK_TIME=y
cheers
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Link: https://lore.kernel.org/lkml/CA+G9fYtHP+Gg+BrR_GkBMxu2oOi-_e9pATtpb6TVRswv1G1r1Q@mail.gmail.com
> Fixes: f131d9edc29d ("selftests/lkdtm: Don't clear dmesg when running tests")
> Signed-off-by: Kees Cook <keescook@...omium.org>
> ---
> tools/testing/selftests/lkdtm/run.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh
> index 8383eb89d88a..5fe23009ae13 100755
> --- a/tools/testing/selftests/lkdtm/run.sh
> +++ b/tools/testing/selftests/lkdtm/run.sh
> @@ -82,7 +82,7 @@ dmesg > "$DMESG"
> ($SHELL -c 'cat <(echo '"$test"') >'"$TRIGGER" 2>/dev/null) || true
>
> # Record and dump the results
> -dmesg | diff --changed-group-format='%>' --unchanged-group-format='' "$DMESG" - > "$LOG" || true
> +dmesg | comm -13 "$DMESG" - > "$LOG" || true
>
> cat "$LOG"
> # Check for expected output
> --
> 2.25.1
>
>
> --
> Kees Cook
Powered by blists - more mailing lists