HIRS/.ci/system-tests/aca_policy_tests.sh

46 lines
1.4 KiB
Bash
Raw Normal View History

2021-11-16 21:51:42 +00:00
#!/bin/bash
#########################################################################################
# HIRS ACA Policy System Tests
#
#########################################################################################
testResult=false
totalTests=0;
failedTests=0;
# Start ACA Policy Tests
# provision_tpm takes 1 parameter (the expected result): "pass" or "fail"
write_to_logs "ACA POLICY TEST 1: Test ACA default policy "
setPlatformCerts "laptop" "empty"
2021-11-16 21:51:42 +00:00
provision_tpm2 "pass"
write_to_logs "ACA POLICY TEST 2: Test EK cert Only Validation Policy without a EK Issuer Cert in the trust store"
2021-11-17 16:33:44 +00:00
setPolicyEkOnly
provision_tpm2 "fail"
2021-11-16 21:51:42 +00:00
write_to_logs "ACA POLICY TEST 3: Test EK Only Validation Policy"
2021-11-16 21:51:42 +00:00
uploadTrustedCerts
provision_tpm2 "pass"
write_to_logs "ACA POLICY TEST 4: Test PC Validation Policy with no PC"
2021-11-16 21:51:42 +00:00
setPolicyEkPc_noAttCheck
provision_tpm2 "fail"
write_to_logs "ACA POLICY TEST 5: Test FW and PC Validation Policy with no PC"
2021-11-16 21:51:42 +00:00
setPolicyEkPcFw
provision_tpm2 "fail"
write_to_logs "### ACA POLICY TEST 6: Test PC Validation Policy with valid PC ###"
clearAcaDb
setPolicyEkPc
uploadTrustedCerts
setPlatformCerts "laptop" "default"
provision_tpm2 "pass"
2021-11-16 21:51:42 +00:00
# Process Test Results, any single failure will send back a failed result.
if [[ $failedTests != 0 ]]; then
export TEST_STATUS=1;
echo "**** $failedTests out of $totalTests ACA Policy Tests Failed! ****"
else
echo "**** $totalTests ACA Policy Tests Passed! ****"
fi