[#82] Systems Tests not Reporting Failure Correctly (#83)

* Test failing system tests report correctly in Travis.

* Test successful system tests report correctly in Travis.

* Test failing system tests report correctly in Travis.

* Test successful system tests report correctly in Travis.

* Test failing system tests report correctly in Travis.

* Test successful system tests report correctly in Travis.
This commit is contained in:
busaboy1340 2019-02-01 06:00:10 -05:00 committed by GitHub
parent bce78c0122
commit afd5fd29e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,13 +24,17 @@ do
sleep 10
# Add status message, so Travis will not time out.
# It may timeout if it has'nt received output for more than 10 minutes.
# It may timeout if it hasn't received output for more than 10 minutes.
echo "Still running tests, please wait..."
tpm2_container_status="$(docker inspect $tpm2_container_id --format='{{.State.Status}}')"
done
# Store TPM2 container exit code
tpm2_container_exit_code="$(docker inspect $tpm2_container_id --format='{{.State.ExitCode}}')"
echo "TPM2 Container Exit Code: $tpm2_container_exit_code"
# Display TPM2 container log
echo ""
echo "===========hirs-aca-provisioner-tpm2 System Tests Log:==========="
docker logs $tpm2_container_id
@ -38,4 +42,15 @@ docker logs $tpm2_container_id
echo ""
echo "End of System Tests, cleaning up..."
echo ""
# Clean up services and network
docker-compose down
# Return TPM2 container exit code
if [[ $tpm2_container_exit_code == 0 ]]
then
echo "SUCCESS: System tests passed"
exit 0
fi
echo "ERROR: System tests failed"
exit 1