Ejemplo n.º 1
0
def test_client_configuration_host(params: Dict[str, Any], host: str) -> None:
    # black box test: wato config and corresponding url that is used by the special agent to query k8s
    agent = SpecialAgent('agent_kubernetes')
    arguments: List[str] = []
    argument_raw: SpecialAgentInfoFunctionResult = agent.argument_func(
        params, "a-host-name", "192.168.1.1")
    # this does not feel right:
    assert isinstance(argument_raw, list)
    for element in argument_raw:
        assert isinstance(element, str)
        arguments.append(element)

    client = get_api_client(parse_arguments(arguments))
    assert client.configuration.host == host
Ejemplo n.º 2
0
def test_acme_sbc_argument_parsing(params, expected_args):
    """Tests if all required arguments are present."""
    agent = SpecialAgent("agent_acme_sbc")
    arguments = agent.argument_func(params, "host", "address")
    assert arguments == expected_args
Ejemplo n.º 3
0
def test_ipmi_sensors_argument_parsing(params, expected_args):
    """Tests if all required arguments are present."""
    agent = SpecialAgent('agent_ipmi_sensors')
    arguments = agent.argument_func(params, "host", "address")
    assert arguments == expected_args
Ejemplo n.º 4
0
def test_3par(params, result):
    agent = SpecialAgent("agent_3par")
    arguments = agent.argument_func(params, "host", "address")
    assert arguments == result
Ejemplo n.º 5
0
def test_parse_arguments(params, expected_args):
    """Tests if all required arguments are present."""
    agent = SpecialAgent('agent_kubernetes')
    arguments = agent.argument_func(params, "host", "127.0.0.1")
    assert arguments == expected_args