-
Notifications
You must be signed in to change notification settings - Fork 183
netkvm: add test for RX queue size parameter validation #4386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdds a new Windows-only QEMU test configuration ( Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Areas to focus on:
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
Test Result: PASS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
qemu/tests/netkvm_rxcapacity.py (1)
27-44: Minor: Docstring parameter description could be more precise.Line 32 describes
vmas "QEMU test object", but it should be "VM object" since it's the virtual machine instance, not the test object (which is passed separately).Apply this diff if you'd like to improve the docstring:
- :param vm: QEMU test object + :param vm: VM object
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
qemu/tests/cfg/netkvm_rxcapacity.cfg(1 hunks)qemu/tests/netkvm_rxcapacity.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
qemu/tests/netkvm_rxcapacity.py (1)
qemu/tests/ovs_host_vlan.py (1)
ping(53-76)
🔇 Additional comments (5)
qemu/tests/cfg/netkvm_rxcapacity.cfg (1)
10-22: LGTM: Test variants are well-structured.The three test variants provide good coverage with different rx_queue_size and rx_capacity_value combinations.
qemu/tests/netkvm_rxcapacity.py (4)
1-5: LGTM: Imports are appropriate.All necessary modules are imported for the test functionality.
7-25: LGTM: Well-documented test entry point.The function signature and docstring clearly describe the test purpose and steps.
70-100: LGTM: Test setup and verification logic is sound.The test properly initializes the VM, sets RxCapacity, retrieves RxQueueSize from WMI, and verifies the values match expectations.
114-115: LGTM: Proper cleanup in finally block.The session is correctly closed in a finally block to ensure cleanup occurs even if the test fails.
qemu/tests/cfg/netkvm_rxcapacity.cfg
Outdated
| image_snapshot = yes | ||
| driver_verifier = netkvm | ||
| wmi_cmd_url = "WIN_UTILS:\\netkvm\\WMI\\netkvm-wmi.cmd" | ||
| wmi_cmd_path = "C:\\netkvm-wmi.cmd" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical: Parameter name mismatch with Python test code.
The config file defines wmi_cmd_path, but the Python test at line 52 of netkvm_rxcapacity.py uses params.get("netkvm_wmi_path", ...). This mismatch will cause the test to always use the hardcoded default value instead of this configured path.
Apply this diff to fix the parameter name:
- wmi_cmd_path = "C:\\netkvm-wmi.cmd"
+ netkvm_wmi_path = "C:\\netkvm-wmi.cmd"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| wmi_cmd_path = "C:\\netkvm-wmi.cmd" | |
| netkvm_wmi_path = "C:\\netkvm-wmi.cmd" |
🤖 Prompt for AI Agents
In qemu/tests/cfg/netkvm_rxcapacity.cfg around line 8, the parameter is named
wmi_cmd_path but the Python test reads netkvm_wmi_path; rename the parameter in
this config to netkvm_wmi_path (preserving the same Windows path value) so the
test's params.get will find the configured value instead of using its hardcoded
default.
This patch adds a test to verify that QEMU's rx_queue_size parameter correctly influences the Windows guest's reported RxQueueSize value when RxCapacity is configured via netkvmco.exe. Signed-off-by: wji <[email protected]>
69d06e3 to
e5a5d74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
qemu/tests/netkvm_rxcapacity.py (1)
27-45: Remove unusedsessionparameter in helper.
set_and_verify_rxcapacitynever references itssessionargument. Please drop it (and the corresponding argument at the call site) to avoid confusion about dependencies.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
qemu/tests/cfg/netkvm_rxcapacity.cfg(1 hunks)qemu/tests/netkvm_rxcapacity.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- qemu/tests/cfg/netkvm_rxcapacity.cfg
🧰 Additional context used
🧬 Code graph analysis (1)
qemu/tests/netkvm_rxcapacity.py (1)
qemu/tests/ovs_host_vlan.py (1)
ping(53-76)
This patch adds a test to verify that QEMU's rx_queue_size parameter correctly influences the Windows guest's reported RxQueueSize value when RxCapacity is configured via netkvmco.exe.
ID: 2914
Signed-off-by: wji [email protected]
Summary by CodeRabbit