]> git.proxmox.com Git - swtpm.git/blobdiff - tests/test_tpm2_ibmtss2
tests: Patch IBM TSS2 test suite for OpenSSL 3.x
[swtpm.git] / tests / test_tpm2_ibmtss2
index 16581fda8530e5b97f7b7f6f15dd46fc5e501bf1..6caf4fc095b2a82f3aa93b29c734d73ab25951e6 100755 (executable)
@@ -4,6 +4,11 @@ if [ ${SWTPM_TEST_EXPENSIVE:-0} -eq 0 ]; then
        exit 77
 fi
 
+if [ -z "$(type openssl)" ]; then
+       echo "Openssl command line tool is required."
+       exit 1
+fi
+
 ROOT=${abs_top_builddir:-$(pwd)/..}
 TESTDIR=${abs_top_testdir:-$(dirname "$0")}
 ABSTESTDIR=$(cd ${TESTDIR} &>/dev/null;echo ${PWD})
@@ -28,7 +33,9 @@ function cleanup() {
 trap "cleanup" EXIT
 
 source ${TESTDIR}/common
-WORKDIR=$(mktemp -d)
+skip_test_no_tpm20 "${SWTPM_EXE}"
+
+WORKDIR="$(mktemp -d)" || exit 1
 
 REGLOG=${WORKDIR}/reglog
 
@@ -92,6 +99,10 @@ if [ $revision -lt 155 ]; then
        git am < ${PATCHESDIR}/0009-Disable-getcapability-TPM_CAP_ACT.patch
 fi
 
+if [ -n "$(openssl version | grep -E "^OpenSSL 3")" ]; then
+       git am < ${PATCHESDIR}/0010-Adjust-test-cases-for-OpenSSL-3.patch
+fi
+
 autoreconf --force --install
 unset CFLAGS LDFLAGS LIBS
 ./configure --disable-tpm-1.2
@@ -140,4 +151,4 @@ popd &>/dev/null
 
 [ $ret -eq 0 ] && echo "OK"
 
-exit $ret
\ No newline at end of file
+exit $ret