mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-21 05:53:27 +00:00
ec8c4b5c3e
* [#71] Initial Dockerization of TPM 1.2 Provisioner * Fix permissions on new script * Fix current bugs * [#71] Try a new direction for setting up TPM 1.2 Provisioner Testing * [#71] Attempt to the latest version of Trousers on Travis CI VM for 1.2 Provisioner support * [#71] Try IBM TPM 1.2 Emulator * [#71] Move towards cleaning up work * [#71] Update TPM1.2 Provisioner Docker to work with Docker Compose in Systems Test * [#71] Get TPM 1.2 Provisioner to provision successfully in Docker container * Update system tests script to include TPM 1.2 Provisioner container * [#71] Separate TPM 1.2 and 2.0 Provisioner System Tests * [#71] Pipe TPM Emulator log output to file to clear up system test output
57 lines
1.4 KiB
Bash
Executable File
57 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script to run the System Tests for HIRS TPM 1.2 Provisioner
|
|
|
|
set -e
|
|
|
|
echo ""
|
|
echo "System Tests Starting..."
|
|
echo ""
|
|
|
|
# Start System Testing Docker Environment
|
|
cd .ci/docker
|
|
|
|
docker-compose up -d
|
|
|
|
tpm_container_id="$(docker ps -aqf "name=hirs-aca-provisioner")"
|
|
echo "TPM Container ID: $tpm_container_id"
|
|
|
|
tpm_container_status="$(docker inspect $tpm_container_id --format='{{.State.Status}}')"
|
|
echo "TPM Container Status: $tpm_container_status"
|
|
|
|
while [[ $tpm_container_status == "running" ]]
|
|
do
|
|
sleep 10
|
|
|
|
# Add status message, so Travis will not time out.
|
|
# It may timeout if it hasn't received output for more than 10 minutes.
|
|
echo "Still running tests, please wait..."
|
|
|
|
tpm_container_status="$(docker inspect $tpm_container_id --format='{{.State.Status}}')"
|
|
done
|
|
|
|
# Store container exit codes
|
|
tpm_container_exit_code="$(docker inspect $tpm_container_id --format='{{.State.ExitCode}}')"
|
|
echo "TPM Container Exit Code: $tpm_container_exit_code"
|
|
|
|
# Display container logs
|
|
echo ""
|
|
echo "===========hirs-aca-provisioner System Tests Log:==========="
|
|
docker logs $tpm_container_id
|
|
|
|
echo ""
|
|
echo "End of TPM 1.2 System Tests, cleaning up..."
|
|
echo ""
|
|
# Clean up services and network
|
|
docker-compose down
|
|
|
|
# Return container exit codes
|
|
if [[ $tpm_container_exit_code == 0 ]]
|
|
then
|
|
echo "SUCCESS: TPM 1.2 System tests passed"
|
|
exit 0
|
|
fi
|
|
|
|
echo "ERROR: System tests failed"
|
|
exit 1
|