Skip to content

Commit 71ec599

Browse files
committed
win_guest_debugging_tool: Optimize and simplify script
The test script for the Windows guest debugging tool was significantly refactored to improve its structure, eliminate redundancy, and increase maintainability. Key logical improvements include: - The complex three-class inheritance structure was consolidated into a single, self-contained WinDebugToolTest class, simplifying the overall architecture. - A centralized helper method, _run_script_and_get_paths, was created to handle all PowerShell script executions and output parsing. This removes significant code duplication that was present in each test variant. - Individual test methods were streamlined to focus purely on their specific validation logic, delegating common tasks like script execution and session management to helper functions. - VM session management was made more robust to ensure sessions are properly created, reused, and cleaned up. Signed-off-by: Dehan Meng <demeng@redhat.com>
1 parent f03b470 commit 71ec599

File tree

2 files changed

+642
-906
lines changed

2 files changed

+642
-906
lines changed

qemu/tests/cfg/win_guest_debugging_tool.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
- check_user_friendliness:
3030
windegtool_check_type = user_friendliness
3131
cmd_kill_powershell_process = taskkill /IM powershell.exe /F
32-
cmd_kill_powershell_process1 = powershell.exe -Command "Stop-Process -Name msinfo32 -Force"
32+
cmd_kill_powershell_process1 = powershell.exe -Command "Stop-Process -Name msinfo32 -Force -ErrorAction SilentlyContinue"
3333
invalid_params = "-invalidparam,IncludeSensitiveData,0000,hell,-H,-IncludeSensitiveData -h"
3434
expect_output_prompt = "Usage: .\CollectSystemInfo.ps1 [-IncludeSensitiveData] [-Help]"
3535
script_interrupt_signal_file = 'Collecting_Status.txt'

0 commit comments

Comments
 (0)