-
Notifications
You must be signed in to change notification settings - Fork 180
iommu_device_lifecycle: Recreate serial console after reboot/reset #6645
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -64,18 +64,21 @@ def run(test, params, env): | |||||||||||||||||||||||||||||||||||||||||||||
| test.log.info("TEST_STEP: Reset the VM.") | ||||||||||||||||||||||||||||||||||||||||||||||
| session = vm.wait_for_serial_login( | ||||||||||||||||||||||||||||||||||||||||||||||
| timeout=int(params.get('login_timeout'))) | ||||||||||||||||||||||||||||||||||||||||||||||
| virsh.reset(vm.name, **VIRSH_ARGS) | ||||||||||||||||||||||||||||||||||||||||||||||
| _match, _text = session.read_until_last_line_matches( | ||||||||||||||||||||||||||||||||||||||||||||||
| [r"[Ll]ogin:\s*"], timeout=240, internal_timeout=0.5) | ||||||||||||||||||||||||||||||||||||||||||||||
| session.close() | ||||||||||||||||||||||||||||||||||||||||||||||
| vm.cleanup_serial_console() | ||||||||||||||||||||||||||||||||||||||||||||||
| vm.create_serial_console() | ||||||||||||||||||||||||||||||||||||||||||||||
| session = vm.wait_for_serial_login( | ||||||||||||||||||||||||||||||||||||||||||||||
| timeout=int(params.get('login_timeout'))) | ||||||||||||||||||||||||||||||||||||||||||||||
| session.close() | ||||||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||||||
| for _ in range(int(params.get('loop_time', '5'))): | ||||||||||||||||||||||||||||||||||||||||||||||
| test.log.info("TEST_STEP: Reboot the VM.") | ||||||||||||||||||||||||||||||||||||||||||||||
| session = vm.wait_for_serial_login( | ||||||||||||||||||||||||||||||||||||||||||||||
| timeout=int(params.get('login_timeout'))) | ||||||||||||||||||||||||||||||||||||||||||||||
| session.sendline(params.get("reboot_command")) | ||||||||||||||||||||||||||||||||||||||||||||||
| _match, _text = session.read_until_last_line_matches( | ||||||||||||||||||||||||||||||||||||||||||||||
| [r"[Ll]ogin:\s*"], timeout=240, internal_timeout=0.5) | ||||||||||||||||||||||||||||||||||||||||||||||
| session.close() | ||||||||||||||||||||||||||||||||||||||||||||||
| vm.cleanup_serial_console() | ||||||||||||||||||||||||||||||||||||||||||||||
| vm.create_serial_console() | ||||||||||||||||||||||||||||||||||||||||||||||
| session = vm.wait_for_serial_login(timeout=int(params.get('login_timeout'))) | ||||||||||||||||||||||||||||||||||||||||||||||
| session.close() | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
74
to
82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Missing VM reboot operation. The test logs "Reboot the VM" but no actual reboot command is executed. The current code only recreates the serial console without performing a VM reboot. The loop runs multiple times without actually rebooting the VM between iterations. The reboot should be triggered after the initial login: for _ in range(int(params.get('loop_time', '5'))):
test.log.info("TEST_STEP: Reboot the VM.")
session = vm.wait_for_serial_login(
timeout=int(params.get('login_timeout')))
+ session.cmd("reboot")
session.close()
vm.cleanup_serial_console()
vm.create_serial_console()
session = vm.wait_for_serial_login(timeout=int(params.get('login_timeout')))
session.close()📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| session = vm.wait_for_serial_login( | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
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: Missing VM reset operation.
The test logs "Reset the VM" but no actual reset command is executed. The current code only recreates the serial console without performing a VM reset operation. The original
virsh.reset(vm.name, **VIRSH_ARGS)call appears to have been removed.The reset should be performed after the initial login and before recreating the console:
if test_scenario == "reset": test.log.info("TEST_STEP: Reset the VM.") session = vm.wait_for_serial_login( timeout=int(params.get('login_timeout'))) session.close() + virsh.reset(vm.name, **VIRSH_ARGS) vm.cleanup_serial_console() vm.create_serial_console() session = vm.wait_for_serial_login( timeout=int(params.get('login_timeout'))) session.close()📝 Committable suggestion
🤖 Prompt for AI Agents