Skip to content

Commit 27141f1

Browse files
hramrachjarkkojs
authored andcommitted
selftests: tpm2: test_smoke: Run only when TPM2 is avaialable.
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 <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 5e515e1 commit 27141f1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/testing/selftests/tpm2/test_smoke.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
ksft_skip=4
66

77
[ -e /dev/tpm0 ] || exit $ksft_skip
8+
read tpm_version < /sys/class/tpm/tpm0/tpm_version_major
9+
[ "$tpm_version" == 2 ] || exit $ksft_skip
810

911
python3 -m unittest -v tpm2_tests.SmokeTest 2>&1

0 commit comments

Comments
 (0)