Skip to content

Add UI executor to bridge WinRM commands to the interactive desktop session#912

Open
elizashurov wants to merge 1 commit into
HCK-CI:masterfrom
elizashurov:VIRTWINKVM-2069
Open

Add UI executor to bridge WinRM commands to the interactive desktop session#912
elizashurov wants to merge 1 commit into
HCK-CI:masterfrom
elizashurov:VIRTWINKVM-2069

Conversation

@elizashurov
Copy link
Copy Markdown
Contributor

WinRM commands run in Session 0 which cannot interact with the UI. This commit adds a PowerShell agent and Ruby executor that bridge WinRM to the interactive desktop session via a scheduled task with Interactive logon type and a filesystem-based command queue.

Enables running UI-dependent HLK tests that were previously rejected because they required interactive session access.

Comment thread lib/auxiliary/ui_agent/ui_executor.rb Fixed
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Fixed
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Fixed
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Fixed
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Fixed
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Fixed
Comment thread lib/engines/hcktest/tests.rb Fixed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a UI agent system to execute commands in interactive Windows sessions, featuring a PowerShell agent and a Ruby UIExecutor for management. The integration allows for UI-interactive commands during tests and client setup. Feedback was provided to enhance the PowerShell agent's reliability by ensuring command scripts are deleted regardless of result-writing success to prevent re-execution.

Comment thread lib/auxiliary/ui_agent/agent.ps1 Outdated
@elizashurov elizashurov force-pushed the VIRTWINKVM-2069 branch 2 times, most recently from f830cbe to 5db9887 Compare March 29, 2026 14:23
@elizashurov
Copy link
Copy Markdown
Contributor Author

Tested on a Win11_25H2x64 client with the viogpu driver, with AutoIt installed on the  VM and AutoIt .au3 watcher scripts handling UI dialogs.
HLK tests that previously required manual UI interaction now pass automatically:

  • Test for EDID Requirements (Manual) - Passed
  • WDDM HPD Notification Test (Manual) - Passed
Screenshot From 2026-03-29 12-00-18

@kostyanf14
Copy link
Copy Markdown
Contributor

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a UI agent mechanism to bridge WinRM (Session 0) to the interactive desktop (Session 1) on Windows clients. It includes a PowerShell agent (agent.ps1) that executes commands from a filesystem queue and a Ruby UIExecutor class to manage deployment, command submission, and result polling. Integration is added to the test engine and client setup manager to support a new guest_ui_run command type. I have no feedback to provide.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “UI executor” path to run PowerShell commands in the interactive Windows desktop session (instead of WinRM Session 0) to support UI-dependent HLK workflows.

Changes:

  • Extend CommandInfo with guest_ui_run to represent interactive-session guest commands.
  • Update client post-start and test command runners to execute guest_ui_run via the new executor.
  • Add UIExecutor (Ruby) + agent.ps1 (PowerShell) implementing a scheduled-task-based interactive-session agent and filesystem queue protocol.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/setupmanagers/hckclient.rb Runs post-start UI commands via UIExecutor when guest_ui_run is present.
lib/models/command_info.rb Adds guest_ui_run field to command model.
lib/engines/hcktest/tests.rb Adds UI-command execution during test command sequences, caching executors per client.
lib/auxiliary/ui_agent/ui_executor.rb New Ruby executor that deploys/controls interactive-session agent and queues commands/results.
lib/auxiliary/ui_agent/agent.ps1 New PowerShell agent that executes queued scripts in the interactive session and writes JSON results.
lib/all.rb Autoloads UIExecutor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/models/command_info.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/engines/hcktest/tests.rb
Comment thread lib/models/command_info.rb Outdated
Comment thread lib/setupmanagers/hckclient.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/auxiliary/ui_agent/ui_executor.rb Outdated
Comment thread lib/engines/hcktest/tests.rb Fixed
Comment thread lib/engines/hcktest/tests.rb Fixed
Comment thread lib/setupmanagers/hckclient.rb Fixed
Comment thread lib/setupmanagers/hckclient.rb Fixed
Comment thread lib/setupmanagers/hckclient.rb Fixed
Comment thread lib/engines/hcktest/tests.rb Fixed
…ession

WinRM commands run in Session 0 which cannot interact with the UI.
This commit adds a PowerShell agent and Ruby executor that bridge WinRM to the
interactive desktop session via a scheduled task with Interactive
logon type and a filesystem-based command queue.

Enables running UI-dependent HLK tests that were previously
rejected because they required interactive session access.

Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
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.

5 participants