Skip to content

test: Restructure guest_disk tests - #10811

Merged
frankdavid merged 7 commits into
masterfrom
frankdavid/guest-disk-test-refactor
Jul 21, 2026
Merged

test: Restructure guest_disk tests#10811
frankdavid merged 7 commits into
masterfrom
frankdavid/guest-disk-test-refactor

Conversation

@frankdavid

Copy link
Copy Markdown
Contributor

Move some of the shared logic from tests into the fixture so tests can be written with higher-level helper functions. The modified test fixture models the real GuestOS setup more closely.

Move some of the shared logic from tests into the fixture so tests can be written with higher-level helper functions. The modified test fixture models the real GuestOS setup more closely.
@frankdavid
frankdavid requested a review from a team as a code owner July 17, 2026 12:06
@github-actions github-actions Bot added the test label Jul 17, 2026
@zeropath-ai

zeropath-ai Bot commented Jul 17, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 8293ae6.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Introduce extensive tests for guest disk encryption tooling, including SEV-related flows, partition handling, and key management
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Add new TestFixture, PartitionView, BootSlot abstractions, and helper utilities for SEV-driven scenarios
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Add support for detached and attached LUKS headers, keyslot metadata, and SEV key derivation
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Expand test coverage to verify key exchange, header backup, and store/var partition behaviors under SEV and non-SEV configurations
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Introduce upgrade_sev_guestos_to and rollback flows to simulate SEV-based upgrades and downgrades
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Add tests for opening stores with previous keys, verifying metadata, and ensuring proper header usage
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Add tests for failing to open unformatted devices and detach header handling on format attempts
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Include utilities to decompose and inspect LUKS2 header locations and keyslots
Enhancement ► rs/ic_os/os_tools/guest_disk/src/tests.rs
     Update and extend tests to validate SEV unlock sequences, detached header usage, and token backfills

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the guest_disk test suite by moving repeated low-level setup logic into a richer test fixture that more closely models the real GuestOS disk topology (shared Store + A/B Var slots), enabling higher-level upgrade/rollback-style tests.

Changes:

  • Introduces TestFixture with A/B BootSlots and a PartitionView helper to encapsulate per-partition operations (format/open/header inspection/mapper IO).
  • Updates existing tests to use the higher-level helpers and adds slot-aware upgrade/rollback flows.
  • Cleans up and centralizes common helpers (e.g., key derivation, keyslot counting, detached header handling).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rs/ic_os/os_tools/guest_disk/src/tests.rs
@frankdavid
frankdavid added this pull request to the merge queue Jul 21, 2026
Merged via the queue into master with commit a4f75d6 Jul 21, 2026
37 checks passed
@frankdavid
frankdavid deleted the frankdavid/guest-disk-test-refactor branch July 21, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants