Skip to content

vmm_test: validate MANA VF keepalive during servicing - #4338

Open
erfrimod wants to merge 4 commits into
microsoft:mainfrom
erfrimod:erfrimod/vmm-test-vf-ka
Open

vmm_test: validate MANA VF keepalive during servicing#4338
erfrimod wants to merge 4 commits into
microsoft:mainfrom
erfrimod:erfrimod/vmm-test-vf-ka

Conversation

@erfrimod

@erfrimod erfrimod commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The VMM Petri tests for MANA VF keepalive test the same thing. mana_nic_servicing uses default_servicing_flags, in which enabled_mana_keepalive is set to true.

  • mana_nic_servicing_keepalive and mana_nic_servicing explicitly set servicing flag enable_mana_keepalive
    • mana_nic_servicing_keepalive explicitly set servicing flag enable_nvme_keepalive to match the setting on enable_mana_keepalive to avoid a failure when VF KA is disabled, but NVME KA is enabled.

Copilot AI lite review requested due to automatic review settings August 27, 2026 23:25
@erfrimod
erfrimod requested a review from a team as a code owner August 27, 2026 23:25
@erfrimod erfrimod changed the title vmm_tests: validate MANA VF keepalive during servicing vmm_test: validate MANA VF keepalive during servicing Aug 27, 2026

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

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_core with an explicit vfka_enabled toggle.
  • Adds Inspect-based validation of GDMA HWC session continuity for VFKA (mana_hwc_session_id).
  • Adds post-servicing openhcl.log polling to confirm whether restore_gdma_driver vs new_gdma_driver was selected.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs
Comment thread vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs Outdated
Comment thread vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs
Copilot AI review requested due to automatic review settings September 2, 2026 23:27

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.

🟡 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::DefaultDriver was 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_nic says it "tests that the nic can get an IP address", but DHCP is now performed in configure_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

Comment thread vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs
Copilot AI review requested due to automatic review settings September 2, 2026 23:33

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.

🔵 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_nic runs DHCP immediately after ifconfig eth0 up, but validate_mana_nic only waits for link after DHCP has already run. If carrier comes up slowly, udhcpc can fail and the later carrier wait won't recover, making the test flaky. Also, other Petri tests invoke udhcpc as udhcpc eth0 (positional iface), so using -i here may reduce compatibility with the guest initrd tooling.
    vmm_tests/vmm_tests/tests/tests/multiarch/openhcl_servicing.rs:1782
  • validate_mana_nic relies on the external timeout binary inside the guest. Other Petri tests typically enforce timeouts from Rust using CancelContext, 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_driver vs new_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

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings September 3, 2026 18:17

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.

🟢 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_nic says it tests obtaining an IP via DHCP, but DHCP is now performed in configure_mana_nic (and validate_mana_nic assumes 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants