feat: SSH card UX, agent version sync, persistent ssh_admin_ok (0.11.5)
Silent SSH probe on host card open; manual test feedback auto-hides. Persist ssh_admin_ok in DB (migration 019). After agent update read version from host and refresh UI.
This commit is contained in:
@@ -182,13 +182,21 @@ def test_run_ssh_monitor_update_runs_script(monkeypatch):
|
||||
target="h",
|
||||
stdout="ready\n",
|
||||
)
|
||||
assert kwargs["remote_cmd"] == "/opt/scripts/update_ssh_monitor.sh"
|
||||
assert kwargs.get("need_root") is True
|
||||
if calls == 2:
|
||||
assert kwargs["remote_cmd"] == "/opt/scripts/update_ssh_monitor.sh"
|
||||
assert kwargs.get("need_root") is True
|
||||
return ssh_connect.SshCommandResult(
|
||||
ok=True,
|
||||
message="SSH OK",
|
||||
target="ubabuba",
|
||||
stdout="SUMMARY updated 2.1.0-SAC\n",
|
||||
exit_code=0,
|
||||
)
|
||||
return ssh_connect.SshCommandResult(
|
||||
ok=True,
|
||||
message="SSH OK",
|
||||
message="ok",
|
||||
target="ubabuba",
|
||||
stdout="SUMMARY updated\n",
|
||||
stdout='2.1.0-SAC\n',
|
||||
exit_code=0,
|
||||
)
|
||||
|
||||
@@ -196,4 +204,11 @@ def test_run_ssh_monitor_update_runs_script(monkeypatch):
|
||||
|
||||
result = run_ssh_monitor_update(target="ubabuba", user="root", password="pw")
|
||||
assert result.ok is True
|
||||
assert calls == 2
|
||||
assert result.agent_version == "2.1.0-SAC"
|
||||
assert calls == 3
|
||||
|
||||
|
||||
def test_parse_ssh_monitor_version_text():
|
||||
assert ssh_connect.parse_ssh_monitor_version_text("SSH_MONITOR_VERSION=2.1.0-SAC") == "2.1.0-SAC"
|
||||
assert ssh_connect.parse_ssh_monitor_version_text("SUMMARY updated 2.1.1-SAC done") == "2.1.1-SAC"
|
||||
assert ssh_connect.parse_ssh_monitor_version_text("no version") is None
|
||||
|
||||
Reference in New Issue
Block a user