|
85 | 85 | test-command: "./migtdemu.sh --operation rebind-prepare --policy-file ./config/AzCVMEmu/policy_v2_signed.json --policy-issuer-chain-file ./config/AzCVMEmu/policy_issuer_chain.pem --skip-ra --features spdm_attestation --both --no-sudo --log-level info" |
86 | 86 | artifact-name: "spdm-rebind-skip-ra-test-logs" |
87 | 87 |
|
| 88 | + - test-name: "Mock Quote Retry" |
| 89 | + test-type: "mock-quote-retry" |
| 90 | + install-jq: 'false' |
| 91 | + timeout-seconds: 900 |
| 92 | + test-command: "./migtdemu.sh --mock-report --mock-quote-retry --both --no-sudo --log-level info" |
| 93 | + artifact-name: "mock-quote-retry-test-logs" |
| 94 | + |
88 | 95 | steps: |
89 | 96 | - name: Harden the runner (Audit all outbound calls) |
90 | 97 | uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0 |
@@ -218,6 +225,38 @@ jobs: |
218 | 225 | fi |
219 | 226 | fi |
220 | 227 |
|
| 228 | + # Verify retry messages for mock-quote-retry test |
| 229 | + if [[ "${{ matrix.test-type }}" == "mock-quote-retry" ]]; then |
| 230 | + echo "" |
| 231 | + echo "=== Verifying quote retry logs ===" |
| 232 | + FAIL=0 |
| 233 | + for LOG in migtd_migration_source.log migtd_migration_destination.log; do |
| 234 | + if [[ ! -f "$LOG" ]]; then |
| 235 | + echo "❌ Missing log file: $LOG" |
| 236 | + FAIL=1 |
| 237 | + continue |
| 238 | + fi |
| 239 | + RETRY_COUNT=$(grep -ac "Simulating quote failure" "$LOG" || true) |
| 240 | + SUCCESS_COUNT=$(grep -ac "Quote generated successfully" "$LOG" || true) |
| 241 | + echo "$LOG: $RETRY_COUNT retry failures, $SUCCESS_COUNT successes" |
| 242 | + if [[ "$RETRY_COUNT" -ne 8 ]]; then |
| 243 | + echo "❌ Expected 8 retry failures in $LOG, got $RETRY_COUNT" |
| 244 | + FAIL=1 |
| 245 | + fi |
| 246 | + if [[ "$SUCCESS_COUNT" -lt 1 ]]; then |
| 247 | + echo "❌ Expected at least 1 success in $LOG" |
| 248 | + FAIL=1 |
| 249 | + fi |
| 250 | + done |
| 251 | + if [[ "$FAIL" -eq 1 ]]; then |
| 252 | + echo "" |
| 253 | + echo "Dumping retry-related log lines:" |
| 254 | + grep -a "retry\|Simulating\|Quote generated\|GetQuote failed" migtd_migration_source.log migtd_migration_destination.log || true |
| 255 | + exit 1 |
| 256 | + fi |
| 257 | + echo "✅ Quote retry verification passed (8 failures + success on both sides)" |
| 258 | + fi |
| 259 | +
|
221 | 260 | - name: Upload test artifacts on failure |
222 | 261 | if: failure() |
223 | 262 | uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
|
0 commit comments