Skip to content

Commit c9a2bb6

Browse files
haitaohuangCopilot
andcommitted
ci: add mock quote retry test to integration-emu matrix
Adds a new 'Mock Quote Retry' test that exercises the quote retry logic by enabling mock_quote_retry feature. The test verifies: - Migration completes successfully after 8 simulated quote failures - Both source and destination logs contain exactly 8 retry failures and at least 1 success message Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
1 parent 339aa07 commit c9a2bb6

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/integration-emu.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ jobs:
8585
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"
8686
artifact-name: "spdm-rebind-skip-ra-test-logs"
8787

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+
8895
steps:
8996
- name: Harden the runner (Audit all outbound calls)
9097
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
@@ -218,6 +225,38 @@ jobs:
218225
fi
219226
fi
220227
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+
221260
- name: Upload test artifacts on failure
222261
if: failure()
223262
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0

0 commit comments

Comments
 (0)