test(#310): the boot guest reads its PCRs only after systemd-pcrphase measured ready, and says so #313
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: rate limited by coderabbit.ai -->
[!WARNING]
## Review limit reached
> You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
> Next included review available in 48 minutes.
> Check out review usage here.
> <details>
<summary>View limit details</summary>
> Limit details: You’ve used the included review currently available.
> Learn how review limits work.
> Review configuration:
> <details>
<summary>⚙️ Run configuration</summary>
> - Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID: 78bdac51-18be-4689-8949-6530601e018a> </details>
> <details>
<summary>📥 Commits</summary>
> Reviewing files that changed from the base of the PR and between 635e187df72efdc1b4972ef2afce76bae192ddb1 and b4d88939df39353e97461f45f80f7b75ab8efde3.
> </details>
> <details>
<summary>📒 Files selected for processing (3)</summary>
> e2e/lib/boot-guest/e2e-report e2e/lib/boot-guest/regalia-e2e-report.service* tests/test_baremetal_unlock_boot.py> </details>
> </details>
<!-- end of auto-generated comment: rate limited by coderabbit.ai -->
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- tips_start -->
---
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
<details>
<summary>❤️ Share</summary>
</details>
<sub>Comment @coderabbitai help to get the list of available commands.</sub>
<!-- tips_end -->
<kbd><img src="https://raw.githubusercontent.com/gitarcode/.github/main/assets/gitar-spin.svg" align="texttop" height="14"> Gitar is working</kbd>
<sub>Gitar</sub>
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
🛡️ Sentinel review — clean. No findings on changed lines.
<!-- sentinel-pr-review engine=4f28185e72a56658a0a5c68cead30c12f60eea85-main -->
<!-- sentinel:scan-report -->
<details><summary>📊 Scan report — every finding in the changed files, ranked, plus the scan summary</summary>
🛡️ Sentinel PR review
3 file(s) changed · 0 introduced by this diff (secrets+SAST) · dependencies unchanged — SCA/CVE not re-scanned. _Advisory — the fail-closed gate is the post-merge pentest._
Findings — ranked by criticality
_No issues found on the changed surface._
🤖 Code review (Flynn)
No issues found.
<details><summary>Scan summary</summary>
| Category | Scope | Findings |
|---|---|---|
| Secrets | this diff | 0 |
| Static analysis | changed files | 0 |
| Dependencies + IaC | skipped (no manifest changed) | 0 |
| Known CVEs | skipped (no manifest changed) | 0 |
</details>
</details>
🛡️ Sentinel review — clean. No findings on changed lines.
<!-- sentinel-pr-review engine=4f28185e72a56658a0a5c68cead30c12f60eea85-main -->
<!-- sentinel:scan-report -->
<details><summary>📊 Scan report — every finding in the changed files, ranked, plus the scan summary</summary>
🛡️ Sentinel PR review
3 file(s) changed · 0 introduced by this diff (secrets+SAST) · dependencies unchanged — SCA/CVE not re-scanned. _Advisory — the fail-closed gate is the post-merge pentest._
Findings — ranked by criticality
_No issues found on the changed surface._
🤖 Code review (Flynn)
No issues found.
<details><summary>Scan summary</summary>
| Category | Scope | Findings |
|---|---|---|
| Secrets | this diff | 0 |
| Static analysis | changed files | 0 |
| Dependencies + IaC | skipped (no manifest changed) | 0 |
| Known CVEs | skipped (no manifest changed) | 0 |
</details>
</details>
copilot-pull-request-reviewer[bot]
jobordu
Closes #310. Root cause by regalia-kms-d9 (on #310): the guest's report unit could read PCR 11 before
systemd-pcrphase.servicemeasuredready. The printed value was exactly the initrd value extended byleave-initrdandsysinit, one phase short of the record'spcr11.system.Changes:
e2e/lib/boot-guest/regalia-e2e-report.service:After=systemd-pcrphase.service. It's already in the transaction throughsysinit.target, so this only orders and adds nothing. This is the fix.e2e-reportprintsREGALIA-E2E-PCRPHASE systemd-pcrphase.service=<ActiveState> <Result>before the PCRs. The test reads the PCR line only throughbooted_pcrs(), which fails with "the PCRs were read before systemd-pcrphase measured ready (#310)" unless the guest sawactive success. If the race ever returns, it fails by name instead of as an unexplained PCR 11 mismatch.Checked locally:
sh -npasses on the script. The helper acceptsactive successand refusesactivatingor a missing phase line. The module still skips without a guest. The QEMU run in CI is the real proof.Read by regalia-kms-d9 at b4d8893, nothing further. d9's blocker is fixed:
systemctl show -p ActiveState,Result --valueprints in systemd's own order, so the script now uses two-Pcalls. The guard raises instead of asserting, and the docstring says it checks ordering only.🤖 Generated with Claude Code