added tests folder

added tests folder

test tcg_boot.properties fix
This commit is contained in:
lareine 2022-02-17 14:50:10 -05:00
parent 4ae04f008e
commit 7013552e78
11 changed files with 22 additions and 19 deletions

View File

@ -9,7 +9,7 @@ services:
ports:
- "${HIRS_ACA_PORTAL_PORT}:${HIRS_ACA_PORTAL_CONTAINER_PORT}"
entrypoint: /bin/bash -c
command: [HIRS/.ci/setup/setup_aca.sh]
command: [HIRS/.ci/setup/container/setup_aca.sh]
hostname: ${HIRS_ACA_HOSTNAME}
networks:
hirs_aca_system_tests:

View File

@ -1,13 +1,15 @@
#!/bin/bash
#########################################################################################
# Script to setup the TPM 2.0 Provisioner Docker Image for System Tests
#
# Script to setup the TPM 2.0 Provisioner for System Tests
# Initial setup only use resetTpm2Emulator to reset PCR values in subsequent tests
#########################################################################################
set -e
pushd / > /dev/null
echo "Setting up TPM emulator for the TPM2 Provisioner"
source /HIRS/.ci/setup/tpm2_common.sh
source /HIRS/.ci/setup/container/tpm2_common.sh
mkdir -p /etc/hirs
touch /etc/hirs/tcg_boot.properties # work around for install issues with tcg default values
#Wait for the ACA to spin up, if it hasnt already
waitForAca
@ -16,7 +18,7 @@ waitForAca
installProvisioner
# set location of tcg artifacts
setTcgProperties
#setTcgProperties
#echo "Contents of /etc/hirs is $(ls -al /etc/hirs)";
# Install TPM 2.0 Emulator
@ -33,4 +35,4 @@ echo "===========HIRS ACA TPM 2.0 Provisioner Setup Complete!==========="
popd > /dev/null
tpm2_pcrlist -g sha256
#tpm2_pcrlist -g sha256

View File

@ -1,6 +1,6 @@
#!/bin/bash
#########################################################################################
# Script to setup the TPM 2.0 Provisioner Docker Image for System Tests
# Support scripts for the TPM 2.0 Provisioner System Tests
#
#########################################################################################
@ -124,7 +124,7 @@ pkill -f "tpm_server"
pushd /ibmtss/utils > /dev/null
./startup
popd
popd > /dev/null
tpm2-abrmd -t socket &
}

View File

@ -2,6 +2,7 @@
#########################################################################################
# Setup for platform certificates for testing
# Copies platform certs (Base and Delta) to the tcg directory
# usage pc_setup.sh <profile> <test>
#########################################################################################
profile=$1

View File

@ -1,7 +1,8 @@
#!/bin/bash
#########################################################################################
# Setup for PC Client Reference Integrity Manifest (RIM) tests
#
# usage rim_setup.sh <profile> <test> <option>
# use "clear" option to clear existing TPM PCR values
#########################################################################################
profile=$1
@ -17,7 +18,7 @@ swidDir="$testDir/swidtags"
rimDir="$testDir/rims"
pcrScript="$testDir/"$profile"_"$test"_setpcrs.sh"
source /HIRS/.ci/setup/tpm2_common.sh
source /HIRS/.ci/setup/container/tpm2_common.sh
echo "Test is using RIM files from $profile : $test"
@ -36,7 +37,7 @@ if [[ ! -f "$eventLog" ]]; then
eventLog="$defaultDir"/"$profile"_default_binary_bios_measurements
fi
sed -i "s:tcg.event.file=.*:tcg.event.file=$eventLog:g" "$propFile"
echo "eventLog was $eventLog"
#echo "eventLog used was $eventLog"
# Step 2: Copy Base RIM files to the TCG folder
# a: See if test specific swidtag folder exists, if not use the defualt folder
@ -63,13 +64,12 @@ pushd $rimDir > /dev/null
fi
popd > /dev/null
echo "Contents of tcg swidtag folder $tcgDir/manifest/swidtag/ : $(ls $tcgDir/manifest/swidtag/)"
echo "Contents of tcg rim folder tcgDir/manifest/rim/: $(ls $tcgDir/manifest/rim/)"
# echo "Contents of tcg swidtag folder $tcgDir/manifest/swidtag/ : $(ls $tcgDir/manifest/swidtag/)"
# echo "Contents of tcg rim folder tcgDir/manifest/rim/: $(ls $tcgDir/manifest/rim/)"
#Step 4, run the setpcr script to make the TPM emulator hold values that correspond the binary_bios_measurement file
# a: Clear the TPM PCR registers vi a call to the tss clear
# b: Check if a test specific setpcr.sh file exists. If not use the profiles default script
echo "Options were $options"
if [[ $options == "clear" ]]; then
resetTpm2Emulator
@ -80,6 +80,6 @@ if [[ ! -f $pcrScript ]]; then
fi
sh $pcrScript;
echo "PCR script was $pcrScript"
tpm2_pcrlist -g sha256
#tpm2_pcrlist -g sha256
# Done with rim_setup

View File

@ -31,14 +31,14 @@ echo "ACA Container info: $(checkContainerStatus $aca_container)";
echo "TPM2 Provisioner Container info: $(checkContainerStatus $tpm2_container)";
# Install HIRS provioner and setup tpm2 emulator
docker exec $tpm2_container /HIRS/.ci/setup/setup_tpm2provisioner.sh
docker exec $tpm2_container /HIRS/.ci/setup/container/setup_tpm2provisioner.sh
# ********* Execute system tests here, add tests as needed *************
echo "******** Setup Complete Begin HIRS System Tests ******** "
source aca_policy_tests.sh
source platform_cert_tests.sh
source rim_system_tests.sh
source tests/aca_policy_tests.sh
source tests/platform_cert_tests.sh
source tests/rim_system_tests.sh
echo "******** HIRS System Tests Complete ******** "