Gate SR-IOV tests by expected VF driver - #4665
Open
SrikanthMyakam (SRIKKANTH) wants to merge 1 commit into
Open
Conversation
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.
SrikanthMyakam (SRIKKANTH)
requested review from
LiliDeng and
Johnson (johnsongeorge-w)
as code owners
August 12, 2026 20:51
Copilot started reviewing on behalf of
SrikanthMyakam (SRIKKANTH)
August 12, 2026 20:51
View session
Contributor
There was a problem hiding this comment.
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_casegate inTestSuitecontrolled by a case-visibleexpected_vf_driverrunbook variable, applied to SRIOV-area tests and tests whose names containsriov/vf. - Implements VF driver detection in
Nicsby 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 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." |
Collaborator
AI Test Case SelectionSelected 1 test case(s): smoke_test Marketplace image: Result: Succeeded |
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.
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
Checklist
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:
Test Results