mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-12 11:46:31 +00:00
parent
a976ef6e67
commit
4c560d7c54
@ -84,7 +84,7 @@ def ipconfig_struct(config: IpConfig) -> dict:
|
|||||||
ATTR_METHOD: config.method,
|
ATTR_METHOD: config.method,
|
||||||
ATTR_ADDRESS: [address.with_prefixlen for address in config.address],
|
ATTR_ADDRESS: [address.with_prefixlen for address in config.address],
|
||||||
ATTR_NAMESERVERS: [str(address) for address in config.nameservers],
|
ATTR_NAMESERVERS: [str(address) for address in config.nameservers],
|
||||||
ATTR_GATEWAY: str(config.gateway),
|
ATTR_GATEWAY: str(config.gateway) if config.gateway else None,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,8 +23,11 @@ async def test_api_network_info(api_client, coresys):
|
|||||||
for interface in result["data"]["interfaces"]:
|
for interface in result["data"]["interfaces"]:
|
||||||
if interface["interface"] == TEST_INTERFACE:
|
if interface["interface"] == TEST_INTERFACE:
|
||||||
assert interface["primary"]
|
assert interface["primary"]
|
||||||
|
assert interface["ipv4"]["gateway"] == "192.168.2.1"
|
||||||
if interface["interface"] == TEST_INTERFACE_WLAN:
|
if interface["interface"] == TEST_INTERFACE_WLAN:
|
||||||
assert not interface["primary"]
|
assert not interface["primary"]
|
||||||
|
assert interface["ipv4"] is None
|
||||||
|
assert interface["ipv6"] is None
|
||||||
|
|
||||||
assert result["data"]["docker"]["interface"] == DOCKER_NETWORK
|
assert result["data"]["docker"]["interface"] == DOCKER_NETWORK
|
||||||
assert result["data"]["docker"]["address"] == str(DOCKER_NETWORK_MASK)
|
assert result["data"]["docker"]["address"] == str(DOCKER_NETWORK_MASK)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user