Gate SR-IOV tests by expected VF driver - #4665
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.
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.
| 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." |
AI Test Case SelectionSelected 1 test case(s): smoke_test Marketplace image: Result: Succeeded |
|
After further consideration, this change still requires creating a machine to make the determination, so it doesn't really save any cost. We can use the mana_device_present field in information to identify whether the case is running on MANA, without needing to create another machine just for this check. SrikanthMyakam (@SRIKKANTH) |
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