vmm_test: validate MANA VF keepalive during servicing - #4338
Conversation
There was a problem hiding this comment.
Pull request overview
This PR strengthens the OpenHCL servicing Petri tests around MANA VF keepalive (VFKA) by making the keepalive flags explicit, adding validation that the GDMA driver HWC session is preserved across servicing when VFKA is enabled, and asserting the expected post-servicing codepath via openhcl.log traces.
Changes:
- Refactors MANA NIC servicing tests into a shared
mana_nic_servicing_corewith an explicitvfka_enabledtoggle. - Adds Inspect-based validation of GDMA HWC session continuity for VFKA (
mana_hwc_session_id). - Adds post-servicing
openhcl.logpolling to confirm whetherrestore_gdma_drivervsnew_gdma_driverwas selected.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
There is at least one confirmed lint-breaking unused import and a mismatch between the PR description and the implemented validations (log/session-id checks not present).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs:32
- Unused import
pal_async::DefaultDriverwas added but is not referenced anywhere in this file; this will trigger unused-import linting in CI.
use petri::MemoryConfig;
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs:1773
- The doc comment for
validate_mana_nicsays it "tests that the nic can get an IP address", but DHCP is now performed inconfigure_mana_nic; this function only validates link/IP state and connectivity.
/// implementation. Also sends one Ping.
///
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
The updated NIC setup/validation introduces a real flake risk (DHCP before carrier readiness) and the implementation does not include the additional OpenHCL log/session-ID validation described in the PR text.
Review details
Suppressed comments (3)
Previously missed (2) — in code that hasn't changed since the last review.
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs:1769
configure_mana_nicruns DHCP immediately afterifconfig eth0 up, butvalidate_mana_niconly waits for link after DHCP has already run. If carrier comes up slowly,udhcpccan fail and the later carrier wait won't recover, making the test flaky. Also, other Petri tests invoke udhcpc asudhcpc eth0(positional iface), so using-ihere may reduce compatibility with the guest initrd tooling.
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs:1782validate_mana_nicrelies on the externaltimeoutbinary inside the guest. Other Petri tests typically enforce timeouts from Rust usingCancelContext, which avoids depending on guest userland availability and yields clearer errors.
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs:1839
- PR description says these tests validate the VF was preserved across servicing (e.g., GDMA driver HWC session ID preserved) and that both tests poll OpenHCL tracing/logs for
restore_gdma_drivervsnew_gdma_driver. In this diff, the tests only toggle keepalive flags and validate guest networking (carrier/ifconfig/ping); there are no assertions against OpenHCL logs or GDMA session state here, so the added validation described in the PR text doesn't appear to be implemented.
/// Test an OpenHCL Linux direct VM with a MANA nic assigned to VTL2 (backed by
/// the MANA emulator), and vmbus relay. Perform servicing with VF keepalive
/// and validate that the nic is still functional.
#[openvmm_test(openhcl_linux_direct_x64 [LATEST_LINUX_DIRECT_TEST_X64])]
async fn mana_nic_servicing_keepalive(
config: PetriVmBuilder<OpenVmmPetriBackend>,
(igvm_file,): (ResolvedArtifact<LATEST_LINUX_DIRECT_TEST_X64>,),
) -> Result<(), anyhow::Error> {
let mut flags = config.default_servicing_flags();
flags.override_version_checks = true;
// When { VF KA: false, NVME KA : true }, `validate_restore` fails.
// The default value of both is true.
// TODO: Should OpenHCL support that scenario?
flags.enable_nvme_keepalive = true;
flags.enable_mana_keepalive = true;
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🟢 Approval recommended
The changes are low-risk and test-focused; only a small doc-comment consistency nit was identified.
Review details
Suppressed comments (1)
vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs:1774
- The doc comment for
validate_mana_nicsays it tests obtaining an IP via DHCP, but DHCP is now performed inconfigure_mana_nic(andvalidate_mana_nicassumes the interface is already up/configured). Updating the comment will avoid misleading future edits/callers.
/// Today this only tests that the nic can get an IP address via consomme's DHCP
/// implementation. Also sends one Ping.
///
/// FUTURE: Test traffic on the nic.
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
The VMM Petri tests for MANA VF keepalive test the same thing.
mana_nic_servicingusesdefault_servicing_flags, in whichenabled_mana_keepaliveis set totrue.mana_nic_servicing_keepaliveandmana_nic_servicingexplicitly set servicing flagenable_mana_keepalivemana_nic_servicing_keepaliveexplicitly set servicing flagenable_nvme_keepaliveto match the setting onenable_mana_keepaliveto avoid a failure when VF KA is disabled, but NVME KA is enabled.