linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/tpm: Fix runtime error
@ 2020-04-12 14:11 Jarkko Sakkinen
  2020-04-12 14:18 ` Jarkko Sakkinen
  2020-05-10 18:44 ` Nikita Sobolev
  0 siblings, 2 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2020-04-12 14:11 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux-kselftest, linux-integrity, Jarkko Sakkinen,
	Nikita Sobolev, Tadeusz Struk, open list

There is some random clutter in test_smoke.sh:

  ./test_smoke.sh: line 3: self.flags: command not found

Remove it.

Fixes: b32694cd0724 ("Kernel selftests: tpm2: check for tpm support")
Cc: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
I rely on these tests and this was not even cc'd to me and obviously
was untested. There is neither reviewed-by nor tested-by tags in the
commit (not to mention some cosmetic things like short summary
formatted wrong and the extra newline character).

Please do not do this next time. Thanks.
 tools/testing/selftests/tpm2/test_smoke.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/testing/selftests/tpm2/test_smoke.sh b/tools/testing/selftests/tpm2/test_smoke.sh
index b630c7b5950a..e55d3e400666 100755
--- a/tools/testing/selftests/tpm2/test_smoke.sh
+++ b/tools/testing/selftests/tpm2/test_smoke.sh
@@ -1,11 +1,9 @@
 #!/bin/bash
 # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
-self.flags = flags
 
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
 
-
 if [ -f /dev/tpm0 ] ; then
 	python -m unittest -v tpm2_tests.SmokeTest
 	python -m unittest -v tpm2_tests.AsyncTest
-- 
2.25.1


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

* Re: [PATCH] selftests/tpm: Fix runtime error
  2020-04-12 14:11 [PATCH] selftests/tpm: Fix runtime error Jarkko Sakkinen
@ 2020-04-12 14:18 ` Jarkko Sakkinen
  2020-05-10 18:44 ` Nikita Sobolev
  1 sibling, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2020-04-12 14:18 UTC (permalink / raw)
  To: Shuah Khan
  Cc: linux-kselftest, linux-integrity, Nikita Sobolev, Tadeusz Struk,
	open list

On Sun, Apr 12, 2020 at 05:11:17PM +0300, Jarkko Sakkinen wrote:
> There is some random clutter in test_smoke.sh:
> 
>   ./test_smoke.sh: line 3: self.flags: command not found
> 
> Remove it.
> 
> Fixes: b32694cd0724 ("Kernel selftests: tpm2: check for tpm support")
> Cc: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Instead we should apply a revert to the original patch and Nikita could
refine it. Have additional questions e.g. why the constant is declared
instead of just exit 4? The commit message long description also fails
to document any sane reasoning for anything.

It is not enough to response the reasoning to me here. It needs to be
in the commit log. This is terrible.

It is obvious there has not been any kind of sane review process in
place.

/Jarkko

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

