2020-06-22 21:27:34

by Jarkko Sakkinen

[permalink] [raw]
Subject: [PATCH 0/3] selftests: tpm: fixes

A few fixes for tools/testing/selftests/tpm.

Jarkko Sakkinen (3):
Revert "tpm: selftest: cleanup after unseal with wrong auth/policy
test"
selftests: tpm: Use 'test -e' instead of 'test -f'
selftests: tpm: Use /bin/sh instead of /bin/bash

tools/testing/selftests/tpm2/test_smoke.sh | 9 ++-------
tools/testing/selftests/tpm2/test_space.sh | 4 ++--
2 files changed, 4 insertions(+), 9 deletions(-)

--
2.25.1


2020-06-22 23:30:58

by Jarkko Sakkinen

[permalink] [raw]
Subject: [PATCH 2/3] selftests: tpm: Use 'test -e' instead of 'test -f'

'test -f' is suitable only for *regular* files. Use 'test -e' instead.

Cc: Nikita Sobolev <[email protected]>
Cc: [email protected]
Cc: [email protected]
Fixes: 5627f9cffee7 ("Kernel selftests: Add check if TPM devices are supported")
Signed-off-by: Jarkko Sakkinen <[email protected]>
---
tools/testing/selftests/tpm2/test_smoke.sh | 2 +-
tools/testing/selftests/tpm2/test_space.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/tpm2/test_smoke.sh b/tools/testing/selftests/tpm2/test_smoke.sh
index 79f8e9da5d21..338d6b0272dc 100755
--- a/tools/testing/selftests/tpm2/test_smoke.sh
+++ b/tools/testing/selftests/tpm2/test_smoke.sh
@@ -4,7 +4,7 @@
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4

-[ -f /dev/tpm0 ] || exit $ksft_skip
+[ -e /dev/tpm0 ] || exit $ksft_skip

python -m unittest -v tpm2_tests.SmokeTest
python -m unittest -v tpm2_tests.AsyncTest
diff --git a/tools/testing/selftests/tpm2/test_space.sh b/tools/testing/selftests/tpm2/test_space.sh
index 36c9d030a1c6..847cabb20a5f 100755
--- a/tools/testing/selftests/tpm2/test_space.sh
+++ b/tools/testing/selftests/tpm2/test_space.sh
@@ -4,6 +4,6 @@
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4

-[ -f /dev/tpmrm0 ] || exit $ksft_skip
+[ -e /dev/tpmrm0 ] || exit $ksft_skip

python -m unittest -v tpm2_tests.SpaceTest
--
2.25.1

2020-06-29 20:23:43

by Shuah Khan

[permalink] [raw]
Subject: Re: [PATCH 0/3] selftests: tpm: fixes

On 6/22/20 3:20 PM, Jarkko Sakkinen wrote:
> A few fixes for tools/testing/selftests/tpm.
>
> Jarkko Sakkinen (3):
> Revert "tpm: selftest: cleanup after unseal with wrong auth/policy
> test"
> selftests: tpm: Use 'test -e' instead of 'test -f'
> selftests: tpm: Use /bin/sh instead of /bin/bash
>
> tools/testing/selftests/tpm2/test_smoke.sh | 9 ++-------
> tools/testing/selftests/tpm2/test_space.sh | 4 ++--
> 2 files changed, 4 insertions(+), 9 deletions(-)
>

Applied to linux-kselftest fixes for Linux 5.8-rc4

thanks,
-- Shuah

2020-07-02 23:08:07

by Jarkko Sakkinen

[permalink] [raw]
Subject: Re: [PATCH 0/3] selftests: tpm: fixes

On Mon, Jun 29, 2020 at 02:21:47PM -0600, Shuah Khan wrote:
> On 6/22/20 3:20 PM, Jarkko Sakkinen wrote:
> > A few fixes for tools/testing/selftests/tpm.
> >
> > Jarkko Sakkinen (3):
> > Revert "tpm: selftest: cleanup after unseal with wrong auth/policy
> > test"
> > selftests: tpm: Use 'test -e' instead of 'test -f'
> > selftests: tpm: Use /bin/sh instead of /bin/bash
> >
> > tools/testing/selftests/tpm2/test_smoke.sh | 9 ++-------
> > tools/testing/selftests/tpm2/test_space.sh | 4 ++--
> > 2 files changed, 4 insertions(+), 9 deletions(-)
> >
>
> Applied to linux-kselftest fixes for Linux 5.8-rc4

Thank you.

/Jarkko