Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <msuchanek@suse.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

authored by

Michal Suchanek and committed by
Jarkko Sakkinen
27141f19 5e515e13

+2
+2
tools/testing/selftests/tpm2/test_smoke.sh
··· 5 5 ksft_skip=4 6 6 7 7 [ -e /dev/tpm0 ] || exit $ksft_skip 8 + read tpm_version < /sys/class/tpm/tpm0/tpm_version_major 9 + [ "$tpm_version" == 2 ] || exit $ksft_skip 8 10 9 11 python3 -m unittest -v tpm2_tests.SmokeTest 2>&1