Skip to content

Improve test cases for update_device to create guest XML by the framework#6822

Open
yiqianwei wants to merge 1 commit intoautotest:masterfrom
yiqianwei:LIBVIRTAT-22356
Open

Improve test cases for update_device to create guest XML by the framework#6822
yiqianwei wants to merge 1 commit intoautotest:masterfrom
yiqianwei:LIBVIRTAT-22356

Conversation

@yiqianwei
Copy link
Contributor

@yiqianwei yiqianwei commented Mar 6, 2026

1.Add some parameters to allow the framework provide guest xml
2.Add "only Linux" to limit guest type
3.Remove create ovs and linux_br , let them created by the test loop's environment setup par

ID: LIBVIRTAT-22356

Summary by CodeRabbit

  • Tests

    • Added Linux-only constraints and VM lifecycle controls (create VM, no-reboot flow, forced VM termination) across virtual-network update-device tests.
    • Updated OVMF options to handle NVRAM during VM termination.
    • Simplified interface attribute declarations by removing default extra_attrs.
  • Refactor

    • Simplified bridge handling: derive bridge target from provided network destination, skip/cancel OVS bridge cases, and avoid creating/deleting platform bridges during tests.

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Multiple virtual_network update_device test configs were modified to restrict execution to Linux and add libvirt VM lifecycle flags: create_vm_libvirt = yes, use_no_reboot = yes, kill_vm_libvirt = yes, and ovmf.kill_vm_libvirt_options = --nvram. One config removed an extra_attrs default and its usage. Test code now accepts a netdst parameter to derive bridge names when provided, calls network_base.cancel_if_ovs_bridge and network_base.setup_ovs_bridge_attrs to detect/handle OVS, and no longer creates or deletes Linux/OVS bridges inside the tests; interface update and VM XML logic remain.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main objective: improving test cases to have guest XML created by the framework rather than manually in tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Tip

Migrating from UI to YAML configuration.

