From 85e7999d8b6da538121dbb772875957c3fdfc378 Mon Sep 17 00:00:00 2001 From: lareine Date: Thu, 17 Feb 2022 16:47:02 -0500 Subject: [PATCH] added tpm restart timeout cleanup cleared out tpmserver folder in reset cleared out tpmserver folder in reset --- .ci/setup/container/tpm2_common.sh | 27 ++++++++++++------------- .ci/system-tests/container/rim_setup.sh | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.ci/setup/container/tpm2_common.sh b/.ci/setup/container/tpm2_common.sh index 60b26e81..c402bbf7 100755 --- a/.ci/setup/container/tpm2_common.sh +++ b/.ci/setup/container/tpm2_common.sh @@ -27,7 +27,6 @@ function setTpmPcrValues { make -f makefiletpmc > /dev/null cd ../utils ./startup - popd > /dev/null } @@ -59,7 +58,7 @@ function initTpm2Emulator { echo "DBus started" # Give DBus time to start up - sleep 5 + sleep 3 /ibmtpm/src/./tpm_server & echo "TPM Emulator started" @@ -74,7 +73,7 @@ function initTpm2Emulator { echo "TPM2-Abrmd started" # Give ABRMD time to start and register on the DBus - sleep 2 + sleep 1 # Certificates ek_cert="/HIRS/.ci/setup/certs/ek_cert.der" @@ -113,23 +112,23 @@ function initTpm2Emulator { # Clear our existing PCR values by restarting the ibm tpm simulator function resetTpm2Emulator { -echo "clearing the TPM PCR values" + echo "clearing the TPM PCR values" -pkill -f "tpm2-abrmd" -pkill -f "tpm_server" -/ibmtpm/src/./tpm_server & -sleep 1 - pushd /ibmtss/utils > /dev/null - ./startup -sleep 1 - popd > /dev/null - tpm2-abrmd -t socket & + pkill -f "tpm2-abrmd" + pkill -f "tpm_server" + rm -rf /ibmtpm/tpmvstudio/tpm_server + /ibmtpm/src/./tpm_server & + sleep 1 + pushd /ibmtss/utils > /dev/null + ./startup + sleep 3 + popd > /dev/null + tpm2-abrmd -t socket & } # Function to update the hirs-site.config file function updateHirsSiteConfigFile { HIRS_SITE_CONFIG="/etc/hirs/hirs-site.config" - echo "" echo "===========Updating ${HIRS_SITE_CONFIG}, using values from /HIRS/.ci/docker/.env file...===========" cat /HIRS/.ci/docker/.env diff --git a/.ci/system-tests/container/rim_setup.sh b/.ci/system-tests/container/rim_setup.sh index a3f605e8..7a93114a 100644 --- a/.ci/system-tests/container/rim_setup.sh +++ b/.ci/system-tests/container/rim_setup.sh @@ -79,7 +79,7 @@ if [[ ! -f $pcrScript ]]; then pcrScript="$profileDir/default/"$profile"_default_setpcrs.sh" fi sh $pcrScript; -echo "PCR script was $pcrScript" +#echo "PCR script was $pcrScript" #tpm2_pcrlist -g sha256 # Done with rim_setup \ No newline at end of file