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 <Nikita.Sobolev@synopsys.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Nikita Sobolev 2020-05-21 17:43:44 +03:00 committed by Shuah Khan
parent 2e9a972566
commit 5627f9cffe
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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