Skip to content

Gate SR-IOV tests by expected VF driver - #4665

Open
SrikanthMyakam (SRIKKANTH) wants to merge 1 commit into
mainfrom
smyakam/expected_vf_driver/2026_08_11
Open

Gate SR-IOV tests by expected VF driver#4665
SrikanthMyakam (SRIKKANTH) wants to merge 1 commit into
mainfrom
smyakam/expected_vf_driver/2026_08_11

Conversation

@SRIKKANTH

@SRIKKANTH SrikanthMyakam (SRIKKANTH) commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Add an optional case-visible expected_vf_driver variable that validates mlx or mana VF drivers before SR-IOV and VF test cases run. Refresh NIC data before validation, report actionable failures, and document the runbook configuration.

Example:
variable:
- name: expected_vf_driver
value: mana
is_case_visible: true

When expected_vf_driver is provided, all SRIOV area test cases and any tests with sriov or vf in their names will verify that the VF driver matches the specified value. Any mismatch will cause the test to fail.

As most VM sizes, including both older and newer generations, now support both MANA and MLX NICs, this feature helps ensure that test execution targets the correct NIC type.

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

verify_inet_diag_destroy|verify_inet_diag_enabled|validate_netvsc_reload|verify_network_interface_reload_via_ip_link|verify_ringbuffer_settings_change|verify_device_channels_change|verify_device_enabled_features|verify_device_gro_lro_settings_change|verify_device_rss_hash_key_change|verify_device_rx_hash_level_change|verify_device_msg_level_change|verify_device_statistics|verify_services_state|verify_sriov_basic|verify_sriov_single_vf_connection|verify_sriov_max_vf_connection|verify_sriov_disable_enable|verify_sriov_disable_enable_pci

Impacted LISA Features:

Tested Azure Marketplace Images:

  • Canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Test Results

Image VM Size Result
Canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest Standard_D32s_v5 PASSED

Add an optional case-visible expected_vf_driver variable that validates mlx or mana VF drivers before SR-IOV and VF test cases run. Refresh NIC data before
validation, report actionable failures, and document the runbook configuration.

Example:
  variable:
    - name: expected_vf_driver
      value: mana
      is_case_visible: true

If 'expected_vf_driver' passed as all testcases under sriov testarea and testcases with 'sriov' or 'vf' in their name will validate the VF driver against the expected value. If the validation fails, the test will fail.

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 adds an opt-in “expected VF driver” gate that runs before applicable test cases to ensure the provisioned VM exposes the intended SR-IOV VF driver (e.g., MANA vs MLX), helping keep SR-IOV/VF test runs aligned with the targeted NIC type.

Changes:

  • Adds a pre-before_case gate in TestSuite controlled by a case-visible expected_vf_driver runbook variable, applied to SRIOV-area tests and tests whose names contain sriov/vf.
  • Implements VF driver detection in Nics by mapping normalized driver types to kernel module name prefixes and checking currently used NIC modules.
  • Documents the new runbook variable and how to configure it.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
lisa/testsuite.py Adds the expected_vf_driver gating logic executed before before_case.
lisa/nic.py Introduces VF driver type support and Nics.has_vf_driver() detection via module prefixes.
docs/run_test/runbook.rst Documents expected_vf_driver usage and expected behavior.

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

Comment thread lisa/testsuite.py
Comment on lines +934 to +938
node = test_kwargs.get("node")
if node is None:
raise SkippedException(
"'expected_vf_driver' is set but no node is available to inspect "
"for a VF driver. Verify the environment has a deployed node."
@LiliDeng

Copy link
Copy Markdown
Collaborator

AI Test Case Selection

Selected 1 test case(s): smoke_test

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Result: Succeeded

View full logs in Azure DevOps

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.

3 participants