* RE: [PATCH] selftests/tpm: Fix runtime error
  2020-04-12 14:11 [PATCH] selftests/tpm: Fix runtime error Jarkko Sakkinen
  2020-04-12 14:18 ` Jarkko Sakkinen
@ 2020-05-10 18:44 ` Nikita Sobolev
  2020-05-14  0:07   ` Jarkko Sakkinen
  1 sibling, 1 reply; 4+ messages in thread
From: Nikita Sobolev @ 2020-05-10 18:44 UTC (permalink / raw)
  To: Jarkko Sakkinen, Shuah Khan
  Cc: linux-kselftest, linux-integrity, Tadeusz Struk, open list,
	Peter Huewe, Jason Gunthorpe, Alexey Brodkin, Eugeniy Paltsev

Hi, Jarkko Sakkinen, all!

Thank you for your notes about commit and sorry for not copying the message to you!

There is definitely unwanted line of code in the commit.
After deleting that one, introduced changes work fine.

There is a hardcoded usage of /dev/tpm2 in the kernel selftest. And if there is no such device - test fails.
I believe this is not a behavior, that we expect. Test should be skipped in such case, should it?
That is what my commit makes.

So, after deleting unwanted line of code and making cosmetic changes (new description + deleting
excess newline character), can commit be submitted again?

You also mentioned reviewed-by nor tested-by tags in your message. Who should make these tags?

P.S.
Also there was a question: why do I declare exit code with a constant instead of just exit 4.
I chose this style because it is used in other kernel selftests for such kind of checks.
It is proper to follow common style rules. Should I argument this decision in commit message? 

-Nikita

> -----Original Message-----
> From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> Sent: Sunday, April 12, 2020 5:11 PM
> To: Shuah Khan <shuah@kernel.org>
> Cc: linux-kselftest@vger.kernel.org; linux-integrity@vger.kernel.org; Jarkko
> Sakkinen <jarkko.sakkinen@linux.intel.com>; Nikita Sobolev
> <sobolev@synopsys.com>; Tadeusz Struk <tadeusz.struk@intel.com>; open
> list <linux-kernel@vger.kernel.org>
> Subject: [PATCH] selftests/tpm: Fix runtime error
> 
> There is some random clutter in test_smoke.sh:
> 
>   ./test_smoke.sh: line 3: self.flags: command not found
> 
> Remove it.
> 
> Fixes: b32694cd0724 ("Kernel selftests: tpm2: check for tpm support")
> Cc: Nikita Sobolev <Nikita.Sobolev@synopsys.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
> ---
> I rely on these tests and this was not even cc'd to me and obviously was
> untested. There is neither reviewed-by nor tested-by tags in the commit (not
> to mention some cosmetic things like short summary formatted wrong and the
> extra newline character).
> 
> Please do not do this next time. Thanks.
>  tools/testing/selftests/tpm2/test_smoke.sh | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/tpm2/test_smoke.sh
> b/tools/testing/selftests/tpm2/test_smoke.sh
> index b630c7b5950a..e55d3e400666 100755
> --- a/tools/testing/selftests/tpm2/test_smoke.sh
> +++ b/tools/testing/selftests/tpm2/test_smoke.sh
> @@ -1,11 +1,9 @@
>  #!/bin/bash
>  # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) -self.flags = flags
> 
>  # Kselftest framework requirement - SKIP code is 4.
>  ksft_skip=4
> 
> -
>  if [ -f /dev/tpm0 ] ; then
>  	python -m unittest -v tpm2_tests.SmokeTest
>  	python -m unittest -v tpm2_tests.AsyncTest
> --
> 2.25.1


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

* Re: [PATCH] selftests/tpm: Fix runtime error
  2020-05-10 18:44 ` Nikita Sobolev
@ 2020-05-14  0:07   ` Jarkko Sakkinen
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Sakkinen @ 2020-05-14  0:07 UTC (permalink / raw)
  To: Nikita Sobolev, Shuah Khan
  Cc: linux-kselftest, linux-integrity, Tadeusz Struk, open list,
	Peter Huewe, Jason Gunthorpe, Alexey Brodkin, Eugeniy Paltsev

On Sun, 2020-05-10 at 18:44 +0000, Nikita Sobolev wrote:
> Hi, Jarkko Sakkinen, all!
> 
> Thank you for your notes about commit and sorry for not copying the message
> to you!

It's not a biggie, no worries.

> There is definitely unwanted line of code in the commit.
> After deleting that one, introduced changes work fine.
> 
> There is a hardcoded usage of /dev/tpm2 in the kernel selftest. And if there
> is no such device - test fails.  I believe this is not a behavior, that we
> expect. Test should be skipped in such case, should it?  That is what my
> commit makes.
> 
> So, after deleting unwanted line of code and making cosmetic changes (new description + deleting
> excess newline character), can commit be submitted again?
> 
> You also mentioned reviewed-by nor tested-by tags in your message. Who should make these tags?
> 
> P.S.
> Also there was a question: why do I declare exit code with a constant instead of just exit 4.
> I chose this style because it is used in other kernel selftests for such kind of checks.
> It is proper to follow common style rules. Should I argument this decision in commit message? 
> 
> -Nikita

Yes, you are of course free to submit a new patch for review.

/Jarkko


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

end of thread, other threads:[~2020-05-14  0:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-12 14:11 [PATCH] selftests/tpm: Fix runtime error Jarkko Sakkinen
2020-04-12 14:18 ` Jarkko Sakkinen
2020-05-10 18:44 ` Nikita Sobolev
2020-05-14  0:07   ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).