Skip to content

Conversation

@hholoubk
Copy link
Contributor

Additional note - the cleanup_serial_console and create_serial_console already contains the check, that the console is not None

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 all migration 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 serial console management when switching connection URIs
during migration operations. The pattern is especially useful after
migrating VMs to remote hosts where the serial console needs to be
recreated to match the new connection context.

Modified test categories:
- Memory migration tests: migrate_mem.py
- Network migration tests: migrate_network.py (3 occurrences)
- Migration with panic device: migrate_with_panic_device.py
- Migration with virtiofs: internally/externally launched virtiofs devices (2 files)
- Migration with vTPM: shared_tpm, vtpm_dev, external_tpm (3 files)

All tests now use a cleaner pattern:
  vm.connect_uri = dest_uri
  vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)

Total: 8 files modified with 31 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 10, 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