swtpm/tests/test_tpm2_print_capabilities
Marc-André Lureau c48dd1e279 tests: test for availability of TPM 2.0 support in swtpm
Skip test cases for TPM 2.0 if TPM 2.0 support is not provided by swtpm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-08-10 07:13:24 -04:00

21 lines
429 B
Bash
Executable File

#!/usr/bin/env bash
TESTDIR=${abs_top_testdir:-$(dirname "$0")}
ROOT=${abs_top_builddir:-$(dirname "$0")/..}
source ${TESTDIR}/common
skip_test_no_tpm20 "${SWTPM_EXE}"
cd "$(dirname "$0")"
export SWTPM_IFACE=cuse
bash _test_tpm2_print_capabilities
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
export SWTPM_IFACE=socket
bash _test_tpm2_print_capabilities
ret=$?
[ $ret -ne 0 ] && [ $ret -ne 77 ] && exit $ret
exit 0