Kernel selftests: Add check if TPM devices are supported

TPM2 tests set uses /dev/tpm0 and /dev/tpmrm0 without check if they
are available. In case, when these devices are not available test
fails, but expected behaviour is skipped test.

Signed-off-by: Nikita Sobolev <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
This commit is contained in:
Nikita Sobolev authored and Shuah Khan committed 2020-05-22 13:19:57 -06:00
1 parent 2e9a972566
commit 5627f9cffe
2 files changed
+10

No files matched your search

@@ -1,6 +1,11 @@
#!/bin/bash
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
[ -f /dev/tpm0 ] || exit $ksft_skip
python -m unittest -v tpm2_tests.SmokeTest
python -m unittest -v tpm2_tests.AsyncTest
@@ -1,4 +1,9 @@
#!/bin/bash
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
[ -f /dev/tpmrm0 ] || exit $ksft_skip
python -m unittest -v tpm2_tests.SpaceTest