Functest: keep_alive + wait_client_online after ACPI SHUTDOWN - #1088
Functest: keep_alive + wait_client_online after ACPI SHUTDOWN#1088satishnaidu77 wants to merge 1 commit into
Conversation
Boot functest clients with keep_alive so QMP SHUTDOWN restarts QEMU, and add an explicit wait_client_online step so WinRM is back before the next mid-batch case (NetKVM hotplug shutdown paths). Signed-off-by: Satish Tagirisapu <stagiris@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
@satishnaidu77 |
There was a problem hiding this comment.
Pull request overview
This PR improves Functest resilience for cases that intentionally trigger guest shutdown (ACPI / QMP SHUTDOWN) by ensuring the client VM is restarted and the framework can explicitly wait for WinRM to come back before continuing the batch.
Changes:
- Boot Functest clients with
keep_alive: trueso QEMU is restarted after guest shutdown mid-batch. - Add a new Functest step type
wait_client_onlineand wire it through step-type validation and execution. - Document the new step type and add a base-tools stub API for
wait_for_client_online.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/models/command_info.rb | Adds wait_client_online to the unified step/command model. |
| lib/engines/hcktest/tools.rb | Adds a stub for wait_for_client_online in the tools interface used across engines. |
| lib/engines/functest/step_handler.rb | Recognizes wait_client_online as a step type for “exactly one step-type field” validation. |
| lib/engines/functest/functest.rb | Boots functest clients with keep_alive: true to survive QEMU exits after shutdown. |
| lib/auxiliary/command_execution_manager.rb | Executes wait_client_online by calling tools’ wait_for_client_online. |
| docs/Functest-Engine.md | Documents wait_client_online and updates step-type/client-targeting docs accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| ``` | ||
|
|
||
| If the guest never returns, the step fails (and the run stops) — dump collection stays strict and is not skipped. |
| sig { params(command_info: Models::CommandInfo).void } | ||
| def execute_wait_client_online(command_info) | ||
| target_machines(command_info).each do |machine_name| | ||
| @logger.info("Waiting for client #{machine_name} to come online") | ||
| @tools.wait_for_client_online(machine_name) | ||
| end | ||
| end |
@kostyanf14 |
Summary
Functest guest recovery after intentional ACPI / QMP
SHUTDOWNso mid-batch NetKVM hotplug cases can continue.Problem
Some NetKVM functest cases intentionally power off the guest (
shutdown /s /t 0 /f) and wait for QMP SHUTDOWN. That exits QEMU.Functest used to boot clients without
keep_alive. After those cases, CL1 stayed dead. Post-test minidump probing hit WinRM (No route to host) and aborted the whole batch, so later cases never ran.Testcases this fixes
NetKVM/netkvm_hotplug_shutdownpci_hotplug.with_shutdownSHUTDOWNNetKVM/netkvm_hotplug_unplug_shutdownSHUTDOWNNetKVM/netkvm_hotplug_unplug_reboot(downstream in same run)What we changed (FW) and why
keep_alive: true(same idea as HCKTest)SHUTDOWN, restart QEMU so the guest can boot again mid-batchwait_client_online: truewait_for_client_onlineCompanion case JSON updates (add
wait_client_onlineafter QMPSHUTDOWN) live in the functional-tests NetKVM cases.Test plan
--pcie-spare-root-ports 1:NetKVM/netkvm_hotplug_shutdown,NetKVM/netkvm_hotplug_unplug_shutdown,NetKVM/netkvm_hotplug_unplug_rebootWaiting for client CL1 to come onlineafter both SHUTDOWN casesPass log
Command used:
Made with Cursor