def test_attribute_defaults(mode, monkeypatch):
    hostname = "testhost"
    Scenario().add_host(hostname).apply(monkeypatch)

    host_config = config.get_config_cache().get_host_config(hostname)
    ipaddress = ip_lookup.lookup_mgmt_board_ip_address(host_config)

    source = IPMISource(hostname, ipaddress, mode=mode)
    assert source.hostname == hostname
    assert source.ipaddress == ipaddress
    assert source.mode is mode
    assert source.description == "Management board - IPMI"
    assert source.source_type is SourceType.MANAGEMENT
    assert source.summarize(result.OK(AgentHostSections())) == (0, "Version: unknown")
    assert source.id == "mgmt_ipmi"
def test_attribute_defaults(monkeypatch):
    hostname = HostName("testhost")
    ts = Scenario()
    ts.add_host(hostname)
    ts.apply(monkeypatch)

    host_config = config.get_config_cache().get_host_config(hostname)
    ipaddress = config.lookup_mgmt_board_ip_address(host_config)

    source = IPMISource(hostname, ipaddress)
    assert source.hostname == hostname
    assert source.ipaddress == ipaddress
    assert source.description == "Management board - IPMI"
    assert source.source_type is SourceType.MANAGEMENT
    assert source.summarize(result.OK(HostSections[AgentRawDataSection]())) == [
        ActiveCheckResult(0, "Success")
    ]
    assert source.id == "mgmt_ipmi"