From: Stefan Berger Date: Thu, 27 Aug 2020 23:50:30 +0000 (-0400) Subject: tests: Have softhsm_setup use the temporary directory now X-Git-Tag: v0.7.0-rc1~263 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=83f4e9604551966d4132a5caa281625ca0a4f3af;p=swtpm.git tests: Have softhsm_setup use the temporary directory now Modify the pkcs11 related test case to set the environment variable for softhsm_setup to use the temporary directory for config file and state of softhsm. Also set the SOFTHSM2_CONF environment variable since certtool also uses the pkcs11 module which in turn will look for its config file. Signed-off-by: Stefan Berger --- diff --git a/tests/test_tpm2_samples_swtpm_localca_pkcs11 b/tests/test_tpm2_samples_swtpm_localca_pkcs11 index 372a639..0af7a0f 100755 --- a/tests/test_tpm2_samples_swtpm_localca_pkcs11 +++ b/tests/test_tpm2_samples_swtpm_localca_pkcs11 @@ -10,6 +10,17 @@ TESTDIR=${abs_top_testdir:-$(dirname "$0")} SWTPM_LOCALCA=${TOPSRC}/samples/swtpm-localca workdir=$(mktemp -d) +if [ $? -ne 0 ]; then + exit 1 +fi + +# Have softhsm_setup use 'workdir'. +export SOFTHSM_SETUP_CONFIGDIR="${workdir}" + +# Since we will be using the pkcs11 module as well via certtool +# we have to set the environment variable to point to its config file. +# This has to be the same as for swtpm_setup sets it. +export SOFTHSM2_CONF="${workdir}"/softhsm2.conf ek="80" # 2048 bit key must have highest bit set for ((i = 1; i < 256; i++)); do