You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a #[patina_test] function in patina-dxe-core-qemu (or wherever the Q35 test runner lives) that asserts the BPWPS lock primitive in isolation:
Resolve the device path for the Q35 emulated NVMe boot partition.
Issue a Firmware Download + Firmware Commit (action 0x6 replace) to the BP. Expect Ok (the controller accepts the write before any lock is in place).
Call patina_boot::partition::lock_partition_write on the same path. Expect Ok.
Issue a second Firmware Commit. Expect the controller to reject it with Boot Partition Write Protected (surfaced as EfiError::DeviceError from our helper).
This catches regressions in the lock primitive itself: wrong FID, wrong CDW10/CDW11 encoding, wrong opcode, missing flag bits, BPWPS state value off by one. Test runs every CI build of patina-dxe-core-qemu.
Add a path resolver for the test — walk the handle list for the first NVMe Pass-Thru protocol and use that handle's device path. Avoids hardcoding QEMU's PCI topology.
Wire the test into the Q35 binary's TestRunner component under cfg(feature = "test-runner").
Out of scope (separate issue):
Drive-erase integration test (separate sub-issue tracking the product-level "BP survives wipe" invariant).
Add a
#[patina_test]function inpatina-dxe-core-qemu(or wherever the Q35 test runner lives) that asserts the BPWPS lock primitive in isolation:Ok(the controller accepts the write before any lock is in place).patina_boot::partition::lock_partition_writeon the same path. ExpectOk.Boot Partition Write Protected(surfaced asEfiError::DeviceErrorfrom our helper).This catches regressions in the lock primitive itself: wrong FID, wrong CDW10/CDW11 encoding, wrong opcode, missing flag bits, BPWPS state value off by one. Test runs every CI build of
patina-dxe-core-qemu.Steps:
apply_boot_partition_imagehelper (or inline FW Download/Commit packets) so the test can issue the "write" half. This same helper will be the production caller for capsule update (Apply SRE WIM capsule update to boot partition #52); landing it here lets the test exist before Apply SRE WIM capsule update to boot partition #52 is fully implemented.TestRunnercomponent undercfg(feature = "test-runner").Out of scope (separate issue):
tests/qtest/nvme-test.cindependently.Depends on: #74 (QEMU BP + Firmware Download/Commit), #79 (QEMU BPWPS state machine + Commit rejection).