mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-14 20:56:30 +00:00
Add test for network docker (#2153)
This commit is contained in:
parent
353544085e
commit
45861617b9
@ -1,16 +1,23 @@
|
|||||||
"""Test NetwrokInterface API."""
|
"""Test NetwrokInterface API."""
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from supervisor.const import DOCKER_NETWORK, DOCKER_NETWORK_MASK
|
||||||
|
|
||||||
from tests.const import TEST_INTERFACE
|
from tests.const import TEST_INTERFACE
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_api_network_info(api_client):
|
async def test_api_network_info(api_client, coresys):
|
||||||
"""Test network manager api."""
|
"""Test network manager api."""
|
||||||
resp = await api_client.get("/network/info")
|
resp = await api_client.get("/network/info")
|
||||||
result = await resp.json()
|
result = await resp.json()
|
||||||
assert TEST_INTERFACE in result["data"]["interfaces"]
|
assert TEST_INTERFACE in result["data"]["interfaces"]
|
||||||
|
|
||||||
|
assert result["data"]["docker"]["interface"] == DOCKER_NETWORK
|
||||||
|
assert result["data"]["docker"]["address"] == str(DOCKER_NETWORK_MASK)
|
||||||
|
assert result["data"]["docker"]["dns"] == str(coresys.docker.network.dns)
|
||||||
|
assert result["data"]["docker"]["gateway"] == str(coresys.docker.network.gateway)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_api_network_interface_info(api_client):
|
async def test_api_network_interface_info(api_client):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user