Skip to content

Conversation

@hholoubk
Copy link
Contributor

Refactor network and interface tests to use the recreate_serial_console
parameter instead of manually calling cleanup_serial_console() and
create_serial_console() before wait_for_serial_login().

This simplifies console management in scenarios where the console needs
to be recreated after state changes such as:

  • After libvirtd restart
  • After VM save/restore or suspend/resume operations
  • After VM start or device hotplug

Modified test files:

  • virtual_network/iface_bridge.py: Console recreation after libvirtd restart
  • virtual_network/passt/passt_lifecycle.py: Console after restore/resume
  • virtual_interface/interface_update_device_negative.py: Console after VM start
  • virsh_cmd/domain/virsh_domif_setlink_getlink.py: Console for link state check
  • virtio/virtio_page_per_vq.py: Console after device attach

All tests now use a cleaner single-line pattern for console recreation.

Note: iface_hotplug.py was not modified as it creates console without
immediately calling wait_for_serial_login(), which doesn't match the
refactoring pattern.

Refactor provider infrastructure to use the new recreate_serial_console
parameter instead of manually calling cleanup_serial_console() and
create_serial_console() before wait_for_serial_login().

Modified files:
- provider/save/save_base.py: pre_save_setup() and post_save_check()
- provider/migration/base_steps.py: PrepareVMTest and VerifyTest classes
- provider/migration/migration_base.py: poweroff_vm_on_dest() and do_io_error_on_dest()
- provider/interface/check_points.py: check_vm_network_accessed()

Depends on: avocado-framework/avocado-vt#4248

Signed-off-by: hholoubk <[email protected]>
Refactor network and interface tests to use the recreate_serial_console
parameter instead of manually calling cleanup_serial_console() and
create_serial_console() before wait_for_serial_login().

This simplifies console management in scenarios where the console needs
to be recreated after state changes such as:
- After libvirtd restart
- After VM save/restore or suspend/resume operations
- After VM start or device hotplug

Modified test files:
- virtual_network/iface_bridge.py: Console recreation after libvirtd restart
- virtual_network/passt/passt_lifecycle.py: Console after restore/resume
- virtual_interface/interface_update_device_negative.py: Console after VM start
- virsh_cmd/domain/virsh_domif_setlink_getlink.py: Console for link state check
- virtio/virtio_page_per_vq.py: Console after device attach

All tests now use a cleaner single-line pattern for console recreation.

Note: iface_hotplug.py was not modified as it creates console without
immediately calling wait_for_serial_login(), which doesn't match the
refactoring pattern.

Total: 5 files modified with 9 fewer lines of console management code.

Depends on: avocado-framework/avocado-vt#4248
Depends on: autotest#6596

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

coderabbitai bot commented Oct 13, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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