fix(api): normalize ssh mcp evidence inputs
All checks were successful
CD Pipeline / tests (push) Successful in 1m29s
Code Review / ai-code-review (push) Successful in 12s
CD Pipeline / build-and-deploy (push) Successful in 4m31s
CD Pipeline / post-deploy-checks (push) Successful in 1m40s

This commit is contained in:
Your Name
2026-06-01 01:11:10 +08:00
parent b83f9c5a52
commit 87378b452d
5 changed files with 39 additions and 2 deletions

View File

@@ -45,6 +45,8 @@ def test_ssh_provider_uses_ollama_user_for_188():
[
("192.168.0.110:9100", "192.168.0.110"),
("110:9100", "192.168.0.110"),
("wooo", "192.168.0.110"),
("wooo:9100", "192.168.0.110"),
("188", "192.168.0.188"),
("wooo@192.168.0.110", "192.168.0.110"),
("ssh://wooo@192.168.0.110:22", "192.168.0.110"),
@@ -90,3 +92,14 @@ async def test_ssh_execute_normalizes_host_before_allowed_check(monkeypatch):
assert result.success is True
assert captured["host"] == "192.168.0.110"
assert isinstance(captured["timeout"], int)
def test_ssh_container_status_accepts_legacy_container_name_alias():
provider = SSHProvider()
command = provider._build_command(
"ssh_get_container_status",
{"container_name": "awoooi-api"},
)
assert command == "docker ps -a --filter name=awoooi-api"