linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] MAINTAINERS: Add selftest files to TPM section
@ 2024-08-28 11:23 Michal Suchanek
  2024-08-28 11:23 ` [PATCH 2/2] selftests: tpm2: test_smoke: Run only when TPM2 is avaialable Michal Suchanek
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Suchanek @ 2024-08-28 11:23 UTC (permalink / raw)
  To: linux-integrity
  Cc: Michal Suchanek, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe,
	Shuah Khan, linux-kernel, linux-kselftest

tools/testing/selftests/tpm2/ is TPM-specific test

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 878dcd23b331..c2ee92c7c16c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -23184,6 +23184,7 @@ Q:	https://patchwork.kernel.org/project/linux-integrity/list/
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git
 F:	Documentation/devicetree/bindings/tpm/
 F:	drivers/char/tpm/
+F:	tools/testing/selftests/tpm2/
 
 TPS546D24 DRIVER
 M:	Duke Du <dukedu83@gmail.com>
-- 
2.46.0


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

* [PATCH 2/2] selftests: tpm2: test_smoke: Run only when TPM2 is avaialable.
  2024-08-28 11:23 [PATCH 1/2] MAINTAINERS: Add selftest files to TPM section Michal Suchanek
@ 2024-08-28 11:23 ` Michal Suchanek
  2024-08-28 13:32   ` Jarkko Sakkinen
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Suchanek @ 2024-08-28 11:23 UTC (permalink / raw)
  To: linux-integrity
  Cc: Michal Suchanek, Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe,
	Shuah Khan, linux-kernel, linux-kselftest

Since Linux 5.6 tpm_version_major sysfs file is avaialble which gives
the TPM version.

Using this file the test can be skipped on systems with TPM 1.2.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 tools/testing/selftests/tpm2/test_smoke.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/tpm2/test_smoke.sh b/tools/testing/selftests/tpm2/test_smoke.sh
index 58af963e5b55..e5e3386077d9 100755
--- a/tools/testing/selftests/tpm2/test_smoke.sh
+++ b/tools/testing/selftests/tpm2/test_smoke.sh
@@ -5,5 +5,7 @@
 ksft_skip=4
 
 [ -e /dev/tpm0 ] || exit $ksft_skip
+read tpm_version < /sys/class/tpm/tpm0/tpm_version_major
+[ "$tpm_version" == 2 ] || exit $ksft_skip
 
 python3 -m unittest -v tpm2_tests.SmokeTest
-- 
2.46.0


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

* Re: [PATCH 2/2] selftests: tpm2: test_smoke: Run only when TPM2 is avaialable.
  2024-08-28 11:23 ` [PATCH 2/2] selftests: tpm2: test_smoke: Run only when TPM2 is avaialable Michal Suchanek
@ 2024-08-28 13:32   ` Jarkko Sakkinen
  0 siblings, 0 replies; 3+ messages in thread
From: Jarkko Sakkinen @ 2024-08-28 13:32 UTC (permalink / raw)
  To: Michal Suchanek, linux-integrity
  Cc: Peter Huewe, Jason Gunthorpe, Shuah Khan, linux-kernel,
	linux-kselftest

On Wed Aug 28, 2024 at 2:23 PM EEST, Michal Suchanek wrote:
> Since Linux 5.6 tpm_version_major sysfs file is avaialble which gives
> the TPM version.
>
> Using this file the test can be skipped on systems with TPM 1.2.
>
> Signed-off-by: Michal Suchanek <msuchanek@suse.de>
> ---
>  tools/testing/selftests/tpm2/test_smoke.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/tpm2/test_smoke.sh b/tools/testing/selftests/tpm2/test_smoke.sh
> index 58af963e5b55..e5e3386077d9 100755
> --- a/tools/testing/selftests/tpm2/test_smoke.sh
> +++ b/tools/testing/selftests/tpm2/test_smoke.sh
> @@ -5,5 +5,7 @@
>  ksft_skip=4
>  
>  [ -e /dev/tpm0 ] || exit $ksft_skip
> +read tpm_version < /sys/class/tpm/tpm0/tpm_version_major
> +[ "$tpm_version" == 2 ] || exit $ksft_skip
>  
>  python3 -m unittest -v tpm2_tests.SmokeTest

Thanks, I tagged and reviewed the patches:

https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/log/

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko

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

end of thread, other threads:[~2024-08-28 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 11:23 [PATCH 1/2] MAINTAINERS: Add selftest files to TPM section Michal Suchanek
2024-08-28 11:23 ` [PATCH 2/2] selftests: tpm2: test_smoke: Run only when TPM2 is avaialable Michal Suchanek
2024-08-28 13:32   ` 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).