Use the @coderabbitai configuration command in a PR comment to get a dump of all your UI settings in YAML format. You can then edit this YAML file and upload it to the root of your repository to configure CodeRabbit programmatically.

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@libvirt/tests/cfg/virtual_network/update_device/update_device_coalesce.cfg`:
- Line 39: The dict assigned to iface_attrs ends with an extra closing brace
causing a syntax error after variable substitution; edit the expression that
constructs iface_attrs (the line containing iface_attrs = {'type_name':
'${iface_type}', **${coalesce}, **${iface_source}, 'model': 'virtio',
'mac_address': mac}}) and remove the trailing extra `}` so the dict ends with a
single `}`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a1366821-aefd-4bee-a059-e18fa82dc52b

📥 Commits

Reviewing files that changed from the base of the PR and between c4f0afd and 1ac8fdc.

📒 Files selected for processing (8)
  • libvirt/tests/cfg/virtual_network/update_device/update_device_coalesce.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_link_state.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_source.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_identifier.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_active.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_inactive.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_unchangable.cfg
  • libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py

@yiqianwei
Copy link
Contributor Author

yiqianwei commented Mar 10, 2026

Test results:
update_iface_source.cfg:
(1/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_source.default_net_to_nat.q35: PASS (90.94 s)
(2/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_source.br_to_br.q35: PASS (102.86 s)
(3/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_source.direct_vepa_to_br.q35: PASS (69.97 s)
(4/4) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_source.default_net_to_direct_net.q35: PASS (69.77 s)

update_iface_with_unchangable.cfg:
(1/1) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_unchangable.q35: PASS (64.58 s)

update_iface_with_options_inactive.cfg:
(01/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.live.q35: PASS (10.52 s)
(02/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.live_persistent.q35: PASS (10.52 s)
(03/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.live_config.q35: PASS (10.59 s)
(04/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.live_current.q35: PASS (10.58 s)
(05/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.current.q35: PASS (10.62 s)
(06/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.persistent.q35: PASS (10.64 s)
(07/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.persistent_current.q35: PASS (10.56 s)
(08/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.config.q35: PASS (10.64 s)
(09/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.config_persistent.q35: PASS (10.69 s)
(10/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.inactive_vm.none.q35: PASS (10.65 s)

update_iface_with_options_active.cfg:
(01/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.live.q35: PASS (76.88 s)
(02/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.live_persistent.q35: PASS (77.34 s)
(03/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.live_config.q35: PASS (77.08 s)
(04/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.live_current.q35: PASS (77.10 s)
(05/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.current.q35: PASS (77.10 s)
(06/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.persistent.q35: PASS (77.10 s)
(07/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.persistent_current.q35: PASS (76.22 s)
(08/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.config.q35: PASS (77.00 s)
(09/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.config_persistent.q35: PASS (88.75 s)
(10/10) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.with_options.active_vm.none.q35: PASS (76.95 s)

update_iface_with_identifier.cfg:
(01/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.update.mac_only.q35: PASS (15.36 s)
(02/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.update.alias_only.q35: PASS (15.27 s)
(03/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.update.pci_address_only.q35: PASS (15.21 s)
(04/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.update.right_mac_alias_wrong_pci.q35: PASS (15.28 s)
(05/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.update.right_mac_pci_wrong_alias.q35: PASS (15.25 s)
(06/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.update.wrong_mac_right_alias_pci.q35: PASS (15.30 s)
(07/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.hotunplug.mac_only.q35: PASS (82.27 s)
(08/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.hotunplug.alias_only.q35: PASS (80.29 s)
(09/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.hotunplug.pci_address_only.q35: PASS (80.03 s)
(10/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.hotunplug.right_mac_alias_wrong_pci.q35: PASS (80.81 s)
(11/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.hotunplug.right_mac_pci_wrong_alias.q35: PASS (79.85 s)
(12/12) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_with_identifier.hotunplug.wrong_mac_right_alias_pci.q35: PASS (79.54 s)

@yiqianwei
Copy link
Contributor Author

yiqianwei commented Mar 12, 2026

Test results:
update_iface_link_state.cfg and py:
For linux bridge:
(01/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.virtio.add.q35: PASS (58.09 s)
(02/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.virtio.delete.q35: PASS (70.87 s)
(03/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.virtio.update.q35: PASS (67.95 s)
(04/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.e1000e.add.q35: PASS (58.86 s)
(05/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.e1000e.delete.q35: PASS (70.86 s)
(06/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.e1000e.update.q35: PASS (66.90 s)
(07/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.igb.add.q35: PASS (59.25 s)
(08/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.igb.delete.q35: PASS (67.92 s)
(09/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.igb.update.q35: PASS (70.35 s)
(10/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.rtl8139.add.q35: PASS (58.26 s)
(11/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.rtl8139.delete.q35: PASS (70.85 s)
(12/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.rtl8139.update.q35: PASS (70.44 s)
(13/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.direct.virtio.add.q35: PASS (56.81 s)
(14/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.direct.virtio.delete.q35: PASS (66.30 s)
(15/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.direct.virtio.update.q35: PASS (78.19 s)
(16/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.ethernet.virtio.add.q35: PASS (57.75 s)
(17/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.ethernet.virtio.delete.q35: PASS (67.72 s)
(18/18) Host_RHEL.m9.u8.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.ethernet.virtio.update.q35: PASS (67.87 s)

For ovs bridge:
(01/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.virtio.add.q35: PASS (82.77 s)
(02/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.virtio.delete.q35: PASS (95.92 s)
(03/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.virtio.update.q35: PASS (95.97 s)
(04/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.e1000e.add.q35: PASS (83.66 s)
(05/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.e1000e.delete.q35: PASS (97.00 s)
(06/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.e1000e.update.q35: PASS (96.69 s)
(07/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.igb.add.q35: PASS (83.72 s)
(08/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.igb.delete.q35: PASS (96.48 s)
(09/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.igb.update.q35: PASS (96.96 s)
(10/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.rtl8139.add.q35: PASS (83.96 s)
(11/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.rtl8139.delete.q35: PASS (96.88 s)
(12/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.network.rtl8139.update.q35: PASS (95.93 s)
(13/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.direct.virtio.add.q35: PASS (83.40 s)
(14/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.direct.virtio.delete.q35: PASS (96.13 s)
(15/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.direct.virtio.update.q35: PASS (110.59 s)
(16/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.ethernet.virtio.add.q35: CANCEL: Host does not use Linux Bridge (13.73 s)
(17/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.ethernet.virtio.delete.q35: CANCEL: Host does not use Linux Bridge (13.65 s)
(18/18) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.iface_link_state.ethernet.virtio.update.q35: CANCEL: Host does not use Linux Bridge (13.62 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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@libvirt/tests/src/virtual_network/update_device/update_iface_link_state.py`:
- Around line 29-30: The bridge name uses the raw params.get('netdst') value
which can be comma-delimited; normalize netdst before using it by splitting on
the first comma and stripping whitespace, e.g. compute normalized_netdst =
(params.get('netdst') or '').split(',', 1)[0].strip() and then set bridge_name =
normalized_netdst if normalized_netdst else "br_" + rand_id; update the
assignment sites that reference netdst/bridge_name (the variables netdst and
bridge_name in this module) so only the first token is used.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ac0b0140-332c-4708-bcef-59cf323aa393

