Repository navigation
firmware_uefi: test NVRAM quota enforcement - #5071
Open
Mike Ebersol (mebersol) wants to merge 1 commit into
Open
Mike Ebersol (mebersol) wants to merge 1 commit into
Mike Ebersol (mebersol) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the NVRAM capacity regression-test additions.
No open issues 🎉
What changed in this PR
Adds regression tests for OpenHCL’s NVRAM capacity enforcement at the storage and guest-command layers. Production behavior is unchanged.
Changes:
- Test exact-capacity rejection without live or persisted state changes, plus space reclamation and reload.
- Verify guest-visible quota and size-limit errors during boot and runtime, preserving existing attributes and data.
| File | Description |
|---|---|
vm/devices/firmware/hcl_compat_uefi_nvram_storage/src/lib.rs |
Adds storage quota, state-preservation, reclamation, and reload tests. |
vm/devices/firmware/firmware_uefi/src/service/nvram/mod.rs |
Generalizes the test helper and tests EFI status write-back using the HCL-compatible store. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Copilot]
Why
Protect OpenHCL's existing NVRAM capacity enforcement against regressions. Store exhaustion must return
EFI_OUT_OF_RESOURCES, while oversized variables must returnEFI_INVALID_PARAMETER, without changing existing contents.What Changed
Add exact-capacity tests for rejected insert, replacement, and append operations, preservation of live and persisted state, space reclamation through shrink/delete, and reload.
Exercise the real HCL-compatible store through guest command descriptors during boot and runtime, checking guest-visible status write-back and preservation of existing variable attributes and data.
This is a test-only change; production enforcement already handles these cases correctly.
Validation
WSL Linux x64, Rust stable 1.99.1, packages
firmware_uefiandhcl_compat_uefi_nvram_storage:cargo check: passed.cargo clippy --all-targets: completed with warnings in unchanged code.cargo doc --no-deps: passed.cargo nextest run --profile agent: 51 passed, none skipped.cargo xtask fmt --fix: passed, including lints and flowey verification.Focused coverage collection was attempted but failed during coverage-helper setup before executing tests. No coverage result is claimed. VM boot, Windows, and ARM64 were not tested.