xref: /linux/tools/testing/selftests/tpm2/test_smoke.sh (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1377ff830SJarkko Sakkinen#!/bin/sh
26ea3dfe1SJarkko Sakkinen# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
36ea3dfe1SJarkko Sakkinen
45627f9cfSNikita Sobolev# Kselftest framework requirement - SKIP code is 4.
55627f9cfSNikita Sobolevksft_skip=4
65627f9cfSNikita Sobolev
788a16840SJarkko Sakkinen[ -e /dev/tpm0 ] || exit $ksft_skip
8*27141f19SMichal Suchanekread tpm_version < /sys/class/tpm/tpm0/tpm_version_major
9*27141f19SMichal Suchanek[ "$tpm_version" == 2 ] || exit $ksft_skip
105627f9cfSNikita Sobolev
1145eb1bf4SMuhammad Usama Anjumpython3 -m unittest -v tpm2_tests.SmokeTest 2>&1
12