📥 Commits

Reviewing files that changed from the base of the PR and between a496f2b and 8819ec4.

📒 Files selected for processing (9)
  • libvirt/tests/cfg/virtual_network/update_device/update_device_coalesce.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_link_state.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_source.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_identifier.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_active.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_inactive.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_unchangable.cfg
  • libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py
  • libvirt/tests/src/virtual_network/update_device/update_iface_link_state.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_inactive.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_identifier.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_active.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_link_state.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_source.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_unchangable.cfg

@yiqianwei
Copy link
Contributor Author

Test results:
update_device_coalesce.cfg and update_device_coalesce.py
For ovs bridge:
(1/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.nat_net.delete_iface_coalesce.q35: CANCEL: Host does not use Linux Bridge (12.97 s)
(2/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.nat_net.add_iface_coalesce.q35: CANCEL: Host does not use Linux Bridge (13.05 s)
(3/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.nat_net.update_iface_coalesce.q35: CANCEL: Host does not use Linux Bridge (12.98 s)
(4/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.linux_br.delete_iface_coalesce.q35: CANCEL: Host does not use Linux Bridge (13.04 s)
(5/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.linux_br.add_iface_coalesce.q35: CANCEL: Host does not use Linux Bridge (13.14 s)
(6/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.linux_br.update_iface_coalesce.q35: CANCEL: Host does not use Linux Bridge (13.18 s)
(7/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.ovs_br.delete_iface_coalesce.q35: PASS (72.45 s)
(8/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.ovs_br.add_iface_coalesce.q35: PASS (72.07 s)
(9/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.ovs_br.update_iface_coalesce.q35: PASS (72.53 s)
For linux bridge:
(1/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.nat_net.delete_iface_coalesce.q35: PASS (69.12 s)
(2/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.nat_net.add_iface_coalesce.q35: PASS (69.32 s)
(3/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.nat_net.update_iface_coalesce.q35: PASS (69.24 s)
(4/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.linux_br.delete_iface_coalesce.q35: PASS (69.32 s)
(5/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.linux_br.add_iface_coalesce.q35: PASS (69.86 s)
(6/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.linux_br.update_iface_coalesce.q35: PASS (68.75 s)
(7/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.ovs_br.delete_iface_coalesce.q35: CANCEL: Skip OVS bridge test as the host uses Linux bridge (11.64 s)
(8/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.ovs_br.add_iface_coalesce.q35: CANCEL: Skip OVS bridge test as the host uses Linux bridge (11.64 s)
(9/9) Host_RHEL.m10.u2.ovmf.qcow2.virtio_scsi.up.virtio_net.Guest.RHEL.10.2.x86_64.io-github-autotest-libvirt.virtual_network.update_device.coalesce.ovs_br.update_iface_coalesce.q35: CANCEL: Skip OVS bridge test as the host uses Linux bridge (11.73 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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py`:
- Around line 55-62: The current conditional uses iface_type == 'network' which
incorrectly treats the nat_net variant as Linux-bridge-only; change the logic so
only bridge-specific variants (i.e., when br_type == 'linux_br' or br_type ==
'ovs_br' checks) trigger network_base.cancel_if_ovs_bridge(params, test) and
network_base.setup_ovs_bridge_attrs(params, iface_attrs); specifically, remove
or narrow the iface_type == 'network' branch and ensure nat_net
(source={'network': 'default'}) is not rerouted through the OVS setup
path—update the conditional around br_type and iface_type where
network_base.cancel_if_ovs_bridge and network_base.setup_ovs_bridge_attrs are
called so that nat_net runs on both host types.

In `@libvirt/tests/src/virtual_network/update_device/update_iface_link_state.py`:
- Around line 28-29: The code currently uses params.get('netdst', 'virbr0')
which masks an absent netdst and makes the later guards ineffective; change the
params lookup to keep netdst empty when absent (e.g., netdst =
params.get('netdst') or similar) and only normalize/split it when it is present
so bridge_name falls back to "br_" + rand_id when netdst is falsy; update the
assignment of bridge_name (and any other places using netdst) to use the
normalized value only if netdst is truthy, ensuring the existing if not netdst
checks around bridge creation and deletion (references: netdst, bridge_name,
rand_id) will execute correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc23729e-cf6c-4845-81f6-7486fc0dd9e9

📥 Commits

Reviewing files that changed from the base of the PR and between 8819ec4 and 79105b9.

📒 Files selected for processing (9)
  • libvirt/tests/cfg/virtual_network/update_device/update_device_coalesce.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_link_state.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_source.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_identifier.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_active.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_inactive.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_unchangable.cfg
  • libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py
  • libvirt/tests/src/virtual_network/update_device/update_iface_link_state.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_unchangable.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_active.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_identifier.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_link_state.cfg

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.

♻️ Duplicate comments (1)
libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py (1)

55-62: ⚠️ Potential issue | 🟠 Major

Narrow the bridge-type cancel logic to avoid canceling nat_net on OVS hosts.

At Line 55, iface_type == 'network' forces nat_net variants into Linux-bridge-only cancellation, which matches the observed 6/9 CANCEL pattern on OVS hosts and drops coverage.

Proposed fix
-    if br_type == 'linux_br' or iface_type == 'network':
+    if br_type == 'linux_br':
         network_base.cancel_if_ovs_bridge(params, test)
     elif br_type == 'ovs_br':
         br_backend = utils_net.find_bridge_manager(br_name)
         if isinstance(br_backend, utils_net.Bridge):
             test.cancel("Skip OVS bridge test as the host uses Linux bridge")
-    # Setup OVS bridge configuration if needed
-    network_base.setup_ovs_bridge_attrs(params, iface_attrs)
+        # Setup OVS bridge configuration only for ovs_br variants
+        network_base.setup_ovs_bridge_attrs(params, iface_attrs)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py`
around lines 55 - 62, The current conditional (br_type == 'linux_br' or
iface_type == 'network') is too broad and cancels nat_net variants on OVS hosts;
narrow it so nat_net variants are not treated as Linux-bridge-only. Update the
if to only call network_base.cancel_if_ovs_bridge when br_type == 'linux_br' or
(iface_type == 'network' and the params/iface_attrs do NOT indicate a nat_net
variant) — e.g. check params or iface_attrs for the nat_net marker (like a
'nat_net' flag or 'variant' == 'nat_net') before calling
network_base.cancel_if_ovs_bridge; keep the rest of the flow (br_backend check
using utils_net.find_bridge_manager, utils_net.Bridge and
network_base.setup_ovs_bridge_attrs) intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py`:
- Around line 55-62: The current conditional (br_type == 'linux_br' or
iface_type == 'network') is too broad and cancels nat_net variants on OVS hosts;
narrow it so nat_net variants are not treated as Linux-bridge-only. Update the
if to only call network_base.cancel_if_ovs_bridge when br_type == 'linux_br' or
(iface_type == 'network' and the params/iface_attrs do NOT indicate a nat_net
variant) — e.g. check params or iface_attrs for the nat_net marker (like a
'nat_net' flag or 'variant' == 'nat_net') before calling
network_base.cancel_if_ovs_bridge; keep the rest of the flow (br_backend check
using utils_net.find_bridge_manager, utils_net.Bridge and
network_base.setup_ovs_bridge_attrs) intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0c44690f-b5a2-4c4f-b990-c1b55ff23efb

📥 Commits

Reviewing files that changed from the base of the PR and between 79105b9 and e37afc0.

📒 Files selected for processing (9)
  • libvirt/tests/cfg/virtual_network/update_device/update_device_coalesce.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_link_state.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_source.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_identifier.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_active.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_inactive.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_unchangable.cfg
  • libvirt/tests/src/virtual_network/update_device/update_device_coalesce.py
  • libvirt/tests/src/virtual_network/update_device/update_iface_link_state.py
🚧 Files skipped from review as they are similar to previous changes (5)
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_options_inactive.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_link_state.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_with_unchangable.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_iface_source.cfg
  • libvirt/tests/cfg/virtual_network/update_device/update_device_coalesce.cfg

…work

1.Add some parameters to allow the framework provide guest xml
2.Add "only Linux" to limit guest type
3.Remove create ovs and linux_br,let them created by the test loop's environment setup par

ID: LIBVIRTAT-22356

Signed-off-by: Yiqian Wei <yiwei@redhat.com>
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.

1 participant