2024-05-01 18:20:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#########################################################################################
|
|
|
|
# Script to setup the TPM Provisioner.NET for System Tests
|
|
|
|
#########################################################################################
|
|
|
|
|
|
|
|
# Setting configurations
|
2024-07-22 10:03:09 +00:00
|
|
|
. /hirs/.ci/docker/.env
|
|
|
|
source /hirs/.ci/setup/container/tpm2_common.sh
|
2024-05-01 18:20:51 +00:00
|
|
|
|
|
|
|
set -a
|
|
|
|
|
|
|
|
set -e
|
|
|
|
echo "*** Setting up TPM emulator for the TPM2 Provisioner *** "
|
|
|
|
|
|
|
|
# Wait for ACA to boot
|
2024-07-22 10:03:09 +00:00
|
|
|
waitForAca
|
2024-05-01 18:20:51 +00:00
|
|
|
|
2024-06-07 10:28:25 +00:00
|
|
|
## Un-package Provisioner.NET RPM
|
|
|
|
yes | dnf install HIRS_Provisioner.NET/hirs/bin/Release/net6.0/linux-x64/HIRS_Provisioner.NET.2.2.0.linux-x64.rpm -y > /dev/null
|
2024-05-01 18:20:51 +00:00
|
|
|
|
2024-06-07 10:28:25 +00:00
|
|
|
# Initiate startup for IBMTSS Tools
|
2024-07-22 10:03:09 +00:00
|
|
|
startFreshTpmServer -f
|
|
|
|
startupTpm
|
|
|
|
installEkCert
|
2024-05-01 18:20:51 +00:00
|
|
|
|
2024-07-22 10:03:09 +00:00
|
|
|
setCiHirsAppsettingsFile
|
2024-05-01 18:20:51 +00:00
|
|
|
|
2024-06-07 10:28:25 +00:00
|
|
|
# Triggering a single provision for test
|
|
|
|
echo "==========="
|
|
|
|
echo "*** INITIAL TEST: Single Provision with Default Policy:"
|
|
|
|
echo "==========="
|
|
|
|
/usr/share/hirs/tpm_aca_provision --tcp --ip 127.0.0.1:2321 --sim
|