Skip to content

Conversation

@smitterl
Copy link
Contributor

@smitterl smitterl commented Nov 21, 2025

'generic-ccw' was the standard device name in lszdev in the past but now it's been changed to actually list the virtio device type. However, this test might have to run on older versions still and the test expectation is only that the device is listed for the given device number. So, omit the device type restriction to check all devices. with s390-virtio, there are only virtio devices listed with lszdev (or passed through devices but they are not present here / per default).

Summary by CodeRabbit

  • Tests
    • Updated device ID retrieval mechanism in functional tests with a broader query approach, modifying the test validation scope and potentially affecting device matching conditions.

✏️ Tip: You can customize this high-level summary in your review settings.

'generic-ccw' was the standard device name in lszdev in the past
but now it's been changed to actually list the virtio device type.
However, this test might have to run on older versions still and
the test expectation is only that the device is listed for the given
device number. So, omit the device type restriction to check all
devices. with s390-virtio, there are only virtio devices listed with
lszdev (or passed through devices but they are not present here / per
default).

Signed-off-by: Sebastian Mitterle <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Walkthrough

The change modifies a device query command in a functional test file. Specifically, the lszdev generic-ccw --columns ID command is replaced with lszdev --columns ID in the guest-check path. This broadens the query scope from CCW-specific devices to all devices, altering which output is parsed when matching device IDs during test execution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify that removing the generic-ccw filter does not cause the test to match incorrect or unintended devices
  • Confirm the broader query still successfully identifies the target CCW device number in the output
  • Check if this change affects test pass/fail conditions or introduces false positives in device matching

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change - fixing an s390x-specific test by relaxing device type requirements to accommodate lszdev output variations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch virtio_devs

Comment @coderabbitai help to get the list of available commands and usage tips.

@smitterl
Copy link
Contributor Author

JOB ID     : 9d1be298fbe96807bd8a44c9226b33ce07055024
JOB LOG    : /var/log/avocado/job-results/job-2025-11-21T07.18-9d1be29/job.log
 (1/1) type_specific.io-github-autotest-libvirt.controller.functional.positive_tests.virtio_serial_ccw: STARTED
 (1/1) type_specific.io-github-autotest-libvirt.controller.functional.positive_tests.virtio_serial_ccw: PASS (15.01 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/log/avocado/job-results/job-2025-11-21T07.18-9d1be29/results.html
JOB TIME   : 16.47 s

Copy link

@coderabbitai coderabbitai bot left a 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)
libvirt/tests/src/controller/controller_functional.py (1)

442-442: LGTM – improved compatibility with newer lszdev versions.

The change from lszdev generic-ccw --columns ID to lszdev --columns ID appropriately addresses the evolution of lszdev output format. By removing the device-type restriction, the test remains functional with both older versions (reporting 'generic-ccw') and newer versions (reporting specific virtio device types).

The broader query scope is safe for s390-virtio environments where lszdev inherently lists only virtio devices by default. The test correctly validates device presence by checking the device number (lines 447-451) rather than relying on the reported device type.

Optional: Consider adding a brief inline comment explaining why the device type is not specified, for future maintainers:

-        cmd = 'lszdev --columns ID'
+        # Query all devices (no type filter) to support both old lszdev (generic-ccw)
+        # and new lszdev (reports specific virtio types like virtio-blk, virtio-net)
+        cmd = 'lszdev --columns ID'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 875c970 and b849452.

📒 Files selected for processing (1)
  • libvirt/tests/src/controller/controller_functional.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Python 3.11
  • GitHub Check: Python 3.12
  • GitHub Check: Python 3.8
  • GitHub Check: Python 3.9

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