import pytest

from src.plugins.mcp.providers.ssh_provider import SSHProvider


@pytest.mark.asyncio
async def test_ssh_diagnose_is_registered_read_only_tool():
    provider = SSHProvider()
    tool_names = {tool.name for tool in await provider.list_tools()}
    command = provider._build_command("ssh_diagnose", {})

    assert "ssh_diagnose" in tool_names
    assert "CPU TOP" in command
    assert "df -h" in command


def test_ssh_provider_uses_ollama_user_for_188():
    provider = SSHProvider()

    assert provider._ssh_user_for_host("192.168.0.188") == "ollama"
    assert provider._ssh_user_for_host("192.168.0.110") == "wooo"
