aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/tpm2/test_space.sh
diff options
context:
space:
mode:
authorNikita Sobolev <Nikita.Sobolev@synopsys.com>2020-01-31 18:25:23 +0300
committerShuah Khan <skhan@linuxfoundation.org>2020-02-10 18:00:40 -0700
commitb32694cd0724d4ceca2c62cc7c3d3a8d1ffa11fc (patch)
treeb8b054c1a0f392efd15ccfb743fa393ecaf005d8 /tools/testing/selftests/tpm2/test_space.sh
parentselftests/ftrace: Have pid filter test use instance flag (diff)
downloadlinux-dev-b32694cd0724d4ceca2c62cc7c3d3a8d1ffa11fc.tar.xz
linux-dev-b32694cd0724d4ceca2c62cc7c3d3a8d1ffa11fc.zip
Kernel selftests: tpm2: check for tpm support
tpm2 tests set fails if there is no /dev/tpm0 and /dev/tpmrm0 supported. Check if these files exist before run and mark test as skipped in case of absence. Signed-off-by: Nikita Sobolev <Nikita.Sobolev@synopsys.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to '')
-rwxr-xr-xtools/testing/selftests/tpm2/test_space.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/testing/selftests/tpm2/test_space.sh b/tools/testing/selftests/tpm2/test_space.sh
index a6f5e346635e..180b469c53b4 100755
--- a/tools/testing/selftests/tpm2/test_space.sh
+++ b/tools/testing/selftests/tpm2/test_space.sh
@@ -1,4 +1,11 @@
#!/bin/bash
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
-python -m unittest -v tpm2_tests.SpaceTest
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
+if [ -f /dev/tpmrm0 ] ; then
+ python -m unittest -v tpm2_tests.SpaceTest
+else
+ exit $ksft_skip
+fi