fix(winrm): resolve System32 path for cmd test on minimal PATH (0.20.25)
WinRM run_cmd(hostname) failed on hosts where System32 is not in PATH.
This commit is contained in:
@@ -95,6 +95,14 @@ def test_rdp_bundle_zip_roundtrip(tmp_path: Path, monkeypatch):
|
||||
assert get_rdp_bundle_zip(token) == zip_bytes
|
||||
|
||||
|
||||
def test_resolve_winrm_cmd_uses_system32_for_builtins():
|
||||
from app.services.winrm_connect import _resolve_winrm_cmd
|
||||
|
||||
assert _resolve_winrm_cmd("hostname") == "%SystemRoot%\\System32\\hostname.exe"
|
||||
assert _resolve_winrm_cmd("qwinsta") == "%SystemRoot%\\System32\\qwinsta.exe"
|
||||
assert _resolve_winrm_cmd("logoff 2 /v") == "%SystemRoot%\\System32\\logoff.exe 2 /v"
|
||||
|
||||
|
||||
def test_run_winrm_rdp_monitor_update_downloads_bundle_from_sac(tmp_path: Path):
|
||||
repo = tmp_path / "repo"
|
||||
repo.mkdir()
|
||||
|
||||
Reference in New Issue
Block a user