fix(api): normalize ssh mcp evidence inputs
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user