fix: WinRM RDP update via NETLOGON Deploy, git fallback (0.20.12)
This commit is contained in:
@@ -7,17 +7,29 @@ from app.services.winrm_connect import (
|
||||
)
|
||||
|
||||
|
||||
def test_rdp_update_default_script_uses_rdp_login_monitor_path():
|
||||
def test_rdp_update_default_script_uses_netlogon_and_git_fallback():
|
||||
script = _rdp_update_powershell_script("")
|
||||
assert "$ProgressPreference = 'SilentlyContinue'" in script
|
||||
assert "try {" in script
|
||||
assert "Write-Output ('ERROR: '" in script
|
||||
assert "RDP-login-monitor\\Deploy-LoginMonitor.ps1" in script
|
||||
assert "NETLOGON\\RDP-login-monitor" in script
|
||||
assert "Deploy-LoginMonitor.ps1" in script
|
||||
assert "_sac_git" in script
|
||||
assert "git.kalinamall.ru/PapaTramp/RDP-login-monitor.git" in script
|
||||
assert "ProgramData\\RDP-login-monitor\\Deploy-LoginMonitor.ps1" not in script
|
||||
|
||||
|
||||
def test_rdp_update_default_script_honors_sac_git_settings():
|
||||
script = _rdp_update_powershell_script(
|
||||
"",
|
||||
repo_url="https://git.example.com/org/rdp.git",
|
||||
git_branch="release",
|
||||
)
|
||||
assert "git.example.com/org/rdp.git" in script
|
||||
assert "$branch = 'release'" in script
|
||||
|
||||
|
||||
def test_rdp_update_custom_script_uses_literal_path():
|
||||
script = _rdp_update_powershell_script(r"C:\ProgramData\RDP-login-monitor\Deploy-LoginMonitor.ps1")
|
||||
assert r"C:\ProgramData\RDP-login-monitor\Deploy-LoginMonitor.ps1" in script
|
||||
script = _rdp_update_powershell_script(r"\\b26\NETLOGON\RDP-login-monitor\Deploy-LoginMonitor.ps1")
|
||||
assert r"\\b26\NETLOGON\RDP-login-monitor\Deploy-LoginMonitor.ps1" in script
|
||||
assert "Test-Path -LiteralPath" in script
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user