xref: /linux/tools/testing/selftests/tpm2/test_smoke.sh (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1#!/bin/sh
2# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
3
4# Kselftest framework requirement - SKIP code is 4.
5ksft_skip=4
6
7[ -e /dev/tpm0 ] || exit $ksft_skip
8read tpm_version < /sys/class/tpm/tpm0/tpm_version_major
9[ "$tpm_version" == 2 ] || exit $ksft_skip
10
11python3 -m unittest -v tpm2_tests.SmokeTest 2>&1
12