Use session dbus mocks for all tests (#4198)

* Use session dbus mocks for all tests

* func instead of fn for pylint
This commit is contained in:
Mike Degatano 2023-03-21 02:30:31 -04:00 committed by GitHub
parent c6ddc8e427
commit a6caccd845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
157 changed files with 685 additions and 6572 deletions

View File

@ -1,46 +1,46 @@
"""Test DNS API.""" """Test DNS API."""
from unittest.mock import MagicMock, PropertyMock, patch from unittest.mock import MagicMock, patch
from aiohttp.test_utils import TestClient from aiohttp.test_utils import TestClient
from supervisor.coresys import CoreSys from supervisor.coresys import CoreSys
from supervisor.dbus.const import MulticastProtocolEnabled from supervisor.dbus.resolved import Resolved
from tests.dbus_service_mocks.base import DBusServiceMock
from tests.dbus_service_mocks.resolved import Resolved as ResolvedService
async def test_llmnr_mdns_info( async def test_llmnr_mdns_info(
api_client: TestClient, coresys: CoreSys, dbus_is_connected: PropertyMock api_client: TestClient,
coresys: CoreSys,
all_dbus_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]],
): ):
"""Test llmnr and mdns in info api.""" """Test llmnr and mdns in info api."""
coresys.host.sys_dbus.resolved.is_connected = False resolved_service: ResolvedService = all_dbus_services["resolved"]
# pylint: disable=protected-access
coresys.host.sys_dbus._resolved = Resolved()
# pylint: enable=protected-access
resp = await api_client.get("/dns/info") resp = await api_client.get("/dns/info")
result = await resp.json() result = await resp.json()
assert result["data"]["llmnr"] is False assert result["data"]["llmnr"] is False
assert result["data"]["mdns"] is False assert result["data"]["mdns"] is False
coresys.host.sys_dbus.resolved.is_connected = True
with patch.object(
type(coresys.host.sys_dbus.resolved),
"llmnr",
PropertyMock(return_value=MulticastProtocolEnabled.NO),
), patch.object(
type(coresys.host.sys_dbus.resolved),
"multicast_dns",
PropertyMock(return_value=MulticastProtocolEnabled.NO),
):
resp = await api_client.get("/dns/info")
result = await resp.json()
assert result["data"]["llmnr"] is False
assert result["data"]["mdns"] is False
await coresys.dbus.resolved.connect(coresys.dbus.bus) await coresys.dbus.resolved.connect(coresys.dbus.bus)
await coresys.dbus.resolved.update()
resp = await api_client.get("/dns/info") resp = await api_client.get("/dns/info")
result = await resp.json() result = await resp.json()
assert result["data"]["llmnr"] is True assert result["data"]["llmnr"] is True
assert result["data"]["mdns"] is True assert result["data"]["mdns"] is True
resolved_service.emit_properties_changed({"LLMNR": "no", "MulticastDNS": "no"})
await resolved_service.ping()
resp = await api_client.get("/dns/info")
result = await resp.json()
assert result["data"]["llmnr"] is False
assert result["data"]["mdns"] is False
async def test_options(api_client: TestClient, coresys: CoreSys): async def test_options(api_client: TestClient, coresys: CoreSys):
"""Test options api.""" """Test options api."""

View File

@ -6,6 +6,7 @@ from aiohttp.test_utils import TestClient
import pytest import pytest
from supervisor.coresys import CoreSys from supervisor.coresys import CoreSys
from supervisor.dbus.resolved import Resolved
DEFAULT_RANGE = "entries=:-100:" DEFAULT_RANGE = "entries=:-100:"
# pylint: disable=protected-access # pylint: disable=protected-access
@ -107,13 +108,12 @@ async def test_api_host_features(
assert "disk" in result["data"]["features"] assert "disk" in result["data"]["features"]
async def test_api_llmnr_mdns_info( async def test_api_llmnr_mdns_info(api_client: TestClient, coresys_disk_info: CoreSys):
api_client: TestClient, coresys_disk_info: CoreSys, dbus_is_connected
):
"""Test llmnr and mdns details in info.""" """Test llmnr and mdns details in info."""
coresys = coresys_disk_info coresys = coresys_disk_info
# pylint: disable=protected-access
coresys.host.sys_dbus.resolved.is_connected = False coresys.host.sys_dbus._resolved = Resolved()
# pylint: enable=protected-access
resp = await api_client.get("/host/info") resp = await api_client.get("/host/info")
result = await resp.json() result = await resp.json()
@ -121,9 +121,7 @@ async def test_api_llmnr_mdns_info(
assert result["data"]["broadcast_mdns"] is None assert result["data"]["broadcast_mdns"] is None
assert result["data"]["llmnr_hostname"] is None assert result["data"]["llmnr_hostname"] is None
coresys.host.sys_dbus.resolved.is_connected = True
await coresys.dbus.resolved.connect(coresys.dbus.bus) await coresys.dbus.resolved.connect(coresys.dbus.bus)
await coresys.dbus.resolved.update()
resp = await api_client.get("/host/info") resp = await api_client.get("/host/info")
result = await resp.json() result = await resp.json()

View File

@ -1,15 +1,22 @@
"""Test NetwrokInterface API.""" """Test NetwrokInterface API."""
from unittest.mock import AsyncMock, patch from unittest.mock import AsyncMock, patch
import pytest from dbus_fast import Variant
from supervisor.const import DOCKER_NETWORK, DOCKER_NETWORK_MASK from supervisor.const import DOCKER_NETWORK, DOCKER_NETWORK_MASK
from supervisor.coresys import CoreSys from supervisor.coresys import CoreSys
from tests.const import TEST_INTERFACE, TEST_INTERFACE_WLAN from tests.const import TEST_INTERFACE, TEST_INTERFACE_WLAN
from tests.dbus_service_mocks.base import DBusServiceMock
from tests.dbus_service_mocks.network_connection_settings import (
ConnectionSettings as ConnectionSettingsService,
)
from tests.dbus_service_mocks.network_manager import (
NetworkManager as NetworkManagerService,
)
from tests.dbus_service_mocks.network_settings import Settings as SettingsService
@pytest.mark.asyncio
async def test_api_network_info(api_client, coresys: CoreSys): async def test_api_network_info(api_client, coresys: CoreSys):
"""Test network manager api.""" """Test network manager api."""
resp = await api_client.get("/network/info") resp = await api_client.get("/network/info")
@ -48,7 +55,6 @@ async def test_api_network_info(api_client, coresys: CoreSys):
assert result["data"]["docker"]["gateway"] == str(coresys.docker.network.gateway) assert result["data"]["docker"]["gateway"] == str(coresys.docker.network.gateway)
@pytest.mark.asyncio
async def test_api_network_interface_info(api_client): async def test_api_network_interface_info(api_client):
"""Test network manager api.""" """Test network manager api."""
resp = await api_client.get(f"/network/interface/{TEST_INTERFACE}/info") resp = await api_client.get(f"/network/interface/{TEST_INTERFACE}/info")
@ -60,10 +66,7 @@ async def test_api_network_interface_info(api_client):
assert ( assert (
result["data"]["ipv6"]["address"][0] == "2a03:169:3df5:0:6be9:2588:b26a:a679/64" result["data"]["ipv6"]["address"][0] == "2a03:169:3df5:0:6be9:2588:b26a:a679/64"
) )
assert ( assert result["data"]["ipv6"]["address"][1] == "2a03:169:3df5::2f1/128"
result["data"]["ipv6"]["address"][1]
== "fd14:949b:c9cc:0:522b:8108:8ff8:cca3/64"
)
assert result["data"]["ipv6"]["gateway"] == "fe80::da58:d7ff:fe00:9c69" assert result["data"]["ipv6"]["gateway"] == "fe80::da58:d7ff:fe00:9c69"
assert result["data"]["ipv6"]["nameservers"] == [ assert result["data"]["ipv6"]["nameservers"] == [
"2001:1620:2777:1::10", "2001:1620:2777:1::10",
@ -73,7 +76,6 @@ async def test_api_network_interface_info(api_client):
assert result["data"]["interface"] == TEST_INTERFACE assert result["data"]["interface"] == TEST_INTERFACE
@pytest.mark.asyncio
async def test_api_network_interface_info_default(api_client): async def test_api_network_interface_info_default(api_client):
"""Test network manager default api.""" """Test network manager default api."""
resp = await api_client.get("/network/interface/default/info") resp = await api_client.get("/network/interface/default/info")
@ -85,10 +87,7 @@ async def test_api_network_interface_info_default(api_client):
assert ( assert (
result["data"]["ipv6"]["address"][0] == "2a03:169:3df5:0:6be9:2588:b26a:a679/64" result["data"]["ipv6"]["address"][0] == "2a03:169:3df5:0:6be9:2588:b26a:a679/64"
) )
assert ( assert result["data"]["ipv6"]["address"][1] == "2a03:169:3df5::2f1/128"
result["data"]["ipv6"]["address"][1]
== "fd14:949b:c9cc:0:522b:8108:8ff8:cca3/64"
)
assert result["data"]["ipv6"]["gateway"] == "fe80::da58:d7ff:fe00:9c69" assert result["data"]["ipv6"]["gateway"] == "fe80::da58:d7ff:fe00:9c69"
assert result["data"]["ipv6"]["nameservers"] == [ assert result["data"]["ipv6"]["nameservers"] == [
"2001:1620:2777:1::10", "2001:1620:2777:1::10",
@ -98,12 +97,19 @@ async def test_api_network_interface_info_default(api_client):
assert result["data"]["interface"] == TEST_INTERFACE assert result["data"]["interface"] == TEST_INTERFACE
@pytest.mark.asyncio
async def test_api_network_interface_update( async def test_api_network_interface_update(
api_client, coresys: CoreSys, dbus: list[str] api_client,
coresys: CoreSys,
network_manager_service: NetworkManagerService,
connection_settings_service: ConnectionSettingsService,
): ):
"""Test network manager api.""" """Test network manager api."""
dbus.clear() network_manager_service.CheckConnectivity.calls.clear()
connection_settings_service.Update.calls.clear()
assert (
coresys.dbus.network.interfaces[TEST_INTERFACE].settings.ipv4.method == "auto"
)
resp = await api_client.post( resp = await api_client.post(
f"/network/interface/{TEST_INTERFACE}/update", f"/network/interface/{TEST_INTERFACE}/update",
json={ json={
@ -117,13 +123,16 @@ async def test_api_network_interface_update(
) )
result = await resp.json() result = await resp.json()
assert result["result"] == "ok" assert result["result"] == "ok"
assert network_manager_service.CheckConnectivity.calls == [tuple()]
assert len(connection_settings_service.Update.calls) == 1
await connection_settings_service.ping()
await connection_settings_service.ping()
assert ( assert (
"/org/freedesktop/NetworkManager-org.freedesktop.NetworkManager.CheckConnectivity" coresys.dbus.network.interfaces[TEST_INTERFACE].settings.ipv4.method == "manual"
in dbus
) )
@pytest.mark.asyncio
async def test_api_network_interface_update_wifi(api_client): async def test_api_network_interface_update_wifi(api_client):
"""Test network manager api.""" """Test network manager api."""
resp = await api_client.post( resp = await api_client.post(
@ -143,7 +152,6 @@ async def test_api_network_interface_update_wifi(api_client):
assert result["result"] == "ok" assert result["result"] == "ok"
@pytest.mark.asyncio
async def test_api_network_interface_update_remove(api_client): async def test_api_network_interface_update_remove(api_client):
"""Test network manager api.""" """Test network manager api."""
resp = await api_client.post( resp = await api_client.post(
@ -154,7 +162,6 @@ async def test_api_network_interface_update_remove(api_client):
assert result["result"] == "ok" assert result["result"] == "ok"
@pytest.mark.asyncio
async def test_api_network_interface_info_invalid(api_client): async def test_api_network_interface_info_invalid(api_client):
"""Test network manager api.""" """Test network manager api."""
resp = await api_client.get("/network/interface/invalid/info") resp = await api_client.get("/network/interface/invalid/info")
@ -164,7 +171,6 @@ async def test_api_network_interface_info_invalid(api_client):
assert result["result"] == "error" assert result["result"] == "error"
@pytest.mark.asyncio
async def test_api_network_interface_update_invalid(api_client): async def test_api_network_interface_update_invalid(api_client):
"""Test network manager api.""" """Test network manager api."""
resp = await api_client.post("/network/interface/invalid/update", json={}) resp = await api_client.post("/network/interface/invalid/update", json={})
@ -186,7 +192,6 @@ async def test_api_network_interface_update_invalid(api_client):
) )
@pytest.mark.asyncio
async def test_api_network_wireless_scan(api_client): async def test_api_network_wireless_scan(api_client):
"""Test network manager api.""" """Test network manager api."""
with patch("asyncio.sleep", return_value=AsyncMock()): with patch("asyncio.sleep", return_value=AsyncMock()):
@ -201,30 +206,47 @@ async def test_api_network_wireless_scan(api_client):
assert [47, 63] == [ap["signal"] for ap in result["data"]["accesspoints"]] assert [47, 63] == [ap["signal"] for ap in result["data"]["accesspoints"]]
@pytest.mark.asyncio async def test_api_network_reload(
async def test_api_network_reload(api_client, coresys, dbus: list[str]): api_client, coresys, network_manager_service: NetworkManagerService
):
"""Test network manager reload api.""" """Test network manager reload api."""
dbus.clear() network_manager_service.CheckConnectivity.calls.clear()
resp = await api_client.post("/network/reload") resp = await api_client.post("/network/reload")
result = await resp.json() result = await resp.json()
assert result["result"] == "ok" assert result["result"] == "ok"
# Check that we forced NM to do an immediate connectivity check # Check that we forced NM to do an immediate connectivity check
assert ( assert network_manager_service.CheckConnectivity.calls == [tuple()]
"/org/freedesktop/NetworkManager-org.freedesktop.NetworkManager.CheckConnectivity"
in dbus
)
async def test_api_network_vlan(api_client, coresys: CoreSys, dbus: list[str]): async def test_api_network_vlan(
api_client,
coresys: CoreSys,
network_manager_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]],
):
"""Test creating a vlan.""" """Test creating a vlan."""
dbus.clear() settings_service: SettingsService = network_manager_services["network_settings"]
settings_service.AddConnection.calls.clear()
resp = await api_client.post( resp = await api_client.post(
f"/network/interface/{TEST_INTERFACE}/vlan/1", json={"ipv4": {"method": "auto"}} f"/network/interface/{TEST_INTERFACE}/vlan/1", json={"ipv4": {"method": "auto"}}
) )
result = await resp.json() result = await resp.json()
assert result["result"] == "ok" assert result["result"] == "ok"
assert ( assert len(settings_service.AddConnection.calls) == 1
"/org/freedesktop/NetworkManager/Settings-org.freedesktop.NetworkManager.Settings.AddConnection"
in dbus connection = settings_service.AddConnection.calls[0][0]
) assert "uuid" in connection["connection"]
assert connection["connection"] == {
"id": Variant("s", "Supervisor .1"),
"type": Variant("s", "vlan"),
"llmnr": Variant("i", 2),
"mdns": Variant("i", 2),
"autoconnect": Variant("b", True),
"uuid": connection["connection"]["uuid"],
}
assert connection["ipv4"] == {"method": Variant("s", "auto")}
assert connection["ipv6"] == {"method": Variant("s", "auto")}
assert connection["vlan"] == {
"id": Variant("u", 1),
"parent": Variant("s", "eth0"),
}

View File

@ -1,6 +1,5 @@
"""Test OS API.""" """Test OS API."""
import asyncio
from pathlib import Path from pathlib import Path
from unittest.mock import PropertyMock, patch from unittest.mock import PropertyMock, patch
@ -8,16 +7,27 @@ from aiohttp.test_utils import TestClient
import pytest import pytest
from supervisor.coresys import CoreSys from supervisor.coresys import CoreSys
from supervisor.dbus.agent.boards import BoardManager
from supervisor.hardware.data import Device from supervisor.hardware.data import Device
from supervisor.os.manager import OSManager from supervisor.os.manager import OSManager
from supervisor.resolution.const import ContextType, IssueType, SuggestionType from supervisor.resolution.const import ContextType, IssueType, SuggestionType
from supervisor.resolution.data import Issue, Suggestion from supervisor.resolution.data import Issue, Suggestion
from tests.common import mock_dbus_services
from tests.dbus_service_mocks.agent_boards import Boards as BoardsService
from tests.dbus_service_mocks.agent_boards_yellow import Yellow as YellowService
from tests.dbus_service_mocks.base import DBusServiceMock
# pylint: disable=protected-access # pylint: disable=protected-access
@pytest.mark.asyncio @pytest.fixture(name="boards_service")
async def fixture_boards_service(
os_agent_services: dict[str, DBusServiceMock]
) -> BoardsService:
"""Return mock Boards service."""
yield os_agent_services["agent_boards"]
async def test_api_os_info(api_client: TestClient): async def test_api_os_info(api_client: TestClient):
"""Test docker info api.""" """Test docker info api."""
resp = await api_client.get("/os/info") resp = await api_client.get("/os/info")
@ -34,23 +44,16 @@ async def test_api_os_info(api_client: TestClient):
assert attr in result["data"] assert attr in result["data"]
@pytest.mark.asyncio
async def test_api_os_info_with_agent(api_client: TestClient, coresys: CoreSys): async def test_api_os_info_with_agent(api_client: TestClient, coresys: CoreSys):
"""Test docker info api.""" """Test docker info api."""
await coresys.dbus.agent.connect(coresys.dbus.bus)
await coresys.dbus.agent.update()
resp = await api_client.get("/os/info") resp = await api_client.get("/os/info")
result = await resp.json() result = await resp.json()
assert result["data"]["data_disk"] == "/dev/sda" assert result["data"]["data_disk"] == "/dev/sda"
@pytest.mark.asyncio
async def test_api_os_datadisk_move(api_client: TestClient, coresys: CoreSys): async def test_api_os_datadisk_move(api_client: TestClient, coresys: CoreSys):
"""Test datadisk move without exists disk.""" """Test datadisk move without exists disk."""
await coresys.dbus.agent.connect(coresys.dbus.bus)
await coresys.dbus.agent.update()
coresys.os._available = True coresys.os._available = True
resp = await api_client.post("/os/datadisk/move", json={"device": "/dev/sdaaaa"}) resp = await api_client.post("/os/datadisk/move", json={"device": "/dev/sdaaaa"})
@ -59,12 +62,8 @@ async def test_api_os_datadisk_move(api_client: TestClient, coresys: CoreSys):
assert result["message"] == "'/dev/sdaaaa' don't exists on the host!" assert result["message"] == "'/dev/sdaaaa' don't exists on the host!"
@pytest.mark.asyncio
async def test_api_os_datadisk_list(api_client: TestClient, coresys: CoreSys): async def test_api_os_datadisk_list(api_client: TestClient, coresys: CoreSys):
"""Test datadisk list function.""" """Test datadisk list function."""
await coresys.dbus.agent.connect(coresys.dbus.bus)
await coresys.dbus.agent.update()
coresys.hardware.update_device( coresys.hardware.update_device(
Device( Device(
"sda", "sda",
@ -98,8 +97,6 @@ async def test_api_os_datadisk_list(api_client: TestClient, coresys: CoreSys):
async def test_api_board_yellow_info(api_client: TestClient, coresys: CoreSys): async def test_api_board_yellow_info(api_client: TestClient, coresys: CoreSys):
"""Test yellow board info.""" """Test yellow board info."""
await coresys.dbus.agent.board.connect(coresys.dbus.bus)
resp = await api_client.get("/os/boards/yellow") resp = await api_client.get("/os/boards/yellow")
assert resp.status == 200 assert resp.status == 200
@ -113,25 +110,27 @@ async def test_api_board_yellow_info(api_client: TestClient, coresys: CoreSys):
async def test_api_board_yellow_options( async def test_api_board_yellow_options(
api_client: TestClient, coresys: CoreSys, dbus: list[str] api_client: TestClient,
coresys: CoreSys,
os_agent_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]],
): ):
"""Test yellow board options.""" """Test yellow board options."""
await coresys.dbus.agent.board.connect(coresys.dbus.bus) yellow_service: YellowService = os_agent_services["agent_boards_yellow"]
assert coresys.dbus.agent.board.yellow.disk_led is True
assert coresys.dbus.agent.board.yellow.heartbeat_led is True
assert coresys.dbus.agent.board.yellow.power_led is True
assert len(coresys.resolution.issues) == 0 assert len(coresys.resolution.issues) == 0
dbus.clear()
resp = await api_client.post( resp = await api_client.post(
"/os/boards/yellow", "/os/boards/yellow",
json={"disk_led": False, "heartbeat_led": False, "power_led": False}, json={"disk_led": False, "heartbeat_led": False, "power_led": False},
) )
assert resp.status == 200 assert resp.status == 200
await asyncio.sleep(0) await yellow_service.ping()
assert dbus == [ assert coresys.dbus.agent.board.yellow.disk_led is False
"/io/hass/os/Boards/Yellow-io.hass.os.Boards.Yellow.DiskLED", assert coresys.dbus.agent.board.yellow.heartbeat_led is False
"/io/hass/os/Boards/Yellow-io.hass.os.Boards.Yellow.HeartbeatLED", assert coresys.dbus.agent.board.yellow.power_led is False
"/io/hass/os/Boards/Yellow-io.hass.os.Boards.Yellow.PowerLED",
]
assert ( assert (
Issue(IssueType.REBOOT_REQUIRED, ContextType.SYSTEM) Issue(IssueType.REBOOT_REQUIRED, ContextType.SYSTEM)
@ -143,13 +142,15 @@ async def test_api_board_yellow_options(
) )
async def test_api_board_supervised_info(api_client: TestClient, coresys: CoreSys): async def test_api_board_supervised_info(
api_client: TestClient, coresys: CoreSys, boards_service: BoardsService
):
"""Test supervised board info.""" """Test supervised board info."""
with patch( await mock_dbus_services({"agent_boards_supervised": None}, coresys.dbus.bus)
"supervisor.os.manager.CPE.get_product", return_value=["not-hassos"] boards_service.board = "Supervised"
), patch.object(BoardManager, "board", new=PropertyMock(return_value="Supervised")): await coresys.dbus.agent.board.update()
await coresys.dbus.agent.board.connect(coresys.dbus.bus)
await coresys.dbus.hostname.connect(coresys.dbus.bus) with patch("supervisor.os.manager.CPE.get_product", return_value=["not-hassos"]):
await coresys.os.load() await coresys.os.load()
assert (await api_client.get("/os/boards/supervised")).status == 200 assert (await api_client.get("/os/boards/supervised")).status == 200
@ -158,13 +159,14 @@ async def test_api_board_supervised_info(api_client: TestClient, coresys: CoreSy
assert (await api_client.get("/os/boards/not-real")).status == 400 assert (await api_client.get("/os/boards/not-real")).status == 400
async def test_api_board_other_info(api_client: TestClient, coresys: CoreSys): async def test_api_board_other_info(
api_client: TestClient, coresys: CoreSys, boards_service: BoardsService
):
"""Test info for other board without dbus object.""" """Test info for other board without dbus object."""
with patch.object( boards_service.board = "not-real"
BoardManager, "board", new=PropertyMock(return_value="not-real") await coresys.dbus.agent.board.update()
), patch.object(OSManager, "board", new=PropertyMock(return_value="not-real")):
await coresys.dbus.agent.board.connect(coresys.dbus.bus)
with patch.object(OSManager, "board", new=PropertyMock(return_value="not-real")):
assert (await api_client.get("/os/boards/not-real")).status == 200 assert (await api_client.get("/os/boards/not-real")).status == 200
assert (await api_client.post("/os/boards/not-real", json={})).status == 405 assert (await api_client.post("/os/boards/not-real", json={})).status == 405
assert (await api_client.get("/os/boards/yellow")).status == 400 assert (await api_client.get("/os/boards/yellow")).status == 400

View File

@ -2,15 +2,12 @@
# pylint: disable=protected-access # pylint: disable=protected-access
from unittest.mock import AsyncMock from unittest.mock import AsyncMock
import pytest
from supervisor.api.const import ATTR_AVAILABLE_UPDATES from supervisor.api.const import ATTR_AVAILABLE_UPDATES
from supervisor.coresys import CoreSys from supervisor.coresys import CoreSys
from tests.const import TEST_ADDON_SLUG from tests.const import TEST_ADDON_SLUG
@pytest.mark.asyncio
async def test_api_info(api_client): async def test_api_info(api_client):
"""Test docker info api.""" """Test docker info api."""
resp = await api_client.get("/info") resp = await api_client.get("/info")
@ -21,10 +18,9 @@ async def test_api_info(api_client):
assert result["data"]["supported"] is True assert result["data"]["supported"] is True
assert result["data"]["channel"] == "stable" assert result["data"]["channel"] == "stable"
assert result["data"]["logging"] == "info" assert result["data"]["logging"] == "info"
assert result["data"]["timezone"] == "UTC" assert result["data"]["timezone"] == "Etc/UTC"
@pytest.mark.asyncio
async def test_api_available_updates( async def test_api_available_updates(
install_addon_ssh, install_addon_ssh,
api_client, api_client,
@ -70,7 +66,6 @@ async def test_api_available_updates(
} }
@pytest.mark.asyncio
async def test_api_refresh_updates(api_client, coresys: CoreSys): async def test_api_refresh_updates(api_client, coresys: CoreSys):
"""Test docker info api.""" """Test docker info api."""

View File

@ -1,6 +1,5 @@
"""Test Supervisor API.""" """Test Supervisor API."""
# pylint: disable=protected-access # pylint: disable=protected-access
import asyncio
from unittest.mock import MagicMock, patch from unittest.mock import MagicMock, patch
from aiohttp.test_utils import TestClient from aiohttp.test_utils import TestClient
@ -10,10 +9,12 @@ from supervisor.coresys import CoreSys
from supervisor.exceptions import StoreGitError, StoreNotFound from supervisor.exceptions import StoreGitError, StoreNotFound
from supervisor.store.repository import Repository from supervisor.store.repository import Repository
from tests.dbus_service_mocks.base import DBusServiceMock
from tests.dbus_service_mocks.os_agent import OSAgent as OSAgentService
REPO_URL = "https://github.com/awesome-developer/awesome-repo" REPO_URL = "https://github.com/awesome-developer/awesome-repo"
@pytest.mark.asyncio
async def test_api_supervisor_options_debug(api_client: TestClient, coresys: CoreSys): async def test_api_supervisor_options_debug(api_client: TestClient, coresys: CoreSys):
"""Test security options force security.""" """Test security options force security."""
assert not coresys.config.debug assert not coresys.config.debug
@ -118,11 +119,15 @@ async def test_api_supervisor_options_auto_update(
async def test_api_supervisor_options_diagnostics( async def test_api_supervisor_options_diagnostics(
api_client: TestClient, coresys: CoreSys, dbus: list[str] api_client: TestClient,
coresys: CoreSys,
os_agent_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]],
): ):
"""Test changing diagnostics.""" """Test changing diagnostics."""
await coresys.dbus.agent.connect(coresys.dbus.bus) os_agent_service: OSAgentService = os_agent_services["os_agent"]
dbus.clear() os_agent_service.Diagnostics = False
await os_agent_service.ping()
assert coresys.dbus.agent.diagnostics is False
with patch("supervisor.utils.sentry.sentry_sdk.init") as sentry_init: with patch("supervisor.utils.sentry.sentry_sdk.init") as sentry_init:
response = await api_client.post( response = await api_client.post(
@ -131,10 +136,9 @@ async def test_api_supervisor_options_diagnostics(
assert response.status == 200 assert response.status == 200
sentry_init.assert_called_once() sentry_init.assert_called_once()
await asyncio.sleep(0) await os_agent_service.ping()
assert dbus == ["/io/hass/os-io.hass.os.Diagnostics"] assert coresys.dbus.agent.diagnostics is True
dbus.clear()
with patch("supervisor.api.supervisor.close_sentry") as close_sentry: with patch("supervisor.api.supervisor.close_sentry") as close_sentry:
response = await api_client.post( response = await api_client.post(
"/supervisor/options", json={"diagnostics": False} "/supervisor/options", json={"diagnostics": False}
@ -142,8 +146,8 @@ async def test_api_supervisor_options_diagnostics(
assert response.status == 200 assert response.status == 200
close_sentry.assert_called_once() close_sentry.assert_called_once()
await asyncio.sleep(0) await os_agent_service.ping()
assert dbus == ["/io/hass/os-io.hass.os.Diagnostics"] assert coresys.dbus.agent.diagnostics is False
async def test_api_supervisor_logs(api_client: TestClient, docker_logs: MagicMock): async def test_api_supervisor_logs(api_client: TestClient, docker_logs: MagicMock):

View File

@ -1,76 +1,18 @@
"""Common test functions.""" """Common test functions."""
import asyncio
from importlib import import_module from importlib import import_module
import json import json
from pathlib import Path from pathlib import Path
from typing import Any from typing import Any
from dbus_fast.aio.message_bus import MessageBus from dbus_fast.aio.message_bus import MessageBus
from dbus_fast.introspection import Method, Property, Signal
from supervisor.dbus.interface import DBusInterface, DBusInterfaceProxy
from supervisor.resolution.validate import get_valid_modules from supervisor.resolution.validate import get_valid_modules
from supervisor.utils.dbus import DBUS_INTERFACE_PROPERTIES
from supervisor.utils.yaml import read_yaml_file from supervisor.utils.yaml import read_yaml_file
from .dbus_service_mocks.base import DBusServiceMock from .dbus_service_mocks.base import DBusServiceMock
def get_dbus_name(intr_list: list[Method | Property | Signal], snake_case: str) -> str:
"""Find name in introspection list, fallback to ignore case match."""
name = "".join([part.capitalize() for part in snake_case.split("_")])
names = [item.name for item in intr_list]
if name in names:
return name
# Acronyms like NTP can't be easily converted back to camel case. Fallback to ignore case match
lower_name = name.lower()
for val in names:
if lower_name == val.lower():
return val
raise AttributeError(f"Could not find match for {name} in D-Bus introspection!")
def fire_watched_signal(dbus: DBusInterface, signal: str, data: list[Any] | str):
"""Test firing a watched signal."""
if isinstance(data, str) and exists_fixture(data):
data = load_json_fixture(data)
if not isinstance(data, list):
raise ValueError("Data must be a list!")
signal_parts = signal.split(".")
interface = ".".join(signal_parts[:-1])
name = signal_parts[-1]
# pylint: disable=protected-access
assert interface in dbus.dbus._signal_monitors
signals = dbus.dbus._proxies[interface].introspection.signals
signal_monitors = {
get_dbus_name(signals, k): v
for k, v in dbus.dbus._signal_monitors[interface].items()
}
assert name in signal_monitors
for coro in [callback(*data) for callback in signal_monitors[name]]:
asyncio.create_task(coro)
def fire_property_change_signal(
dbus: DBusInterfaceProxy,
changed: dict[str, Any] | None = None,
invalidated: list[str] | None = None,
):
"""Fire a property change signal for an interface proxy."""
fire_watched_signal(
dbus,
f"{DBUS_INTERFACE_PROPERTIES}.PropertiesChanged",
[dbus.properties_interface, changed or {}, invalidated or []],
)
def get_fixture_path(filename: str) -> Path: def get_fixture_path(filename: str) -> Path:
"""Get path for fixture.""" """Get path for fixture."""
return Path(Path(__file__).parent.joinpath("fixtures"), filename) return Path(Path(__file__).parent.joinpath("fixtures"), filename)

View File

@ -3,9 +3,7 @@ from functools import partial
from inspect import unwrap from inspect import unwrap
import os import os
from pathlib import Path from pathlib import Path
import re
import subprocess import subprocess
from typing import Any
from unittest.mock import AsyncMock, MagicMock, Mock, PropertyMock, patch from unittest.mock import AsyncMock, MagicMock, Mock, PropertyMock, patch
from uuid import uuid4 from uuid import uuid4
@ -14,7 +12,6 @@ from aiohttp.test_utils import TestClient
from awesomeversion import AwesomeVersion from awesomeversion import AwesomeVersion
from dbus_fast import BusType from dbus_fast import BusType
from dbus_fast.aio.message_bus import MessageBus from dbus_fast.aio.message_bus import MessageBus
from dbus_fast.aio.proxy_object import ProxyInterface, ProxyObject
import pytest import pytest
from securetar import SecureTarFile from securetar import SecureTarFile
@ -41,30 +38,15 @@ from supervisor.const import (
REQUEST_FROM, REQUEST_FROM,
) )
from supervisor.coresys import CoreSys from supervisor.coresys import CoreSys
from supervisor.dbus.agent import OSAgent
from supervisor.dbus.const import (
DBUS_OBJECT_BASE,
DBUS_SIGNAL_NM_CONNECTION_ACTIVE_CHANGED,
DBUS_SIGNAL_RAUC_INSTALLER_COMPLETED,
)
from supervisor.dbus.hostname import Hostname
from supervisor.dbus.interface import DBusInterface
from supervisor.dbus.network import NetworkManager from supervisor.dbus.network import NetworkManager
from supervisor.dbus.resolved import Resolved
from supervisor.dbus.systemd import Systemd
from supervisor.dbus.timedate import TimeDate
from supervisor.dbus.udisks2 import UDisks2
from supervisor.docker.manager import DockerAPI from supervisor.docker.manager import DockerAPI
from supervisor.docker.monitor import DockerMonitor from supervisor.docker.monitor import DockerMonitor
from supervisor.host.logs import LogsControl from supervisor.host.logs import LogsControl
from supervisor.store.addon import AddonStore from supervisor.store.addon import AddonStore
from supervisor.store.repository import Repository from supervisor.store.repository import Repository
from supervisor.utils.dbus import DBUS_INTERFACE_PROPERTIES, DBus
from supervisor.utils.dt import utcnow from supervisor.utils.dt import utcnow
from .common import ( from .common import (
exists_fixture,
get_dbus_name,
load_binary_fixture, load_binary_fixture,
load_fixture, load_fixture,
load_json_fixture, load_json_fixture,
@ -72,6 +54,10 @@ from .common import (
) )
from .const import TEST_ADDON_SLUG from .const import TEST_ADDON_SLUG
from .dbus_service_mocks.base import DBusServiceMock from .dbus_service_mocks.base import DBusServiceMock
from .dbus_service_mocks.network_connection_settings import (
ConnectionSettings as ConnectionSettingsService,
)
from .dbus_service_mocks.network_manager import NetworkManager as NetworkManagerService
# pylint: disable=redefined-outer-name, protected-access # pylint: disable=redefined-outer-name, protected-access
@ -117,14 +103,6 @@ def docker() -> DockerAPI:
yield docker_obj yield docker_obj
@pytest.fixture
async def dbus_bus() -> MessageBus:
"""Message bus mock."""
bus = AsyncMock(spec=MessageBus)
setattr(bus, "_name_owners", {})
yield bus
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def dbus_session() -> None: def dbus_session() -> None:
"""Start a dbus session.""" """Start a dbus session."""
@ -144,178 +122,6 @@ async def dbus_session_bus(dbus_session) -> MessageBus:
bus.disconnect() bus.disconnect()
@pytest.fixture
async def dbus_services(
request: pytest.FixtureRequest, dbus_session: MessageBus
) -> dict[str, dict[str, DBusServiceMock] | DBusServiceMock]:
"""Mock specified dbus services on session bus.
Wrapper on mock_dbus_services intended to be used indirectly.
Request param passed to it as to_mock and output returned as fixture value.
"""
with patch("supervisor.dbus.manager.MessageBus.connect", return_value=dbus_session):
yield await mock_dbus_services(request.param, dbus_session)
def _process_pseudo_variant(data: dict[str, Any]) -> Any:
"""Process pseudo variant into value."""
if data["_type"] == "ay":
return bytearray(data["_value"], encoding="utf-8")
if data["_type"] == "aay":
return [bytearray(i, encoding="utf-8") for i in data["_value"]]
# Unknown type, return as is
return data
def process_dbus_json(data: Any) -> Any:
"""Replace pseudo-variants with values of unsupported json types as necessary."""
if not isinstance(data, dict):
return data
if len(data.keys()) == 2 and "_type" in data and "_value" in data:
return _process_pseudo_variant(data)
return {k: process_dbus_json(v) for k, v in data.items()}
def mock_get_properties(object_path: str, interface: str) -> str:
"""Mock get dbus properties."""
base, _, latest = object_path.rpartition("/")
fixture = interface.replace(".", "_")
if latest.isnumeric() or base in [
"/org/freedesktop/UDisks2/block_devices",
"/org/freedesktop/UDisks2/drives",
]:
fixture = f"{fixture}_{latest}"
return process_dbus_json(load_json_fixture(f"{fixture}.json"))
async def mock_init_proxy(self):
"""Mock init dbus proxy."""
filetype = "xml"
fixture = (
self.object_path.replace("/", "_")[1:]
if self.object_path != DBUS_OBJECT_BASE
else self.bus_name.replace(".", "_")
)
if not exists_fixture(f"{fixture}.{filetype}"):
fixture = re.sub(r"_[0-9]+$", "", fixture)
# special case
if exists_fixture(f"{fixture}_~.{filetype}"):
fixture = f"{fixture}_~"
# Use dbus-next infrastructure to parse introspection xml
self._proxy_obj = ProxyObject(
self.bus_name,
self.object_path,
load_fixture(f"{fixture}.{filetype}"),
self._bus,
)
self._add_interfaces()
if DBUS_INTERFACE_PROPERTIES in self._proxies:
setattr(
self._proxies[DBUS_INTERFACE_PROPERTIES],
"call_get_all",
lambda interface: mock_get_properties(self.object_path, interface),
)
@pytest.fixture
def dbus(dbus_bus: MessageBus) -> list[str]:
"""Mock DBUS."""
dbus_commands = []
async def mock_wait_for_signal(self):
if (
self._interface + "." + self._member
== DBUS_SIGNAL_NM_CONNECTION_ACTIVE_CHANGED
):
return [2, 0]
if self._interface + "." + self._member == DBUS_SIGNAL_RAUC_INSTALLER_COMPLETED:
return [0]
async def mock_signal___aenter__(self):
return self
async def mock_signal___aexit__(self, exc_t, exc_v, exc_tb):
pass
async def mock_call_dbus(
proxy_interface: ProxyInterface,
method: str,
*args,
unpack_variants: bool = True,
):
if (
proxy_interface.introspection.name == DBUS_INTERFACE_PROPERTIES
and method == "call_get_all"
):
return mock_get_properties(proxy_interface.path, args[0])
[dbus_type, dbus_name] = method.split("_", 1)
if dbus_type in ["get", "set"]:
dbus_name = get_dbus_name(
proxy_interface.introspection.properties, dbus_name
)
dbus_commands.append(
f"{proxy_interface.path}-{proxy_interface.introspection.name}.{dbus_name}"
)
if dbus_type == "set":
return
return mock_get_properties(
proxy_interface.path, proxy_interface.introspection.name
)[dbus_name]
dbus_name = get_dbus_name(proxy_interface.introspection.methods, dbus_name)
dbus_commands.append(
f"{proxy_interface.path}-{proxy_interface.introspection.name}.{dbus_name}"
)
if proxy_interface.path != DBUS_OBJECT_BASE:
fixture = proxy_interface.path.replace("/", "_")[1:]
fixture = f"{fixture}-{dbus_name}"
else:
fixture = (
f'{proxy_interface.introspection.name.replace(".", "_")}_{dbus_name}'
)
if exists_fixture(f"{fixture}.json"):
return process_dbus_json(load_json_fixture(f"{fixture}.json"))
with patch("supervisor.utils.dbus.DBus.call_dbus", new=mock_call_dbus), patch(
"supervisor.utils.dbus.DBus._init_proxy", new=mock_init_proxy
), patch(
"supervisor.utils.dbus.DBusSignalWrapper.__aenter__", new=mock_signal___aenter__
), patch(
"supervisor.utils.dbus.DBusSignalWrapper.__aexit__", new=mock_signal___aexit__
), patch(
"supervisor.utils.dbus.DBusSignalWrapper.wait_for_signal",
new=mock_wait_for_signal,
), patch(
"supervisor.dbus.manager.MessageBus.connect", return_value=dbus_bus
):
yield dbus_commands
@pytest.fixture
async def dbus_minimal(dbus_bus: MessageBus) -> MessageBus:
"""Mock DBus without mocking call_dbus or signals but handle properties fixture."""
with patch("supervisor.utils.dbus.DBus._init_proxy", new=mock_init_proxy), patch(
"supervisor.dbus.manager.MessageBus.connect", return_value=dbus_bus
):
yield dbus_bus
@pytest.fixture @pytest.fixture
async def dbus_is_connected(): async def dbus_is_connected():
"""Mock DBusInterface.is_connected for tests.""" """Mock DBusInterface.is_connected for tests."""
@ -365,6 +171,22 @@ async def network_manager(
yield nm_obj yield nm_obj
@pytest.fixture
async def network_manager_service(
network_manager_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]]
) -> NetworkManagerService:
"""Return Network Manager service mock."""
yield network_manager_services["network_manager"]
@pytest.fixture(name="connection_settings_service")
async def fixture_connection_settings_service(
network_manager_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]]
) -> ConnectionSettingsService:
"""Return mock connection settings service."""
yield network_manager_services["network_connection_settings"]
@pytest.fixture(name="udisks2_services") @pytest.fixture(name="udisks2_services")
async def fixture_udisks2_services( async def fixture_udisks2_services(
dbus_session_bus: MessageBus, dbus_session_bus: MessageBus,
@ -415,54 +237,51 @@ async def fixture_udisks2_services(
) )
async def mock_dbus_interface( @pytest.fixture(name="os_agent_services")
dbus: DBus, dbus_bus: MessageBus, instance: DBusInterface async def fixture_os_agent_services(
) -> DBusInterface: dbus_session_bus: MessageBus,
"""Mock dbus for a DBusInterface instance.""" ) -> dict[str, DBusServiceMock]:
instance.dbus = dbus """Mock all services os agent connects to."""
await instance.connect(dbus_bus) yield await mock_dbus_services(
return instance {
"os_agent": None,
"agent_apparmor": None,
"agent_cgroup": None,
"agent_datadisk": None,
"agent_system": None,
"agent_boards": None,
"agent_boards_yellow": None,
},
dbus_session_bus,
)
@pytest.fixture @pytest.fixture(name="all_dbus_services")
async def hostname(dbus: DBus, dbus_bus: MessageBus) -> Hostname: async def fixture_all_dbus_services(
"""Mock Hostname.""" dbus_session_bus: MessageBus,
yield await mock_dbus_interface(dbus, dbus_bus, Hostname()) network_manager_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]],
udisks2_services: dict[str, DBusServiceMock | dict[str, DBusServiceMock]],
os_agent_services: dict[str, DBusServiceMock],
@pytest.fixture ) -> dict[str, DBusServiceMock | dict[str, DBusServiceMock]]:
async def timedate(dbus: DBus, dbus_bus: MessageBus) -> TimeDate: """Mock all dbus services supervisor uses."""
"""Mock Timedate.""" yield (
yield await mock_dbus_interface(dbus, dbus_bus, TimeDate()) await mock_dbus_services(
{
"hostname": None,
@pytest.fixture "logind": None,
async def systemd(dbus: DBus, dbus_bus: MessageBus) -> Systemd: "rauc": None,
"""Mock Systemd.""" "resolved": None,
yield await mock_dbus_interface(dbus, dbus_bus, Systemd()) "systemd": None,
"timedate": None,
},
@pytest.fixture dbus_session_bus,
async def os_agent(dbus: DBus, dbus_bus: MessageBus) -> OSAgent: )
"""Mock OSAgent.""" ) | network_manager_services | udisks2_services | os_agent_services
yield await mock_dbus_interface(dbus, dbus_bus, OSAgent())
@pytest.fixture
async def resolved(dbus: DBus, dbus_bus: MessageBus) -> Resolved:
"""Mock REsolved."""
yield await mock_dbus_interface(dbus, dbus_bus, Resolved())
@pytest.fixture
async def udisks2(dbus: DBus, dbus_bus: MessageBus) -> UDisks2:
"""Mock UDisks2."""
yield await mock_dbus_interface(dbus, dbus_bus, UDisks2())
@pytest.fixture @pytest.fixture
async def coresys( async def coresys(
event_loop, docker, dbus, dbus_bus, aiohttp_client, run_dir event_loop, docker, dbus_session_bus, all_dbus_services, aiohttp_client, run_dir
) -> CoreSys: ) -> CoreSys:
"""Create a CoreSys Mock.""" """Create a CoreSys Mock."""
with patch("supervisor.bootstrap.initialize_system"), patch( with patch("supervisor.bootstrap.initialize_system"), patch(
@ -486,11 +305,13 @@ async def coresys(
coresys_obj._machine_id = uuid4() coresys_obj._machine_id = uuid4()
# Mock host communication # Mock host communication
coresys_obj._dbus._bus = dbus_bus with patch("supervisor.dbus.manager.MessageBus") as message_bus, patch(
network_manager = NetworkManager() "supervisor.dbus.manager.SOCKET_DBUS"
network_manager.dbus = dbus ):
await network_manager.connect(dbus_bus) message_bus.return_value.connect = AsyncMock(return_value=dbus_session_bus)
coresys_obj._dbus._network = network_manager await coresys_obj._dbus.load()
# coresys_obj._dbus._bus = dbus_session_bus
# coresys_obj._dbus._network = network_manager
# Mock docker # Mock docker
coresys_obj._docker = docker coresys_obj._docker = docker

View File

@ -7,18 +7,20 @@ from supervisor.dbus.agent.boards import BoardManager
from supervisor.exceptions import BoardInvalidError from supervisor.exceptions import BoardInvalidError
from tests.common import mock_dbus_services from tests.common import mock_dbus_services
from tests.dbus_service_mocks.boards import Boards as BoardsService from tests.dbus_service_mocks.agent_boards import Boards as BoardsService
@pytest.fixture(name="boards_service", autouse=True) @pytest.fixture(name="boards_service", autouse=True)
async def fixture_boards_service(dbus_session_bus: MessageBus) -> BoardsService: async def fixture_boards_service(dbus_session_bus: MessageBus) -> BoardsService:
"""Mock Boards dbus service.""" """Mock Boards dbus service."""
yield (await mock_dbus_services({"boards": None}, dbus_session_bus))["boards"] yield (await mock_dbus_services({"agent_boards": None}, dbus_session_bus))[
"agent_boards"
]
async def test_dbus_board(dbus_session_bus: MessageBus): async def test_dbus_board(dbus_session_bus: MessageBus):
"""Test DBus Board load.""" """Test DBus Board load."""
await mock_dbus_services({"boards_yellow": None}, dbus_session_bus) await mock_dbus_services({"agent_boards_yellow": None}, dbus_session_bus)
board = BoardManager() board = BoardManager()
await board.connect(dbus_session_bus) await board.connect(dbus_session_bus)
@ -34,7 +36,7 @@ async def test_dbus_board_supervised(
boards_service: BoardsService, dbus_session_bus: MessageBus boards_service: BoardsService, dbus_session_bus: MessageBus
): ):
"""Test DBus Board load with supervised board.""" """Test DBus Board load with supervised board."""
await mock_dbus_services({"boards_supervised": None}, dbus_session_bus) await mock_dbus_services({"agent_boards_supervised": None}, dbus_session_bus)
boards_service.board = "Supervised" boards_service.board = "Supervised"
board = BoardManager() board = BoardManager()

View File

@ -8,14 +8,14 @@ import pytest
from supervisor.dbus.agent.boards.yellow import Yellow from supervisor.dbus.agent.boards.yellow import Yellow
from tests.common import mock_dbus_services from tests.common import mock_dbus_services
from tests.dbus_service_mocks.boards_yellow import Yellow as YellowService from tests.dbus_service_mocks.agent_boards_yellow import Yellow as YellowService
@pytest.fixture(name="yellow_service", autouse=True) @pytest.fixture(name="yellow_service", autouse=True)
async def fixture_yellow_service(dbus_session_bus: MessageBus) -> YellowService: async def fixture_yellow_service(dbus_session_bus: MessageBus) -> YellowService:
"""Mock Yellow Board dbus service.""" """Mock Yellow Board dbus service."""
yield (await mock_dbus_services({"boards_yellow": None}, dbus_session_bus))[ yield (await mock_dbus_services({"agent_boards_yellow": None}, dbus_session_bus))[
"boards_yellow" "agent_boards_yellow"
] ]

View File

@ -1,24 +0,0 @@
"""Shared fixtures for OS Agent tests."""
from dbus_fast.aio.message_bus import MessageBus
import pytest
from tests.common import mock_dbus_services
from tests.dbus_service_mocks.base import DBusServiceMock
@pytest.fixture
async def os_agent_services(dbus_session_bus: MessageBus) -> dict[str, DBusServiceMock]:
"""Mock all services os agent connects to."""
yield await mock_dbus_services(
{
"os_agent": None,
"apparmor": None,
"cgroup": None,
"datadisk": None,
"system": None,
"boards": None,
"boards_yellow": None,
},
dbus_session_bus,
)

View File

@ -8,7 +8,7 @@ import pytest
from supervisor.dbus.agent import OSAgent from supervisor.dbus.agent import OSAgent
from supervisor.exceptions import DBusNotConnectedError from supervisor.exceptions import DBusNotConnectedError
from tests.dbus_service_mocks.apparmor import AppArmor as AppArmorService from tests.dbus_service_mocks.agent_apparmor import AppArmor as AppArmorService
from tests.dbus_service_mocks.base import DBusServiceMock from tests.dbus_service_mocks.base import DBusServiceMock
@ -17,7 +17,7 @@ async def fixture_apparmor_service(
os_agent_services: dict[str, DBusServiceMock] os_agent_services: dict[str, DBusServiceMock]
) -> AppArmorService: ) -> AppArmorService:
"""Mock AppArmor dbus service.""" """Mock AppArmor dbus service."""
yield os_agent_services["apparmor"] yield os_agent_services["agent_apparmor"]
async def test_dbus_osagent_apparmor( async def test_dbus_osagent_apparmor(
@ -46,6 +46,7 @@ async def test_dbus_osagent_apparmor_load(
apparmor_service: AppArmorService, dbus_session_bus: MessageBus apparmor_service: AppArmorService, dbus_session_bus: MessageBus
): ):
"""Load AppArmor Profile on host.""" """Load AppArmor Profile on host."""
apparmor_service.LoadProfile.calls.clear()
os_agent = OSAgent() os_agent = OSAgent()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -70,6 +71,7 @@ async def test_dbus_osagent_apparmor_unload(
apparmor_service: AppArmorService, dbus_session_bus: MessageBus apparmor_service: AppArmorService, dbus_session_bus: MessageBus
): ):
"""Unload AppArmor Profile on host.""" """Unload AppArmor Profile on host."""
apparmor_service.UnloadProfile.calls.clear()
os_agent = OSAgent() os_agent = OSAgent()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -6,8 +6,8 @@ import pytest
from supervisor.dbus.agent import OSAgent from supervisor.dbus.agent import OSAgent
from supervisor.exceptions import DBusNotConnectedError from supervisor.exceptions import DBusNotConnectedError
from tests.dbus_service_mocks.agent_cgroup import CGroup as CGroupService
from tests.dbus_service_mocks.base import DBusServiceMock from tests.dbus_service_mocks.base import DBusServiceMock
from tests.dbus_service_mocks.cgroup import CGroup as CGroupService
@pytest.fixture(name="cgroup_service", autouse=True) @pytest.fixture(name="cgroup_service", autouse=True)
@ -15,13 +15,14 @@ async def fixture_cgroup_service(
os_agent_services: dict[str, DBusServiceMock] os_agent_services: dict[str, DBusServiceMock]
) -> CGroupService: ) -> CGroupService:
"""Mock CGroup dbus service.""" """Mock CGroup dbus service."""
yield os_agent_services["cgroup"] yield os_agent_services["agent_cgroup"]
async def test_dbus_osagent_cgroup_add_devices( async def test_dbus_osagent_cgroup_add_devices(
cgroup_service: CGroupService, dbus_session_bus: MessageBus cgroup_service: CGroupService, dbus_session_bus: MessageBus
): ):
"""Test wipe data partition on host.""" """Test wipe data partition on host."""
cgroup_service.AddDevicesAllowed.calls.clear()
os_agent = OSAgent() os_agent = OSAgent()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -8,8 +8,8 @@ import pytest
from supervisor.dbus.agent import OSAgent from supervisor.dbus.agent import OSAgent
from supervisor.exceptions import DBusNotConnectedError from supervisor.exceptions import DBusNotConnectedError
from tests.dbus_service_mocks.agent_datadisk import DataDisk as DataDiskService
from tests.dbus_service_mocks.base import DBusServiceMock from tests.dbus_service_mocks.base import DBusServiceMock
from tests.dbus_service_mocks.datadisk import DataDisk as DataDiskService
@pytest.fixture(name="datadisk_service", autouse=True) @pytest.fixture(name="datadisk_service", autouse=True)
@ -17,7 +17,7 @@ async def fixture_datadisk_service(
os_agent_services: dict[str, DBusServiceMock] os_agent_services: dict[str, DBusServiceMock]
) -> DataDiskService: ) -> DataDiskService:
"""Mock DataDisk dbus service.""" """Mock DataDisk dbus service."""
yield os_agent_services["datadisk"] yield os_agent_services["agent_datadisk"]
async def test_dbus_osagent_datadisk( async def test_dbus_osagent_datadisk(
@ -46,6 +46,7 @@ async def test_dbus_osagent_datadisk_change_device(
datadisk_service: DataDiskService, dbus_session_bus: MessageBus datadisk_service: DataDiskService, dbus_session_bus: MessageBus
): ):
"""Change datadisk on device.""" """Change datadisk on device."""
datadisk_service.ChangeDevice.calls.clear()
os_agent = OSAgent() os_agent = OSAgent()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -61,6 +62,7 @@ async def test_dbus_osagent_datadisk_reload_device(
datadisk_service: DataDiskService, dbus_session_bus: MessageBus datadisk_service: DataDiskService, dbus_session_bus: MessageBus
): ):
"""Change datadisk on device.""" """Change datadisk on device."""
datadisk_service.ReloadDevice.calls.clear()
os_agent = OSAgent() os_agent = OSAgent()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -6,8 +6,8 @@ import pytest
from supervisor.dbus.agent import OSAgent from supervisor.dbus.agent import OSAgent
from supervisor.exceptions import DBusNotConnectedError from supervisor.exceptions import DBusNotConnectedError
from tests.dbus_service_mocks.agent_system import System as SystemService
from tests.dbus_service_mocks.base import DBusServiceMock from tests.dbus_service_mocks.base import DBusServiceMock
from tests.dbus_service_mocks.system import System as SystemService
@pytest.fixture(name="system_service", autouse=True) @pytest.fixture(name="system_service", autouse=True)
@ -15,13 +15,14 @@ async def fixture_system_service(
os_agent_services: dict[str, DBusServiceMock] os_agent_services: dict[str, DBusServiceMock]
) -> SystemService: ) -> SystemService:
"""Mock System dbus service.""" """Mock System dbus service."""
yield os_agent_services["system"] yield os_agent_services["agent_system"]
async def test_dbus_osagent_system_wipe( async def test_dbus_osagent_system_wipe(
system_service: SystemService, dbus_session_bus: MessageBus system_service: SystemService, dbus_session_bus: MessageBus
): ):
"""Test wipe data partition on host.""" """Test wipe data partition on host."""
system_service.ScheduleWipeDevice.calls.clear()
os_agent = OSAgent() os_agent = OSAgent()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -37,6 +37,8 @@ async def test_update(
connection_settings_service: ConnectionSettingsService, connection_settings_service: ConnectionSettingsService,
): ):
"""Test network manager update.""" """Test network manager update."""
connection_settings_service.Update.calls.clear()
interface = Interface.from_dbus_interface(dbus_interface) interface = Interface.from_dbus_interface(dbus_interface)
conn = get_connection_from_interface( conn = get_connection_from_interface(
interface, interface,

View File

@ -81,6 +81,7 @@ async def test_activate_connection(
network_manager_service: NetworkManagerService, network_manager: NetworkManager network_manager_service: NetworkManagerService, network_manager: NetworkManager
): ):
"""Test activate connection.""" """Test activate connection."""
network_manager_service.ActivateConnection.calls.clear()
connection = await network_manager.activate_connection( connection = await network_manager.activate_connection(
"/org/freedesktop/NetworkManager/Settings/1", "/org/freedesktop/NetworkManager/Settings/1",
"/org/freedesktop/NetworkManager/Devices/1", "/org/freedesktop/NetworkManager/Devices/1",

View File

@ -26,6 +26,7 @@ async def test_add_connection(
settings_service: SettingsService, dbus_session_bus: MessageBus settings_service: SettingsService, dbus_session_bus: MessageBus
): ):
"""Test adding settings connection.""" """Test adding settings connection."""
settings_service.AddConnection.calls.clear()
settings = NetworkManagerSettings() settings = NetworkManagerSettings()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -44,6 +45,7 @@ async def test_reload_connections(
settings_service: SettingsService, dbus_session_bus: MessageBus settings_service: SettingsService, dbus_session_bus: MessageBus
): ):
"""Test reload connections.""" """Test reload connections."""
settings_service.ReloadConnections.calls.clear()
settings = NetworkManagerSettings() settings = NetworkManagerSettings()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -48,6 +48,7 @@ async def test_dbus_sethostname(
hostname_service: HostnameService, dbus_session_bus: MessageBus hostname_service: HostnameService, dbus_session_bus: MessageBus
): ):
"""Set hostname on backend.""" """Set hostname on backend."""
hostname_service.SetStaticHostname.calls.clear()
hostname = Hostname() hostname = Hostname()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -1,160 +1,215 @@
"""Test dbus interface.""" """Test dbus interface."""
import asyncio from unittest.mock import patch
from dataclasses import dataclass
from unittest.mock import MagicMock
from dbus_fast.aio.message_bus import MessageBus from dbus_fast.aio.message_bus import MessageBus
from dbus_fast.service import PropertyAccess, dbus_property, signal
import pytest import pytest
from supervisor.dbus.const import DBUS_OBJECT_BASE from supervisor.dbus.const import DBUS_OBJECT_BASE
from supervisor.dbus.interface import DBusInterface, DBusInterfaceProxy from supervisor.dbus.interface import DBusInterface, DBusInterfaceProxy
from supervisor.exceptions import DBusInterfaceError from supervisor.exceptions import DBusInterfaceError, DBusNotConnectedError
from supervisor.utils.dbus import DBus from supervisor.utils.dbus import DBus
from tests.common import fire_property_change_signal, fire_watched_signal from tests.common import load_fixture
from tests.dbus_service_mocks.base import DBusServiceMock
@dataclass class TestInterface(DBusServiceMock):
class DBusInterfaceProxyMock: """Test interface."""
"""DBus Interface and signalling mocks."""
obj: DBusInterfaceProxy interface = "service.test.TestInterface"
on_device_added: MagicMock = MagicMock()
off_device_added: MagicMock = MagicMock() def __init__(self, object_path: str = "/service/test/TestInterface"):
"""Initialize object."""
super().__init__()
self.object_path = object_path
@signal(name="TestSignal")
def test_signal(self, value: str) -> "s": # noqa: F821
"""Send test signal."""
return value
@dbus_property(access=PropertyAccess.READ, name="TestProp")
def test_prop(self) -> "u": # noqa: F821
"""Get test property."""
return 4
@pytest.fixture(name="test_service")
async def fixture_test_service(dbus_session_bus: MessageBus) -> TestInterface:
"""Export test interface on dbus."""
await dbus_session_bus.request_name("service.test.TestInterface")
service = TestInterface()
service.export(dbus_session_bus)
yield service
@pytest.fixture(name="proxy") @pytest.fixture(name="proxy")
async def fixture_proxy( async def fixture_proxy(
request: pytest.FixtureRequest, dbus_bus: MessageBus, dbus request: pytest.FixtureRequest,
) -> DBusInterfaceProxyMock: test_service: TestInterface,
dbus_session_bus: MessageBus,
) -> DBusInterfaceProxy:
"""Get a proxy.""" """Get a proxy."""
proxy = DBusInterfaceProxy() proxy = DBusInterfaceProxy()
proxy.bus_name = "org.freedesktop.NetworkManager" proxy.bus_name = "service.test.TestInterface"
proxy.object_path = "/org/freedesktop/NetworkManager" proxy.object_path = "/service/test/TestInterface"
proxy.properties_interface = "org.freedesktop.NetworkManager" proxy.properties_interface = "service.test.TestInterface"
proxy.sync_properties = request.param proxy.sync_properties = request.param
await proxy.connect(dbus_bus) await proxy.connect(dbus_session_bus)
yield proxy
# pylint: disable=protected-access
nm_proxy = proxy.dbus._proxies["org.freedesktop.NetworkManager"]
mock = DBusInterfaceProxyMock(proxy)
setattr(nm_proxy, "on_device_added", mock.on_device_added)
setattr(nm_proxy, "off_device_added", mock.off_device_added)
yield mock
@pytest.mark.parametrize("proxy", [True], indirect=True) @pytest.mark.parametrize("proxy", [True], indirect=True)
async def test_dbus_proxy_connect(proxy: DBusInterfaceProxyMock): async def test_dbus_proxy_connect(
proxy: DBusInterfaceProxy, test_service: TestInterface
):
"""Test dbus proxy connect.""" """Test dbus proxy connect."""
assert proxy.obj.is_connected assert proxy.is_connected
assert proxy.obj.properties["Connectivity"] == 4 assert proxy.properties["TestProp"] == 4
fire_property_change_signal(proxy.obj, {"Connectivity": 1}) test_service.emit_properties_changed({"TestProp": 1})
await asyncio.sleep(0) await test_service.ping()
assert proxy.obj.properties["Connectivity"] == 1 assert proxy.properties["TestProp"] == 1
test_service.emit_properties_changed({}, ["TestProp"])
await test_service.ping()
await test_service.ping()
assert proxy.properties["TestProp"] == 4
@pytest.mark.parametrize("proxy", [False], indirect=True) @pytest.mark.parametrize("proxy", [False], indirect=True)
async def test_dbus_proxy_connect_no_sync(proxy: DBusInterfaceProxyMock): async def test_dbus_proxy_connect_no_sync(
proxy: DBusInterfaceProxy, test_service: TestInterface
):
"""Test dbus proxy connect with no properties sync.""" """Test dbus proxy connect with no properties sync."""
assert proxy.obj.is_connected assert proxy.is_connected
assert proxy.obj.properties["Connectivity"] == 4 assert proxy.properties["TestProp"] == 4
with pytest.raises(AssertionError): test_service.emit_properties_changed({"TestProp": 1})
fire_property_change_signal(proxy.obj, {"Connectivity": 1}) await test_service.ping()
assert proxy.properties["TestProp"] == 4
@pytest.mark.parametrize("proxy", [False], indirect=True) @pytest.mark.parametrize("proxy", [False], indirect=True)
async def test_signal_listener_disconnect(proxy: DBusInterfaceProxyMock): async def test_signal_listener_disconnect(
proxy: DBusInterfaceProxy, test_service: TestInterface
):
"""Test disconnect/delete unattaches signal listeners.""" """Test disconnect/delete unattaches signal listeners."""
assert proxy.obj.is_connected value = None
device = None
async def callback(dev: str): async def callback(val: str):
nonlocal device nonlocal value
device = dev value = val
proxy.obj.dbus.on_device_added(callback) assert proxy.is_connected
proxy.on_device_added.assert_called_once_with(callback, unpack_variants=True) proxy.dbus.on_test_signal(callback)
fire_watched_signal( test_service.test_signal("hello")
proxy.obj, "org.freedesktop.NetworkManager.DeviceAdded", ["/test/obj/1"] await test_service.ping()
) assert value == "hello"
await asyncio.sleep(0)
assert device == "/test/obj/1"
proxy.obj.disconnect() proxy.disconnect()
proxy.off_device_added.assert_called_once_with(callback, unpack_variants=True) test_service.test_signal("goodbye")
await test_service.ping()
assert value == "hello"
@pytest.mark.parametrize("proxy", [False], indirect=True) async def test_dbus_connected_no_raise_after_shutdown(
async def test_dbus_proxy_shutdown_pending_task(proxy: DBusInterfaceProxyMock): test_service: TestInterface, dbus_session_bus: MessageBus
"""Test pending task does not raise DBusNotConnectedError after shutdown.""" ):
assert proxy.obj.is_connected """Test dbus connected methods do not raise DBusNotConnectedError after shutdown."""
device = None proxy = DBusInterfaceProxy()
proxy.bus_name = "service.test.TestInterface"
proxy.object_path = "/service/test/TestInterface"
proxy.properties_interface = "service.test.TestInterface"
proxy.sync_properties = False
async def callback(dev: str): with pytest.raises(DBusNotConnectedError):
nonlocal device await proxy.update()
await proxy.obj.update()
device = dev
proxy.obj.dbus.on_device_added(callback) await proxy.connect(dbus_session_bus)
fire_watched_signal( assert proxy.is_connected
proxy.obj, "org.freedesktop.NetworkManager.DeviceAdded", ["/test/obj/1"]
) proxy.shutdown()
proxy.obj.shutdown() assert proxy.is_shutdown
await asyncio.sleep(0) assert await proxy.update() is None
assert device == "/test/obj/1"
async def test_proxy_missing_properties_interface(dbus_bus: MessageBus): async def test_proxy_missing_properties_interface(dbus_session_bus: MessageBus):
"""Test proxy instance disconnects and errors when missing properties interface.""" """Test proxy instance disconnects and errors when missing properties interface."""
proxy = DBusInterfaceProxy() proxy = DBusInterfaceProxy()
proxy.bus_name = "test.no.properties.interface" proxy.bus_name = "test.no.properties.interface"
proxy.object_path = DBUS_OBJECT_BASE proxy.object_path = DBUS_OBJECT_BASE
proxy.properties_interface = "test.no.properties.interface" proxy.properties_interface = "test.no.properties.interface"
with pytest.raises(DBusInterfaceError): async def mock_introspect(*args, **kwargs):
await proxy.connect(dbus_bus) """Return introspection without properties."""
assert proxy.is_connected is False return load_fixture("test_no_properties_interface.xml")
with patch.object(MessageBus, "introspect", new=mock_introspect), pytest.raises(
async def test_initialize(dbus_bus: MessageBus): DBusInterfaceError
"""Test initialize for reusing connected dbus object.""" ):
proxy = DBusInterface() await proxy.connect(dbus_session_bus)
proxy.bus_name = "org.freedesktop.UDisks2"
proxy.object_path = "/org/freedesktop/UDisks2/block_devices/sda"
assert proxy.is_connected is False assert proxy.is_connected is False
async def test_initialize(test_service: TestInterface, dbus_session_bus: MessageBus):
"""Test initialize for reusing connected dbus object."""
proxy = DBusInterface()
proxy.bus_name = "service.test.TestInterface"
proxy.object_path = "/service/test/TestInterface"
assert proxy.is_connected is False
# Not connected
with pytest.raises(ValueError, match="must be a connected DBus object"): with pytest.raises(ValueError, match="must be a connected DBus object"):
await proxy.initialize( await proxy.initialize(
DBus( DBus(
dbus_bus, dbus_session_bus,
"org.freedesktop.UDisks2", "service.test.TestInterface",
"/org/freedesktop/UDisks2/block_devices/sda", "/service/test/TestInterface",
) )
) )
# Connected to wrong bus
await dbus_session_bus.request_name("service.test.TestInterface2")
with pytest.raises( with pytest.raises(
ValueError, ValueError,
match="must be a DBus object connected to bus org.freedesktop.UDisks2 and object /org/freedesktop/UDisks2/block_devices/sda", match="must be a DBus object connected to bus service.test.TestInterface and object /service/test/TestInterface",
): ):
await proxy.initialize( await proxy.initialize(
await DBus.connect( await DBus.connect(
dbus_bus, "org.freedesktop.hostname1", "/org/freedesktop/hostname1" dbus_session_bus,
"service.test.TestInterface2",
"/service/test/TestInterface",
) )
) )
# Connected to wrong object
test_service_2 = TestInterface("/service/test/TestInterface/2")
test_service_2.export(dbus_session_bus)
with pytest.raises(
ValueError,
match="must be a DBus object connected to bus service.test.TestInterface and object /service/test/TestInterface",
):
await proxy.initialize(
await DBus.connect(
dbus_session_bus,
"service.test.TestInterface",
"/service/test/TestInterface/2",
)
)
# Connected to correct object on the correct bus
await proxy.initialize( await proxy.initialize(
await DBus.connect( await DBus.connect(
dbus_bus, dbus_session_bus,
"org.freedesktop.UDisks2", "service.test.TestInterface",
"/org/freedesktop/UDisks2/block_devices/sda", "/service/test/TestInterface",
) )
) )
assert proxy.is_connected is True assert proxy.is_connected is True

View File

@ -18,6 +18,7 @@ async def fixture_logind_service(dbus_session_bus: MessageBus) -> LogindService:
async def test_reboot(logind_service: LogindService, dbus_session_bus: MessageBus): async def test_reboot(logind_service: LogindService, dbus_session_bus: MessageBus):
"""Test reboot.""" """Test reboot."""
logind_service.Reboot.calls.clear()
logind = Logind() logind = Logind()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -31,6 +32,7 @@ async def test_reboot(logind_service: LogindService, dbus_session_bus: MessageBu
async def test_power_off(logind_service: LogindService, dbus_session_bus: MessageBus): async def test_power_off(logind_service: LogindService, dbus_session_bus: MessageBus):
"""Test power off.""" """Test power off."""
logind_service.PowerOff.calls.clear()
logind = Logind() logind = Logind()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -31,6 +31,7 @@ async def test_dbus_systemd_info(dbus_session_bus: MessageBus):
async def test_reboot(systemd_service: SystemdService, dbus_session_bus: MessageBus): async def test_reboot(systemd_service: SystemdService, dbus_session_bus: MessageBus):
"""Test reboot.""" """Test reboot."""
systemd_service.Reboot.calls.clear()
systemd = Systemd() systemd = Systemd()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -44,6 +45,7 @@ async def test_reboot(systemd_service: SystemdService, dbus_session_bus: Message
async def test_power_off(systemd_service: SystemdService, dbus_session_bus: MessageBus): async def test_power_off(systemd_service: SystemdService, dbus_session_bus: MessageBus):
"""Test power off.""" """Test power off."""
systemd_service.PowerOff.calls.clear()
systemd = Systemd() systemd = Systemd()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -59,6 +61,7 @@ async def test_start_unit(
systemd_service: SystemdService, dbus_session_bus: MessageBus systemd_service: SystemdService, dbus_session_bus: MessageBus
): ):
"""Test start unit.""" """Test start unit."""
systemd_service.StartUnit.calls.clear()
systemd = Systemd() systemd = Systemd()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -75,6 +78,7 @@ async def test_start_unit(
async def test_stop_unit(systemd_service: SystemdService, dbus_session_bus: MessageBus): async def test_stop_unit(systemd_service: SystemdService, dbus_session_bus: MessageBus):
"""Test stop unit.""" """Test stop unit."""
systemd_service.StopUnit.calls.clear()
systemd = Systemd() systemd = Systemd()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -93,6 +97,7 @@ async def test_restart_unit(
systemd_service: SystemdService, dbus_session_bus: MessageBus systemd_service: SystemdService, dbus_session_bus: MessageBus
): ):
"""Test restart unit.""" """Test restart unit."""
systemd_service.RestartUnit.calls.clear()
systemd = Systemd() systemd = Systemd()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):
@ -111,6 +116,7 @@ async def test_reload_unit(
systemd_service: SystemdService, dbus_session_bus: MessageBus systemd_service: SystemdService, dbus_session_bus: MessageBus
): ):
"""Test reload unit.""" """Test reload unit."""
systemd_service.ReloadOrRestartUnit.calls.clear()
systemd = Systemd() systemd = Systemd()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -50,6 +50,7 @@ async def test_dbus_settime(
timedate_service: TimeDateService, dbus_session_bus: MessageBus timedate_service: TimeDateService, dbus_session_bus: MessageBus
): ):
"""Set timestamp on backend.""" """Set timestamp on backend."""
timedate_service.SetTime.calls.clear()
timedate = TimeDate() timedate = TimeDate()
test_dt = datetime(2021, 5, 19, 8, 36, 54, 405718, tzinfo=timezone.utc) test_dt = datetime(2021, 5, 19, 8, 36, 54, 405718, tzinfo=timezone.utc)
@ -67,6 +68,7 @@ async def test_dbus_setntp(
timedate_service: TimeDateService, dbus_session_bus: MessageBus timedate_service: TimeDateService, dbus_session_bus: MessageBus
): ):
"""Disable NTP on backend.""" """Disable NTP on backend."""
timedate_service.SetNTP.calls.clear()
timedate = TimeDate() timedate = TimeDate()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -93,6 +93,7 @@ async def test_block_device_info(
async def test_format(block_sda_service: BlockService, dbus_session_bus: MessageBus): async def test_format(block_sda_service: BlockService, dbus_session_bus: MessageBus):
"""Test formatting block device.""" """Test formatting block device."""
block_sda_service.Format.calls.clear()
sda = UDisks2Block("/org/freedesktop/UDisks2/block_devices/sda") sda = UDisks2Block("/org/freedesktop/UDisks2/block_devices/sda")
await sda.connect(dbus_session_bus) await sda.connect(dbus_session_bus)

View File

@ -76,6 +76,7 @@ async def test_eject(
drive_flash_disk_service: DriveService, dbus_session_bus: MessageBus drive_flash_disk_service: DriveService, dbus_session_bus: MessageBus
): ):
"""Test eject.""" """Test eject."""
drive_flash_disk_service.Eject.calls.clear()
flash = UDisks2Drive("/org/freedesktop/UDisks2/drives/Generic_Flash_Disk_61BCDDB6") flash = UDisks2Drive("/org/freedesktop/UDisks2/drives/Generic_Flash_Disk_61BCDDB6")
await flash.connect(dbus_session_bus) await flash.connect(dbus_session_bus)

View File

@ -92,6 +92,7 @@ async def test_mount(
sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService
): ):
"""Test mount.""" """Test mount."""
filesystem_sda1_service.Mount.calls.clear()
assert await sda1.mount(MountOptions(fstype="gpt")) == "/run/media/dev/hassos_data" assert await sda1.mount(MountOptions(fstype="gpt")) == "/run/media/dev/hassos_data"
assert filesystem_sda1_service.Mount.calls == [ assert filesystem_sda1_service.Mount.calls == [
( (
@ -107,6 +108,7 @@ async def test_unmount(
sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService
): ):
"""Test unmount.""" """Test unmount."""
filesystem_sda1_service.Unmount.calls.clear()
await sda1.unmount(UnmountOptions(force=True)) await sda1.unmount(UnmountOptions(force=True))
assert filesystem_sda1_service.Unmount.calls == [ assert filesystem_sda1_service.Unmount.calls == [
({"force": Variant("b", True), "auth.no_user_interaction": Variant("b", True)},) ({"force": Variant("b", True), "auth.no_user_interaction": Variant("b", True)},)
@ -117,6 +119,7 @@ async def test_check(
sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService
): ):
"""Test check.""" """Test check."""
filesystem_sda1_service.Check.calls.clear()
assert await sda1.check() is True assert await sda1.check() is True
assert filesystem_sda1_service.Check.calls == [ assert filesystem_sda1_service.Check.calls == [
({"auth.no_user_interaction": Variant("b", True)},) ({"auth.no_user_interaction": Variant("b", True)},)
@ -127,6 +130,7 @@ async def test_repair(
sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService sda1: UDisks2Filesystem, filesystem_sda1_service: FilesystemService
): ):
"""Test repair.""" """Test repair."""
filesystem_sda1_service.Repair.calls.clear()
assert await sda1.repair() is True assert await sda1.repair() is True
assert filesystem_sda1_service.Repair.calls == [ assert filesystem_sda1_service.Repair.calls == [
({"auth.no_user_interaction": Variant("b", True)},) ({"auth.no_user_interaction": Variant("b", True)},)

View File

@ -122,6 +122,7 @@ async def test_resolve_device(
udisks2_manager_service: UDisks2ManagerService, dbus_session_bus: MessageBus udisks2_manager_service: UDisks2ManagerService, dbus_session_bus: MessageBus
): ):
"""Test resolve device.""" """Test resolve device."""
udisks2_manager_service.ResolveDevice.calls.clear()
udisks2 = UDisks2() udisks2 = UDisks2()
with pytest.raises(DBusNotConnectedError): with pytest.raises(DBusNotConnectedError):

View File

@ -100,6 +100,7 @@ async def test_create_partition(
partition_table_sda_service: PartitionTableService, dbus_session_bus: MessageBus partition_table_sda_service: PartitionTableService, dbus_session_bus: MessageBus
): ):
"""Test create partition.""" """Test create partition."""
partition_table_sda_service.CreatePartition.calls.clear()
sda = UDisks2PartitionTable("/org/freedesktop/UDisks2/block_devices/sda") sda = UDisks2PartitionTable("/org/freedesktop/UDisks2/block_devices/sda")
await sda.connect(dbus_session_bus) await sda.connect(dbus_session_bus)

View File

@ -8,8 +8,6 @@ from dbus_fast import Message
from dbus_fast.aio.message_bus import MessageBus from dbus_fast.aio.message_bus import MessageBus
from dbus_fast.service import ServiceInterface, method from dbus_fast.service import ServiceInterface, method
# pylint: disable=invalid-name
def dbus_method(name: str = None, disabled: bool = False): def dbus_method(name: str = None, disabled: bool = False):
"""Make DBus method with call tracking. """Make DBus method with call tracking.
@ -21,13 +19,13 @@ def dbus_method(name: str = None, disabled: bool = False):
orig_decorator = method(name=name, disabled=disabled) orig_decorator = method(name=name, disabled=disabled)
@no_type_check_decorator @no_type_check_decorator
def decorator(fn): def decorator(func):
calls: list[list[Any]] = [] calls: list[list[Any]] = []
@wraps(fn) @wraps(func)
def track_calls(self, *args): def track_calls(self, *args):
calls.append(args) calls.append(args)
return fn(self, *args) return func(self, *args)
wrapped = orig_decorator(track_calls) wrapped = orig_decorator(track_calls)
wrapped.__dict__["calls"] = calls wrapped.__dict__["calls"] = calls

View File

@ -107,4 +107,4 @@ class ActiveConnection(DBusServiceMock):
@signal() @signal()
def StateChanged(self) -> "uu": def StateChanged(self) -> "uu":
"""Signal StateChanged.""" """Signal StateChanged."""
return [0, 0] return [2, 0]

View File

@ -80,6 +80,7 @@ class ConnectionSettings(DBusServiceMock):
interface = "org.freedesktop.NetworkManager.Settings.Connection" interface = "org.freedesktop.NetworkManager.Settings.Connection"
object_path = "/org/freedesktop/NetworkManager/Settings/1" object_path = "/org/freedesktop/NetworkManager/Settings/1"
settings = SETTINGS_FIXTURE
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def Unsaved(self) -> "b": def Unsaved(self) -> "b":
@ -107,6 +108,7 @@ class ConnectionSettings(DBusServiceMock):
@dbus_method() @dbus_method()
def Update(self, properties: "a{sa{sv}}") -> None: def Update(self, properties: "a{sa{sv}}") -> None:
"""Do Update method.""" """Do Update method."""
self.settings = properties
self.Updated() self.Updated()
@dbus_method() @dbus_method()
@ -121,7 +123,7 @@ class ConnectionSettings(DBusServiceMock):
@dbus_method() @dbus_method()
def GetSettings(self) -> "a{sa{sv}}": def GetSettings(self) -> "a{sa{sv}}":
"""Do GetSettings method.""" """Do GetSettings method."""
return SETTINGS_FIXTURE return self.settings
@dbus_method() @dbus_method()
def GetSecrets(self, setting_name: "s") -> "a{sa{sv}}": def GetSecrets(self, setting_name: "s") -> "a{sa{sv}}":
@ -140,5 +142,5 @@ class ConnectionSettings(DBusServiceMock):
@dbus_method() @dbus_method()
def Update2(self, settings: "a{sa{sv}}", flags: "u", args: "a{sv}") -> "a{sv}": def Update2(self, settings: "a{sa{sv}}", flags: "u", args: "a{sv}") -> "a{sv}":
"""Do Update2 method.""" """Do Update2 method."""
self.Updated() self.Update(settings)
return {} return {}

View File

@ -23,6 +23,10 @@ class DeviceWireless(DBusServiceMock):
interface = "org.freedesktop.NetworkManager.Device.Wireless" interface = "org.freedesktop.NetworkManager.Device.Wireless"
object_path = "/org/freedesktop/NetworkManager/Devices/3" object_path = "/org/freedesktop/NetworkManager/Devices/3"
all_access_points = [
"/org/freedesktop/NetworkManager/AccessPoint/43099",
"/org/freedesktop/NetworkManager/AccessPoint/43100",
]
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def HwAddress(self) -> "s": def HwAddress(self) -> "s":
@ -92,10 +96,7 @@ class DeviceWireless(DBusServiceMock):
@dbus_method() @dbus_method()
def GetAllAccessPoints(self) -> "ao": def GetAllAccessPoints(self) -> "ao":
"""Do GetAllAccessPoints method.""" """Do GetAllAccessPoints method."""
return [ return self.all_access_points
"/org/freedesktop/NetworkManager/AccessPoint/43099",
"/org/freedesktop/NetworkManager/AccessPoint/43100",
]
@dbus_method() @dbus_method()
def RequestScan(self, options: "a{sv}") -> None: def RequestScan(self, options: "a{sv}") -> None:

View File

@ -24,6 +24,7 @@ class NetworkManager(DBusServiceMock):
interface = "org.freedesktop.NetworkManager" interface = "org.freedesktop.NetworkManager"
object_path = "/org/freedesktop/NetworkManager" object_path = "/org/freedesktop/NetworkManager"
version = "1.22.10" version = "1.22.10"
connectivity = 4
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def Devices(self) -> "ao": def Devices(self) -> "ao":
@ -145,7 +146,7 @@ class NetworkManager(DBusServiceMock):
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def Connectivity(self) -> "u": def Connectivity(self) -> "u":
"""Get Connectivity.""" """Get Connectivity."""
return 4 return self.connectivity
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def ConnectivityCheckAvailable(self) -> "b": def ConnectivityCheckAvailable(self) -> "b":
@ -300,7 +301,7 @@ class NetworkManager(DBusServiceMock):
@dbus_method() @dbus_method()
def CheckConnectivity(self) -> "u": def CheckConnectivity(self) -> "u":
"""Do CheckConnectivity method.""" """Do CheckConnectivity method."""
return 4 return self.Connectivity
@dbus_method() @dbus_method()
def state(self) -> "u": def state(self) -> "u":

View File

@ -29,7 +29,12 @@ class OSAgent(DBusServiceMock):
"""Get Version.""" """Get Version."""
return "1.1.0" return "1.1.0"
@dbus_property(access=PropertyAccess.READ) @dbus_property()
def Diagnostics(self) -> "b": def Diagnostics(self) -> "b":
"""Get Diagnostics.""" """Get Diagnostics."""
return True return True
@Diagnostics.setter
def Diagnostics(self, value: "b"):
"""Set Diagnostics."""
self.emit_properties_changed({"Diagnostics": value})

View File

@ -23,6 +23,12 @@ class Systemd(DBusServiceMock):
object_path = "/org/freedesktop/systemd1" object_path = "/org/freedesktop/systemd1"
interface = "org.freedesktop.systemd1.Manager" interface = "org.freedesktop.systemd1.Manager"
log_level = "info"
log_target = "journal-or-kmsg"
runtime_watchdog_usec = 0
reboot_watchdog_usec = 600000000
kexec_watchdog_usec = 0
service_watchdogs = True
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def Version(self) -> "s": def Version(self) -> "s":
@ -229,15 +235,25 @@ class Systemd(DBusServiceMock):
"""Get InitRDUnitsLoadFinishTimestampMonotonic.""" """Get InitRDUnitsLoadFinishTimestampMonotonic."""
return 0 return 0
@dbus_property(access=PropertyAccess.READ) @dbus_property()
def LogLevel(self) -> "s": def LogLevel(self) -> "s":
"""Get LogLevel.""" """Get LogLevel."""
return "info" return self.log_level
@dbus_property(access=PropertyAccess.READ) @LogLevel.setter
def LogLevel(self, value: "s"):
"""Set LogLevel. Does not emit prop change."""
self.log_level = value
@dbus_property()
def LogTarget(self) -> "s": def LogTarget(self) -> "s":
"""Get LogTarget.""" """Get LogTarget."""
return "journal-or-kmsg" return self.log_target
@LogTarget.setter
def LogTarget(self, value: "s"):
"""Set LogTarget. Does not emit prop change."""
self.log_target = value
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def NNames(self) -> "u": def NNames(self) -> "u":
@ -325,25 +341,45 @@ class Systemd(DBusServiceMock):
"""Get DefaultStandardError.""" """Get DefaultStandardError."""
return "journal" return "journal"
@dbus_property(access=PropertyAccess.READ) @dbus_property()
def RuntimeWatchdogUSec(self) -> "t": def RuntimeWatchdogUSec(self) -> "t":
"""Get RuntimeWatchdogUSec.""" """Get RuntimeWatchdogUSec."""
return 0 return self.runtime_watchdog_usec
@dbus_property(access=PropertyAccess.READ) @RuntimeWatchdogUSec.setter
def RuntimeWatchdogUSec(self, value: "t"):
"""Set RuntimeWatchdogUSec. Does not emit prop change."""
self.runtime_watchdog_usec = value
@dbus_property()
def RebootWatchdogUSec(self) -> "t": def RebootWatchdogUSec(self) -> "t":
"""Get RebootWatchdogUSec.""" """Get RebootWatchdogUSec."""
return 600000000 return self.reboot_watchdog_usec
@dbus_property(access=PropertyAccess.READ) @RebootWatchdogUSec.setter
def RebootWatchdogUSec(self, value: "t"):
"""Set RebootWatchdogUSec. Does not emit prop change."""
self.RebootWatchdogUSec = value
@dbus_property()
def KExecWatchdogUSec(self) -> "t": def KExecWatchdogUSec(self) -> "t":
"""Get KExecWatchdogUSec.""" """Get KExecWatchdogUSec."""
return 0 return self.kexec_watchdog_usec
@dbus_property(access=PropertyAccess.READ) @KExecWatchdogUSec.setter
def KExecWatchdogUSec(self, value: "t"):
"""Set KExecWatchdogUSec. Does not emit prop change."""
self.KExecWatchdogUSec = value
@dbus_property()
def ServiceWatchdogs(self) -> "b": def ServiceWatchdogs(self) -> "b":
"""Get ServiceWatchdogs.""" """Get ServiceWatchdogs."""
return True return self.service_watchdogs
@ServiceWatchdogs.setter
def ServiceWatchdogs(self, value: "b"):
"""Set ServiceWatchdogs. Does not emit prop change."""
self.service_watchdogs = value
@dbus_property(access=PropertyAccess.READ) @dbus_property(access=PropertyAccess.READ)
def ControlGroup(self) -> "s": def ControlGroup(self) -> "s":
@ -629,7 +665,7 @@ class Systemd(DBusServiceMock):
return "/org/freedesktop/systemd1/job/7623" return "/org/freedesktop/systemd1/job/7623"
@dbus_method() @dbus_method()
def list_units( def ListUnits(
self, self,
) -> "a(ssssssouso)": ) -> "a(ssssssouso)":
"""Return a list of available services.""" """Return a list of available services."""

View File

@ -1,74 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="de.pengutronix.rauc.Installer">
<method name="Install">
<arg type="s" name="source" direction="in"/>
</method>
<method name="InstallBundle">
<annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/>
<arg type="s" name="source" direction="in"/>
<arg type="a{sv}" name="args" direction="in"/>
</method>
<method name="Info">
<arg type="s" name="bundle" direction="in"/>
<arg type="s" name="compatible" direction="out"/>
<arg type="s" name="version" direction="out"/>
</method>
<method name="Mark">
<arg type="s" name="state" direction="in"/>
<arg type="s" name="slot_identifier" direction="in"/>
<arg type="s" name="slot_name" direction="out"/>
<arg type="s" name="message" direction="out"/>
</method>
<method name="GetSlotStatus">
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="RaucSlotStatusArray"/>
<arg type="a(sa{sv})" name="slot_status_array" direction="out"/>
</method>
<method name="GetPrimary">
<arg type="s" name="primary" direction="out"/>
</method>
<signal name="Completed">
<arg type="i" name="result"/>
</signal>
<property type="s" name="Operation" access="read"/>
<property type="s" name="LastError" access="read"/>
<property type="(isi)" name="Progress" access="read">
<annotation name="org.qtproject.QtDBus.QtTypeName" value="RaucProgress"/>
</property>
<property type="s" name="Compatible" access="read"/>
<property type="s" name="Variant" access="read"/>
<property type="s" name="BootSlot" access="read"/>
</interface>
</node>

View File

@ -1,8 +0,0 @@
{
"Operation": "idle",
"LastError": "",
"Progress": [0, "", 0],
"Compatible": "haos-odroid-n2",
"Variant": "",
"BootSlot": "B"
}

View File

@ -1,108 +0,0 @@
[
[
"kernel.0",
{
"activated.count": 9,
"activated.timestamp": "2022-08-23T21:03:22Z",
"boot-status": "good",
"bundle.compatible": "haos-odroid-n2",
"sha256": "c624db648b8401fae37ee5bb1a6ec90bdf4183aef364b33314a73c7198e49d5b",
"state": "inactive",
"size": 10371072,
"installed.count": 9,
"class": "kernel",
"device": "/dev/disk/by-partlabel/hassos-kernel0",
"type": "raw",
"bootname": "A",
"bundle.version": "9.0.dev20220818",
"installed.timestamp": "2022-08-23T21:03:16Z",
"status": "ok"
}
],
[
"boot.0",
{
"bundle.compatible": "haos-odroid-n2",
"sha256": "a5019b335f33be2cf89c96bb2d0695030adb72c1d13d650a5bbe1806dd76d6cc",
"state": "inactive",
"size": 25165824,
"installed.count": 19,
"class": "boot",
"device": "/dev/disk/by-partlabel/hassos-boot",
"type": "vfat",
"status": "ok",
"bundle.version": "9.0.dev20220824",
"installed.timestamp": "2022-08-25T21:11:46Z"
}
],
[
"rootfs.0",
{
"bundle.compatible": "haos-odroid-n2",
"parent": "kernel.0",
"state": "inactive",
"size": 117456896,
"sha256": "7d908b4d578d072b1b0f75de8250fd97b6e119bff09518a96fffd6e4aec61721",
"class": "rootfs",
"device": "/dev/disk/by-partlabel/hassos-system0",
"type": "raw",
"status": "ok",
"bundle.version": "9.0.dev20220818",
"installed.timestamp": "2022-08-23T21:03:21Z",
"installed.count": 9
}
],
[
"spl.0",
{
"bundle.compatible": "haos-odroid-n2",
"sha256": "9856a94df1d6abbc672adaf95746ec76abd3a8191f9d08288add6bb39e63ef45",
"state": "inactive",
"size": 8388608,
"installed.count": 19,
"class": "spl",
"device": "/dev/disk/by-partlabel/hassos-boot",
"type": "raw",
"status": "ok",
"bundle.version": "9.0.dev20220824",
"installed.timestamp": "2022-08-25T21:11:51Z"
}
],
[
"kernel.1",
{
"activated.count": 10,
"activated.timestamp": "2022-08-25T21:11:52Z",
"boot-status": "good",
"bundle.compatible": "haos-odroid-n2",
"sha256": "f57e354b8bd518022721e71fafaf278972af966d8f6cbefb4610db13785801c8",
"state": "booted",
"size": 10371072,
"installed.count": 10,
"class": "kernel",
"device": "/dev/disk/by-partlabel/hassos-kernel1",
"type": "raw",
"bootname": "B",
"bundle.version": "9.0.dev20220824",
"installed.timestamp": "2022-08-25T21:11:46Z",
"status": "ok"
}
],
[
"rootfs.1",
{
"bundle.compatible": "haos-odroid-n2",
"parent": "kernel.1",
"state": "active",
"size": 117456896,
"sha256": "55936b64d391954ae1aed24dd1460e191e021e78655470051fa7939d12fff68a",
"class": "rootfs",
"device": "/dev/disk/by-partlabel/hassos-system1",
"type": "raw",
"status": "ok",
"bundle.version": "9.0.dev20220824",
"installed.timestamp": "2022-08-25T21:11:51Z",
"installed.count": 10
}
]
]

View File

@ -1 +0,0 @@
["kernel.1", "marked slot kernel.1 as good"]

View File

@ -1 +0,0 @@
{ "Version": "1.1.0", "Diagnostics": true }

View File

@ -1,51 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out">
</arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="out">
</arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="props" type="a{sv}" direction="out">
</arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="in">
</arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out">
</arg>
<arg name="changed_properties" type="a{sv}" direction="out">
</arg>
<arg name="invalidates_properties" type="as" direction="out">
</arg>
</signal>
</interface>
<interface name="io.hass.os">
<property name="Version" type="s" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="invalidates">
</annotation>
</property>
<property name="Diagnostics" type="b" access="readwrite">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true">
</annotation>
</property>
</interface>
</node>

View File

@ -1 +0,0 @@
true

View File

@ -1 +0,0 @@
true

View File

@ -1 +0,0 @@
{ "ParserVersion": "2.13.2" }

View File

@ -1,63 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os/AppArmor">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out">
</arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="out">
</arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="props" type="a{sv}" direction="out">
</arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="in">
</arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out">
</arg>
<arg name="changed_properties" type="a{sv}" direction="out">
</arg>
<arg name="invalidates_properties" type="as" direction="out">
</arg>
</signal>
</interface>
<interface name="io.hass.os.AppArmor">
<method name="LoadProfile">
<arg type="s" direction="in">
</arg>
<arg type="s" direction="in">
</arg>
<arg type="b" direction="out">
</arg>
</method>
<method name="UnloadProfile">
<arg type="s" direction="in">
</arg>
<arg type="s" direction="in">
</arg>
<arg type="b" direction="out">
</arg>
</method>
<property name="ParserVersion" type="s" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="invalidates">
</annotation>
</property>
</interface>
</node>

View File

@ -1,3 +0,0 @@
{
"Board": "Yellow"
}

View File

@ -1,35 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os/Boards">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out"></arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in"></arg>
<arg name="property" type="s" direction="in"></arg>
<arg name="value" type="v" direction="out"></arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in"></arg>
<arg name="props" type="a{sv}" direction="out"></arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in"></arg>
<arg name="property" type="s" direction="in"></arg>
<arg name="value" type="v" direction="in"></arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out"></arg>
<arg name="changed_properties" type="a{sv}" direction="out"></arg>
<arg name="invalidates_properties" type="as" direction="out"></arg>
</signal>
</interface>
<interface name="io.hass.os.Boards">
<property name="Board" type="s" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="invalidates"></annotation>
</property>
</interface>
</node>

View File

@ -1 +0,0 @@
{}

View File

@ -1,31 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os/Boards/Supervised">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out"></arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in"></arg>
<arg name="property" type="s" direction="in"></arg>
<arg name="value" type="v" direction="out"></arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in"></arg>
<arg name="props" type="a{sv}" direction="out"></arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in"></arg>
<arg name="property" type="s" direction="in"></arg>
<arg name="value" type="v" direction="in"></arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out"></arg>
<arg name="changed_properties" type="a{sv}" direction="out"></arg>
<arg name="invalidates_properties" type="as" direction="out"></arg>
</signal>
</interface>
<interface name="io.hass.os.Boards.Supervised"></interface>
</node>

View File

@ -1,5 +0,0 @@
{
"HeartbeatLED": true,
"PowerLED": true,
"DiskLED": true
}

View File

@ -1,41 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os/Boards/Yellow">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out"></arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in"></arg>
<arg name="property" type="s" direction="in"></arg>
<arg name="value" type="v" direction="out"></arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in"></arg>
<arg name="props" type="a{sv}" direction="out"></arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in"></arg>
<arg name="property" type="s" direction="in"></arg>
<arg name="value" type="v" direction="in"></arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out"></arg>
<arg name="changed_properties" type="a{sv}" direction="out"></arg>
<arg name="invalidates_properties" type="as" direction="out"></arg>
</signal>
</interface>
<interface name="io.hass.os.Boards.Yellow">
<property name="HeartbeatLED" type="b" access="readwrite">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"></annotation>
</property>
<property name="PowerLED" type="b" access="readwrite">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"></annotation>
</property>
<property name="DiskLED" type="b" access="readwrite">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"></annotation>
</property>
</interface>
</node>

View File

@ -1 +0,0 @@
true

View File

@ -1,51 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os/CGroup">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out">
</arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="out">
</arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="props" type="a{sv}" direction="out">
</arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="in">
</arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out">
</arg>
<arg name="changed_properties" type="a{sv}" direction="out">
</arg>
<arg name="invalidates_properties" type="as" direction="out">
</arg>
</signal>
</interface>
<interface name="io.hass.os.CGroup">
<method name="AddDevicesAllowed">
<arg type="s" direction="in">
</arg>
<arg type="s" direction="in">
</arg>
<arg type="b" direction="out">
</arg>
</method>
</interface>
</node>

View File

@ -1 +0,0 @@
true

View File

@ -1 +0,0 @@
true

View File

@ -1 +0,0 @@
{ "CurrentDevice": "/dev/sda" }

View File

@ -1,57 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os/DataDisk">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out">
</arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="out">
</arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="props" type="a{sv}" direction="out">
</arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="in">
</arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out">
</arg>
<arg name="changed_properties" type="a{sv}" direction="out">
</arg>
<arg name="invalidates_properties" type="as" direction="out">
</arg>
</signal>
</interface>
<interface name="io.hass.os.DataDisk">
<method name="ChangeDevice">
<arg type="s" direction="in">
</arg>
<arg type="b" direction="out">
</arg>
</method>
<method name="ReloadDevice">
<arg type="b" direction="out">
</arg>
</method>
<property name="CurrentDevice" type="s" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true">
</annotation>
</property>
</interface>
</node>

View File

@ -1 +0,0 @@
true

View File

@ -1,51 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node name="/io/hass/os/System">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="out" type="s" direction="out">
</arg>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="out">
</arg>
</method>
<method name="GetAll">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="props" type="a{sv}" direction="out">
</arg>
</method>
<method name="Set">
<arg name="interface" type="s" direction="in">
</arg>
<arg name="property" type="s" direction="in">
</arg>
<arg name="value" type="v" direction="in">
</arg>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s" direction="out">
</arg>
<arg name="changed_properties" type="a{sv}" direction="out">
</arg>
<arg name="invalidates_properties" type="as" direction="out">
</arg>
</signal>
</interface>
<interface name="io.hass.os.System">
<method name="ScheduleWipeDevice">
<arg type="b" direction="out">
</arg>
</method>
<method name="WipeDevice">
<arg type="b" direction="out">
</arg>
</method>
</interface>
</node>

View File

@ -1 +0,0 @@
"/org/freedesktop/NetworkManager/ActiveConnection/1"

View File

@ -1 +0,0 @@
[ "/org/freedesktop/NetworkManager/Settings/1", "/org/freedesktop/NetworkManager/ActiveConnection/1" ]

View File

@ -1,33 +0,0 @@
{
"Devices": [
"/org/freedesktop/NetworkManager/Devices/1",
"/org/freedesktop/NetworkManager/Devices/3"
],
"AllDevices": [
"/org/freedesktop/NetworkManager/Devices/1",
"/org/freedesktop/NetworkManager/Devices/2",
"/org/freedesktop/NetworkManager/Devices/3"
],
"Checkpoints": [],
"NetworkingEnabled": true,
"WirelessEnabled": true,
"WirelessHardwareEnabled": true,
"WwanEnabled": true,
"WwanHardwareEnabled": true,
"WimaxEnabled": false,
"WimaxHardwareEnabled": false,
"ActiveConnections": ["/org/freedesktop/NetworkManager/ActiveConnection/1"],
"PrimaryConnection": "/org/freedesktop/NetworkManager/ActiveConnection/1",
"PrimaryConnectionType": "802-3-ethernet",
"Metered": 4,
"ActivatingConnection": "/",
"Startup": false,
"Version": "1.22.10",
"Capabilities": [1],
"State": 70,
"Connectivity": 4,
"ConnectivityCheckAvailable": true,
"ConnectivityCheckEnabled": true,
"ConnectivityCheckUri": "http://connectivity-check.ubuntu.com/",
"GlobalDnsConfiguration": {}
}

View File

@ -1,162 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.64.3 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager">
<method name="Reload">
<arg type="u" name="flags" direction="in"/>
</method>
<method name="GetDevices">
<arg type="ao" name="devices" direction="out"/>
</method>
<method name="GetAllDevices">
<arg type="ao" name="devices" direction="out"/>
</method>
<method name="GetDeviceByIpIface">
<arg type="s" name="iface" direction="in"/>
<arg type="o" name="device" direction="out"/>
</method>
<method name="ActivateConnection">
<arg type="o" name="connection" direction="in"/>
<arg type="o" name="device" direction="in"/>
<arg type="o" name="specific_object" direction="in"/>
<arg type="o" name="active_connection" direction="out"/>
</method>
<method name="AddAndActivateConnection">
<arg type="a{sa{sv}}" name="connection" direction="in"/>
<arg type="o" name="device" direction="in"/>
<arg type="o" name="specific_object" direction="in"/>
<arg type="o" name="path" direction="out"/>
<arg type="o" name="active_connection" direction="out"/>
</method>
<method name="AddAndActivateConnection2">
<arg type="a{sa{sv}}" name="connection" direction="in"/>
<arg type="o" name="device" direction="in"/>
<arg type="o" name="specific_object" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="o" name="path" direction="out"/>
<arg type="o" name="active_connection" direction="out"/>
<arg type="a{sv}" name="result" direction="out"/>
</method>
<method name="DeactivateConnection">
<arg type="o" name="active_connection" direction="in"/>
</method>
<method name="Sleep">
<arg type="b" name="sleep" direction="in"/>
</method>
<method name="Enable">
<arg type="b" name="enable" direction="in"/>
</method>
<method name="GetPermissions">
<arg type="a{ss}" name="permissions" direction="out"/>
</method>
<method name="SetLogging">
<arg type="s" name="level" direction="in"/>
<arg type="s" name="domains" direction="in"/>
</method>
<method name="GetLogging">
<arg type="s" name="level" direction="out"/>
<arg type="s" name="domains" direction="out"/>
</method>
<method name="CheckConnectivity">
<arg type="u" name="connectivity" direction="out"/>
</method>
<method name="state">
<arg type="u" name="state" direction="out"/>
</method>
<method name="CheckpointCreate">
<arg type="ao" name="devices" direction="in"/>
<arg type="u" name="rollback_timeout" direction="in"/>
<arg type="u" name="flags" direction="in"/>
<arg type="o" name="checkpoint" direction="out"/>
</method>
<method name="CheckpointDestroy">
<arg type="o" name="checkpoint" direction="in"/>
</method>
<method name="CheckpointRollback">
<arg type="o" name="checkpoint" direction="in"/>
<arg type="a{su}" name="result" direction="out"/>
</method>
<method name="CheckpointAdjustRollbackTimeout">
<arg type="o" name="checkpoint" direction="in"/>
<arg type="u" name="add_timeout" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<signal name="CheckPermissions"/>
<signal name="StateChanged">
<arg type="u" name="state"/>
</signal>
<signal name="DeviceAdded">
<arg type="o" name="device_path"/>
</signal>
<signal name="DeviceRemoved">
<arg type="o" name="device_path"/>
</signal>
<property type="ao" name="Devices" access="read"/>
<property type="ao" name="AllDevices" access="read"/>
<property type="ao" name="Checkpoints" access="read"/>
<property type="b" name="NetworkingEnabled" access="read"/>
<property type="b" name="WirelessEnabled" access="readwrite"/>
<property type="b" name="WirelessHardwareEnabled" access="read"/>
<property type="b" name="WwanEnabled" access="readwrite"/>
<property type="b" name="WwanHardwareEnabled" access="read"/>
<property type="b" name="WimaxEnabled" access="readwrite"/>
<property type="b" name="WimaxHardwareEnabled" access="read"/>
<property type="ao" name="ActiveConnections" access="read"/>
<property type="o" name="PrimaryConnection" access="read"/>
<property type="s" name="PrimaryConnectionType" access="read"/>
<property type="u" name="Metered" access="read"/>
<property type="o" name="ActivatingConnection" access="read"/>
<property type="b" name="Startup" access="read"/>
<property type="s" name="Version" access="read"/>
<property type="u" name="Capabilities" access="read"/>
<property type="u" name="State" access="read"/>
<property type="u" name="Connectivity" access="read"/>
<property type="b" name="ConnectivityCheckAvailable" access="read"/>
<property type="b" name="ConnectivityCheckEnabled" access="readwrite"/>
<property type="s" name="ConnectivityCheckUri" access="read"/>
<property type="a{sv}" name="GlobalDnsConfiguration" access="readwrite"/>
</interface>
<node name="IP4Config"/>
<node name="ActiveConnection"/>
<node name="AgentManager"/>
<node name="Devices"/>
<node name="DHCP4Config"/>
<node name="DnsManager"/>
<node name="IP6Config"/>
<node name="Settings"/>
</node>

View File

@ -1,12 +0,0 @@
{
"Flags": 3,
"WpaFlags": 0,
"RsnFlags": 392,
"Ssid": [85, 80, 67, 52, 56, 49, 52, 52, 54, 54],
"Frequency": 2462,
"HwAddress": "E4:57:40:A9:D7:DE",
"Mode": 2,
"MaxBitrate": 195000,
"Strength": 47,
"LastSeen": 1398776
}

View File

@ -1,12 +0,0 @@
{
"Flags": 1,
"WpaFlags": 0,
"RsnFlags": 392,
"Ssid": [86, 81, 64, 51, 53, 40, 53, 53, 55, 50, 48],
"Frequency": 5660,
"HwAddress": "18:4B:0D:23:A1:9C",
"Mode": 2,
"MaxBitrate": 540000,
"Strength": 63,
"LastSeen": 1398839
}

View File

@ -1,52 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.62.5 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.AccessPoint">
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<property type="u" name="Flags" access="read"/>
<property type="u" name="WpaFlags" access="read"/>
<property type="u" name="RsnFlags" access="read"/>
<property type="ay" name="Ssid" access="read"/>
<property type="u" name="Frequency" access="read"/>
<property type="s" name="HwAddress" access="read"/>
<property type="u" name="Mode" access="read"/>
<property type="u" name="MaxBitrate" access="read"/>
<property type="y" name="Strength" access="read"/>
<property type="i" name="LastSeen" access="read"/>
</interface>
</node>

View File

@ -1,62 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.64.3 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.Connection.Active">
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<signal name="StateChanged">
<arg type="u" name="state"/>
<arg type="u" name="reason"/>
</signal>
<property type="o" name="Connection" access="read"/>
<property type="o" name="SpecificObject" access="read"/>
<property type="s" name="Id" access="read"/>
<property type="s" name="Uuid" access="read"/>
<property type="s" name="Type" access="read"/>
<property type="ao" name="Devices" access="read"/>
<property type="u" name="State" access="read"/>
<property type="u" name="StateFlags" access="read"/>
<property type="b" name="Default" access="read"/>
<property type="o" name="Ip4Config" access="read"/>
<property type="o" name="Dhcp4Config" access="read"/>
<property type="b" name="Default6" access="read"/>
<property type="o" name="Ip6Config" access="read"/>
<property type="o" name="Dhcp6Config" access="read"/>
<property type="b" name="Vpn" access="read"/>
<property type="o" name="Master" access="read"/>
</interface>
</node>

View File

@ -1,18 +0,0 @@
{
"Connection": "/org/freedesktop/NetworkManager/Settings/1",
"SpecificObject": "/",
"Id": "Wired connection 1",
"Uuid": "0c23631e-2118-355c-bbb0-8943229cb0d6",
"Type": "802-3-ethernet",
"Devices": ["/org/freedesktop/NetworkManager/Devices/1"],
"State": 2,
"StateFlags": 92,
"Default": true,
"Ip4Config": "/org/freedesktop/NetworkManager/IP4Config/1",
"Dhcp4Config": "/org/freedesktop/NetworkManager/DHCP4Config/1",
"Default6": false,
"Ip6Config": "/org/freedesktop/NetworkManager/IP6Config/1",
"Dhcp6Config": "/",
"Vpn": false,
"Master": "/"
}

View File

@ -1,31 +0,0 @@
{
"Udi": "/sys/devices/pci0000:00/0000:00:1f.6/net/eth0",
"Interface": "eth0",
"IpInterface": "eth0",
"Driver": "e1000e",
"DriverVersion": "3.2.6-k",
"FirmwareVersion": "0.7-4",
"Capabilities": 3,
"Ip4Address": 2499979456,
"State": 100,
"StateReason": [100, 0],
"ActiveConnection": "/org/freedesktop/NetworkManager/ActiveConnection/1",
"Ip4Config": "/org/freedesktop/NetworkManager/IP4Config/1",
"Dhcp4Config": "/org/freedesktop/NetworkManager/DHCP4Config/1",
"Ip6Config": "/org/freedesktop/NetworkManager/IP6Config/1",
"Dhcp6Config": "/",
"Managed": true,
"Autoconnect": true,
"FirmwareMissing": false,
"NmPluginMissing": false,
"DeviceType": 1,
"AvailableConnections": ["/org/freedesktop/NetworkManager/Settings/1"],
"PhysicalPortId": "",
"Mtu": 1500,
"Metered": 4,
"LldpNeighbors": [],
"Real": true,
"Ip4Connectivity": 4,
"Ip6Connectivity": 3,
"InterfaceFlags": 65539
}

View File

@ -1,30 +0,0 @@
{
"Udi": "/sys/devices/platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/wlan0",
"Interface": "wlan0",
"IpInterface": "",
"Driver": "brcmfmac",
"DriverVersion": "7.45.154",
"FirmwareVersion": "01-4fbe0b04",
"Capabilities": 1,
"Ip4Address": 0,
"State": 30,
"StateReason": [30, 42],
"ActiveConnection": "/",
"Ip4Config": "/",
"Dhcp4Config": "/",
"Ip6Config": "/",
"Dhcp6Config": "/",
"Managed": true,
"Autoconnect": true,
"FirmwareMissing": false,
"NmPluginMissing": false,
"DeviceType": 2,
"AvailableConnections": [],
"PhysicalPortId": "",
"Mtu": 1500,
"Metered": 0,
"LldpNeighbors": [],
"Real": true,
"Ip4Connectivity": 1,
"Ip6Connectivity": 1
}

View File

@ -1,34 +0,0 @@
{
"Udi": "/sys/devices/virtual/net/veth87bd238'",
"Path": "",
"Interface": "veth87bd238",
"IpInterface": "veth87bd238",
"Driver": "veth",
"DriverVersion": "1.0",
"FirmwareVersion": "",
"Capabilities": 7,
"Ip4Address": 0,
"State": 10,
"StateReason": [10, 0],
"ActiveConnection": "/",
"Ip4Config": "/",
"Dhcp4Config": "/",
"Ip6Config": "/",
"Dhcp6Config": "/",
"Managed": false,
"Autoconnect": true,
"FirmwareMissing": false,
"NmPluginMissing": false,
"DeviceType": 20,
"AvailableConnections": [],
"PhysicalPortId": "",
"Mtu": 1500,
"Metered": 0,
"LldpNeighbors": [],
"Real": true,
"Ip4Connectivity": 0,
"Ip6Connectivity": 0,
"InterfaceFlags": 65539,
"HwAddress": "9A:4B:E3:9A:F8:D3",
"Ports": []
}

View File

@ -1,20 +0,0 @@
{
"HwAddress": "EA:3C:50:4C:B8:82",
"PermHwAddress": "DC:A6:32:02:BA:21",
"Mode": 2,
"Bitrate": 0,
"AccessPoints": [
"/org/freedesktop/NetworkManager/AccessPoint/41533",
"/org/freedesktop/NetworkManager/AccessPoint/41534",
"/org/freedesktop/NetworkManager/AccessPoint/41535",
"/org/freedesktop/NetworkManager/AccessPoint/41536",
"/org/freedesktop/NetworkManager/AccessPoint/41537",
"/org/freedesktop/NetworkManager/AccessPoint/41538",
"/org/freedesktop/NetworkManager/AccessPoint/41539",
"/org/freedesktop/NetworkManager/AccessPoint/41540",
"/org/freedesktop/NetworkManager/AccessPoint/41541"
],
"ActiveAccessPoint": "/",
"WirelessCapabilities": 2047,
"LastScan": 1343924585
}

View File

@ -1,4 +0,0 @@
[
"/org/freedesktop/NetworkManager/AccessPoint/43099",
"/org/freedesktop/NetworkManager/AccessPoint/43100"
]

View File

@ -1,120 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.62.5 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.Device.Statistics">
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<property type="u" name="RefreshRateMs" access="readwrite"/>
<property type="t" name="TxBytes" access="read"/>
<property type="t" name="RxBytes" access="read"/>
</interface>
<interface name="org.freedesktop.NetworkManager.Device.Wireless">
<method name="GetAccessPoints">
<arg type="ao" name="access_points" direction="out"/>
</method>
<method name="GetAllAccessPoints">
<arg type="ao" name="access_points" direction="out"/>
</method>
<method name="RequestScan">
<arg type="a{sv}" name="options" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<signal name="AccessPointAdded">
<arg type="o" name="access_point"/>
</signal>
<signal name="AccessPointRemoved">
<arg type="o" name="access_point"/>
</signal>
<property type="s" name="HwAddress" access="read"/>
<property type="s" name="PermHwAddress" access="read"/>
<property type="u" name="Mode" access="read"/>
<property type="u" name="Bitrate" access="read"/>
<property type="ao" name="AccessPoints" access="read"/>
<property type="o" name="ActiveAccessPoint" access="read"/>
<property type="u" name="WirelessCapabilities" access="read"/>
<property type="x" name="LastScan" access="read"/>
</interface>
<interface name="org.freedesktop.NetworkManager.Device">
<method name="Reapply">
<arg type="a{sa{sv}}" name="connection" direction="in"/>
<arg type="t" name="version_id" direction="in"/>
<arg type="u" name="flags" direction="in"/>
</method>
<method name="GetAppliedConnection">
<arg type="u" name="flags" direction="in"/>
<arg type="a{sa{sv}}" name="connection" direction="out"/>
<arg type="t" name="version_id" direction="out"/>
</method>
<method name="Disconnect"/>
<method name="Delete"/>
<signal name="StateChanged">
<arg type="u" name="new_state"/>
<arg type="u" name="old_state"/>
<arg type="u" name="reason"/>
</signal>
<property type="s" name="Udi" access="read"/>
<property type="s" name="Interface" access="read"/>
<property type="s" name="IpInterface" access="read"/>
<property type="s" name="Driver" access="read"/>
<property type="s" name="DriverVersion" access="read"/>
<property type="s" name="FirmwareVersion" access="read"/>
<property type="u" name="Capabilities" access="read"/>
<property type="u" name="Ip4Address" access="read"/>
<property type="u" name="State" access="read"/>
<property type="(uu)" name="StateReason" access="read"/>
<property type="o" name="ActiveConnection" access="read"/>
<property type="o" name="Ip4Config" access="read"/>
<property type="o" name="Dhcp4Config" access="read"/>
<property type="o" name="Ip6Config" access="read"/>
<property type="o" name="Dhcp6Config" access="read"/>
<property type="b" name="Managed" access="readwrite"/>
<property type="b" name="Autoconnect" access="readwrite"/>
<property type="b" name="FirmwareMissing" access="read"/>
<property type="b" name="NmPluginMissing" access="read"/>
<property type="u" name="DeviceType" access="read"/>
<property type="ao" name="AvailableConnections" access="read"/>
<property type="s" name="PhysicalPortId" access="read"/>
<property type="u" name="Mtu" access="read"/>
<property type="u" name="Metered" access="read"/>
<property type="aa{sv}" name="LldpNeighbors" access="read"/>
<property type="b" name="Real" access="read"/>
<property type="u" name="Ip4Connectivity" access="read"/>
<property type="u" name="Ip6Connectivity" access="read"/>
</interface>
</node>

View File

@ -1,13 +0,0 @@
{
"Mode": "default",
"RcManager": "file",
"Configuration": [
{
"nameservers": ["192.168.30.1"],
"domains": ["syshack.ch"],
"interface": "eth0",
"priority": 100,
"vpn": false
}
]
}

View File

@ -1,42 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.64.3 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.DnsManager">
<property type="s" name="Mode" access="read"/>
<property type="s" name="RcManager" access="read"/>
<property type="aa{sv}" name="Configuration" access="read"/>
</interface>
</node>

View File

@ -1,22 +0,0 @@
{
"Addresses": [[2499979456, 24, 16951488]],
"AddressData": [{ "address": "192.168.2.148", "prefix": 24 }],
"Gateway": "192.168.2.1",
"Routes": [
[174272, 24, 0, 100],
[65193, 16, 0, 1000]
],
"RouteData": [
{ "dest": "192.168.2.0", "prefix": 24, "metric": 100 },
{ "dest": "169.254.0.0", "prefix": 16, "metric": 1000 },
{ "dest": "0.0.0.0", "prefix": 0, "next-hop": "192.168.2.1", "metric": 100 }
],
"NameserverData": [{ "address": "192.168.2.2" }],
"Nameservers": [16951488],
"Domains": [],
"Searches": [],
"DnsOptions": [],
"DnsPriority": 100,
"WinsServerData": [],
"WinsServers": []
}

View File

@ -1,55 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.64.3 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.IP4Config">
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<property type="aau" name="Addresses" access="read"/>
<property type="aa{sv}" name="AddressData" access="read"/>
<property type="s" name="Gateway" access="read"/>
<property type="aau" name="Routes" access="read"/>
<property type="aa{sv}" name="RouteData" access="read"/>
<property type="aa{sv}" name="NameserverData" access="read"/>
<property type="au" name="Nameservers" access="read"/>
<property type="as" name="Domains" access="read"/>
<property type="as" name="Searches" access="read"/>
<property type="as" name="DnsOptions" access="read"/>
<property type="i" name="DnsPriority" access="read"/>
<property type="as" name="WinsServerData" access="read"/>
<property type="au" name="WinsServers" access="read"/>
</interface>
</node>

View File

@ -1,115 +0,0 @@
{
"Addresses": [
[
[42, 3, 1, 105, 61, 245, 0, 0, 107, 233, 37, 136, 178, 106, 166, 121],
64,
[254, 128, 0, 0, 0, 0, 0, 0, 218, 88, 215, 255, 254, 0, 256, 105]
],
[
[253, 20, 148, 255, 201, 204, 0, 0, 82, 43, 129, 8, 143, 248, 204, 163],
64,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[42, 3, 1, 105, 61, 245, 0, 0, 0, 0, 0, 0, 0, 0, 2, 241],
128,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[253, 20, 148, 255, 201, 204, 0, 0, 0, 0, 0, 0, 0, 0, 2, 241],
128,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
[
[254, 128, 0, 0, 0, 0, 0, 0, 255, 227, 49, 158, 198, 48, 159, 81],
64,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
]
],
"AddressData": [
{ "address": "2a03:169:3df5:0:6be9:2588:b26a:a679", "prefix": 64 },
{ "address": "fd14:949b:c9cc:0:522b:8108:8ff8:cca3", "prefix": 64 },
{ "address": "2a03:169:3df5::2f1", "prefix": 128 },
{ "address": "fd14:949b:c9cc::2f1", "prefix": 128 },
{ "address": "fe80::ffe3:319e:c630:9f51", "prefix": 64 }
],
"Gateway": "fe80::da58:d7ff:fe00:9c69",
"Routes": [
[
[253, 20, 148, 255, 201, 204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
48,
[254, 128, 0, 0, 0, 0, 0, 0, 218, 88, 215, 255, 254, 0, 256, 105],
100
],
[
[42, 3, 1, 105, 61, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
48,
[254, 128, 0, 0, 0, 0, 0, 0, 218, 88, 215, 255, 254, 0, 256, 105],
100
],
[
[253, 20, 148, 255, 201, 204, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
64,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
100
],
[
[42, 3, 1, 105, 61, 245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
64,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
100
],
[
[42, 3, 1, 105, 61, 245, 0, 0, 0, 0, 0, 0, 0, 0, 2, 241],
128,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
100
],
[
[253, 20, 148, 255, 201, 204, 0, 0, 0, 0, 0, 0, 0, 0, 2, 241],
128,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
100
],
[
[254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
64,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
100
]
],
"RouteData": [
{
"dest": "fd14:949b:c9cc::",
"prefix": 48,
"next-hop": "fe80::da58:d7ff:fe00:9c69",
"metric": 100
},
{
"dest": "2a03:169:3df5::",
"prefix": 48,
"next-hop": "fe80::da58:d7ff:fe00:9c69",
"metric": 100
},
{ "dest": "fd14:949b:c9cc::", "prefix": 64, "metric": 100 },
{ "dest": "2a03:169:3df5::", "prefix": 64, "metric": 100 },
{
"dest": "::",
"prefix": 0,
"next-hop": "fe80::da58:d7ff:fe00:9c69",
"metric": 100
},
{ "dest": "2a03:169:3df5::2f1", "prefix": 128, "metric": 100 },
{ "dest": "fd14:949b:c9cc::2f1", "prefix": 128, "metric": 100 },
{ "dest": "fe80::", "prefix": 64, "metric": 100 },
{ "dest": "ff00::", "prefix": 8, "metric": 256, "table": 255 }
],
"Nameservers": [
[32, 1, 22, 32, 39, 119, 0, 1, 0, 0, 0, 0, 0, 0, 0, 16],
[32, 1, 22, 32, 39, 119, 0, 2, 0, 0, 0, 0, 0, 0, 0, 32]
],
"Domains": [],
"Searches": [],
"DnsOptions": [],
"DnsPriority": 100
}

View File

@ -1,52 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.62.5 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.IP6Config">
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<property type="a(ayuay)" name="Addresses" access="read"/>
<property type="aa{sv}" name="AddressData" access="read"/>
<property type="s" name="Gateway" access="read"/>
<property type="a(ayuayu)" name="Routes" access="read"/>
<property type="aa{sv}" name="RouteData" access="read"/>
<property type="aay" name="Nameservers" access="read"/>
<property type="as" name="Domains" access="read"/>
<property type="as" name="Searches" access="read"/>
<property type="as" name="DnsOptions" access="read"/>
<property type="i" name="DnsPriority" access="read"/>
</interface>
</node>

View File

@ -1 +0,0 @@
"/org/freedesktop/NetworkManager/Settings/1"

View File

@ -1,85 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.62.5 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.Settings">
<method name="ListConnections">
<arg type="ao" name="connections" direction="out"/>
</method>
<method name="GetConnectionByUuid">
<arg type="s" name="uuid" direction="in"/>
<arg type="o" name="connection" direction="out"/>
</method>
<method name="AddConnection">
<arg type="a{sa{sv}}" name="connection" direction="in"/>
<arg type="o" name="path" direction="out"/>
</method>
<method name="AddConnectionUnsaved">
<arg type="a{sa{sv}}" name="connection" direction="in"/>
<arg type="o" name="path" direction="out"/>
</method>
<method name="AddConnection2">
<arg type="a{sa{sv}}" name="settings" direction="in"/>
<arg type="u" name="flags" direction="in"/>
<arg type="a{sv}" name="args" direction="in"/>
<arg type="o" name="path" direction="out"/>
<arg type="a{sv}" name="result" direction="out"/>
</method>
<method name="LoadConnections">
<arg type="as" name="filenames" direction="in"/>
<arg type="b" name="status" direction="out"/>
<arg type="as" name="failures" direction="out"/>
</method>
<method name="ReloadConnections">
<arg type="b" name="status" direction="out"/>
</method>
<method name="SaveHostname">
<arg type="s" name="hostname" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<signal name="NewConnection">
<arg type="o" name="connection"/>
</signal>
<signal name="ConnectionRemoved">
<arg type="o" name="connection"/>
</signal>
<property type="ao" name="Connections" access="read"/>
<property type="s" name="Hostname" access="read"/>
<property type="b" name="CanModify" access="read"/>
</interface>
<node name="1"/>
</node>

View File

@ -1,39 +0,0 @@
{
"connection": {
"id": "Wired connection 1",
"interface-name": "eth0",
"permissions": [],
"timestamp": 1598125548,
"type": "802-3-ethernet",
"uuid": "0c23631e-2118-355c-bbb0-8943229cb0d6"
},
"ipv4": {
"address-data": [{ "address": "192.168.2.148", "prefix": 24 }],
"addresses": [[2483202240, 24, 16951488]],
"dns": [16951488],
"dns-search": [],
"gateway": "192.168.2.1",
"method": "auto",
"route-data": [
{ "dest": "192.168.122.0", "prefix": 24, "next-hop": "10.10.10.1" }
],
"routes": [[8038592, 24, 17435146, 0]]
},
"ipv6": {
"address-data": [],
"addresses": [],
"dns": [],
"dns-search": [],
"method": "auto",
"route-data": [],
"routes": [],
"addr-gen-mode": 0
},
"proxy": {},
"802-3-ethernet": {
"auto-negotiate": false,
"mac-address-blacklist": [],
"s390-options": {}
},
"802-11-wireless": { "ssid": [78, 69, 84, 84] }
}

View File

@ -1,69 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- GDBus 2.64.3 -->
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="out"/>
</method>
<method name="GetAll">
<arg type="s" name="interface_name" direction="in"/>
<arg type="a{sv}" name="properties" direction="out"/>
</method>
<method name="Set">
<arg type="s" name="interface_name" direction="in"/>
<arg type="s" name="property_name" direction="in"/>
<arg type="v" name="value" direction="in"/>
</method>
<signal name="PropertiesChanged">
<arg type="s" name="interface_name"/>
<arg type="a{sv}" name="changed_properties"/>
<arg type="as" name="invalidated_properties"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" name="xml_data" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg type="s" name="machine_uuid" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.NetworkManager.Settings.Connection">
<method name="Update">
<arg type="a{sa{sv}}" name="properties" direction="in"/>
</method>
<method name="UpdateUnsaved">
<arg type="a{sa{sv}}" name="properties" direction="in"/>
</method>
<method name="Delete"/>
<method name="GetSettings">
<arg type="a{sa{sv}}" name="settings" direction="out"/>
</method>
<method name="GetSecrets">
<arg type="s" name="setting_name" direction="in"/>
<arg type="a{sa{sv}}" name="secrets" direction="out"/>
</method>
<method name="ClearSecrets"/>
<method name="Save"/>
<method name="Update2">
<arg type="a{sa{sv}}" name="settings" direction="in"/>
<arg type="u" name="flags" direction="in"/>
<arg type="a{sv}" name="args" direction="in"/>
<arg type="a{sv}" name="result" direction="out"/>
</method>
<signal name="PropertiesChanged">
<arg type="a{sv}" name="properties"/>
</signal>
<signal name="Updated"/>
<signal name="Removed"/>
<property type="b" name="Unsaved" access="read"/>
<property type="u" name="Flags" access="read"/>
<property type="s" name="Filename" access="read"/>
</interface>
</node>

View File

@ -1,27 +0,0 @@
{
"Device": { "_type": "ay", "_value": "/dev/loop0" },
"PreferredDevice": { "_type": "ay", "_value": "/dev/loop0" },
"Symlinks": [],
"DeviceNumber": 1792,
"Id": "",
"Size": 0,
"ReadOnly": false,
"Drive": "/",
"MDRaid": "/",
"MDRaidMember": "/",
"IdUsage": "",
"IdType": "",
"IdVersion": "",
"IdLabel": "",
"IdUUID": "",
"Configuration": [],
"CryptoBackingDevice": "/",
"HintPartitionable": true,
"HintSystem": true,
"HintIgnore": false,
"HintAuto": false,
"HintName": "",
"HintIconName": "",
"HintSymbolicIconName": "",
"UserspaceMountOptions": []
}

View File

@ -1,33 +0,0 @@
{
"Device": { "_type": "ay", "_value": "/dev/mmcblk1" },
"PreferredDevice": { "_type": "ay", "_value": "/dev/mmcblk1" },
"Symlinks": {
"_type": "aay",
"_value": [
"/dev/disk/by-id/mmc-BJTD4R_0x97cde291",
"/dev/disk/by-path/platform-ffe07000.mmc"
]
},
"DeviceNumber": 45824,
"Id": "by-id-mmc-BJTD4R_0x97cde291",
"Size": 31268536320,
"ReadOnly": false,
"Drive": "/org/freedesktop/UDisks2/drives/BJTD4R_0x97cde291",
"MDRaid": "/",
"MDRaidMember": "/",
"IdUsage": "",
"IdType": "",
"IdVersion": "",
"IdLabel": "",
"IdUUID": "",
"Configuration": [],
"CryptoBackingDevice": "/",
"HintPartitionable": true,
"HintSystem": true,
"HintIgnore": false,
"HintAuto": false,
"HintName": "",
"HintIconName": "",
"HintSymbolicIconName": "",
"UserspaceMountOptions": []
}

View File

@ -1,37 +0,0 @@
{
"Device": { "_type": "ay", "_value": "/dev/mmcblk1p1" },
"PreferredDevice": { "_type": "ay", "_value": "/dev/mmcblk1p1" },
"Symlinks": {
"_type": "aay",
"_value": [
"/dev/disk/by-id/mmc-BJTD4R_0x97cde291-part1",
"/dev/disk/by-label/hassos-boot",
"/dev/disk/by-partlabel/hassos-boot",
"/dev/disk/by-partuuid/48617373-01",
"/dev/disk/by-path/platform-ffe07000.mmc-part1",
"/dev/disk/by-uuid/16DD-EED4"
]
},
"DeviceNumber": 45825,
"Id": "by-id-mmc-BJTD4R_0x97cde291-part1",
"Size": 25165824,
"ReadOnly": false,
"Drive": "/org/freedesktop/UDisks2/drives/BJTD4R_0x97cde291",
"MDRaid": "/",
"MDRaidMember": "/",
"IdUsage": "filesystem",
"IdType": "vfat",
"IdVersion": "FAT16",
"IdLabel": "hassos-boot",
"IdUUID": "16DD-EED4",
"Configuration": [],
"CryptoBackingDevice": "/",
"HintPartitionable": true,
"HintSystem": true,
"HintIgnore": false,
"HintAuto": false,
"HintName": "",
"HintIconName": "",
"HintSymbolicIconName": "",
"UserspaceMountOptions": []
}

View File

@ -1,34 +0,0 @@
{
"Device": { "_type": "ay", "_value": "/dev/mmcblk1p2" },
"PreferredDevice": { "_type": "ay", "_value": "/dev/mmcblk1p2" },
"Symlinks": {
"_type": "aay",
"_value": [
"/dev/disk/by-id/mmc-BJTD4R_0x97cde291-part2",
"/dev/disk/by-partuuid/48617373-02",
"/dev/disk/by-path/platform-ffe07000.mmc-part2"
]
},
"DeviceNumber": 45826,
"Id": "by-id-mmc-BJTD4R_0x97cde291-part2",
"Size": 1024,
"ReadOnly": false,
"Drive": "/org/freedesktop/UDisks2/drives/BJTD4R_0x97cde291",
"MDRaid": "/",
"MDRaidMember": "/",
"IdUsage": "",
"IdType": "",
"IdVersion": "",
"IdLabel": "",
"IdUUID": "",
"Configuration": [],
"CryptoBackingDevice": "/",
"HintPartitionable": true,
"HintSystem": true,
"HintIgnore": false,
"HintAuto": false,
"HintName": "",
"HintIconName": "",
"HintSymbolicIconName": "",
"UserspaceMountOptions": []
}

View File

@ -1,36 +0,0 @@
{
"Device": { "_type": "ay", "_value": "/dev/mmcblk1p3" },
"PreferredDevice": { "_type": "ay", "_value": "/dev/mmcblk1p3" },
"Symlinks": {
"_type": "aay",
"_value": [
"/dev/disk/by-id/mmc-BJTD4R_0x97cde291-part3",
"/dev/disk/by-label/hassos-overlay",
"/dev/disk/by-partuuid/48617373-03",
"/dev/disk/by-path/platform-ffe07000.mmc-part3",
"/dev/disk/by-uuid/0cd0d026-8c69-484e-bbf1-8197019fa7df"
]
},
"DeviceNumber": 45827,
"Id": "by-id-mmc-BJTD4R_0x97cde291-part3",
"Size": 100663296,
"ReadOnly": false,
"Drive": "/org/freedesktop/UDisks2/drives/BJTD4R_0x97cde291",
"MDRaid": "/",
"MDRaidMember": "/",
"IdUsage": "filesystem",
"IdType": "ext4",
"IdVersion": "1.0",
"IdLabel": "hassos-overlay",
"IdUUID": "0cd0d026-8c69-484e-bbf1-8197019fa7df",
"Configuration": [],
"CryptoBackingDevice": "/",
"HintPartitionable": true,
"HintSystem": true,
"HintIgnore": false,
"HintAuto": false,
"HintName": "",
"HintIconName": "",
"HintSymbolicIconName": "",
"UserspaceMountOptions": []
}

View File

@ -1,39 +0,0 @@
{
"Device": {
"_type": "ay",
"_value": "/dev/sda"
},
"PreferredDevice": {
"_type": "ay",
"_value": "/dev/sda"
},
"Symlinks": {
"_type": "aay",
"_value": [
"/dev/disk/by-id/usb-SSK_SSK_Storage_DF56419883D56-0:0",
"/dev/disk/by-path/platform-xhci-hcd.1.auto-usb-0:1.4:1.0-scsi-0:0:0:0"
]
},
"DeviceNumber": 2048,
"Id": "by-id-usb-SSK_SSK_Storage_DF56419883D56-0:0",
"Size": 250059350016,
"ReadOnly": false,
"Drive": "/org/freedesktop/UDisks2/drives/SSK_SSK_Storage_DF56419883D56",
"MDRaid": "/",
"MDRaidMember": "/",
"IdUsage": "",
"IdType": "",
"IdVersion": "",
"IdLabel": "",
"IdUUID": "",
"Configuration": [],
"CryptoBackingDevice": "/",
"HintPartitionable": true,
"HintSystem": false,
"HintIgnore": false,
"HintAuto": true,
"HintName": "",
"HintIconName": "",
"HintSymbolicIconName": "",
"UserspaceMountOptions": []
}

View File

@ -1,37 +0,0 @@
{
"Device": { "_type": "ay", "_value": "/dev/sda1" },
"PreferredDevice": { "_type": "ay", "_value": "/dev/sda1" },
"Symlinks": {
"_type": "aay",
"_value": [
"/dev/disk/by-id/usb-SSK_SSK_Storage_DF56419883D56-0:0-part1",
"/dev/disk/by-label/hassos-data",
"/dev/disk/by-partlabel/hassos-data-external",
"/dev/disk/by-partuuid/6f3f99f4-4d34-476b-b051-77886da57fa9",
"/dev/disk/by-path/platform-xhci-hcd.1.auto-usb-0:1.4:1.0-scsi-0:0:0:0-part1",
"/dev/disk/by-uuid/b82b23cb-0c47-4bbb-acf5-2a2afa8894a2"
]
},
"DeviceNumber": 2049,
"Id": "by-id-usb-SSK_SSK_Storage_DF56419883D56-0:0-part1",
"Size": 250058113024,
"ReadOnly": false,
"Drive": "/org/freedesktop/UDisks2/drives/SSK_SSK_Storage_DF56419883D56",
"MDRaid": "/",
"MDRaidMember": "/",
"IdUsage": "filesystem",
"IdType": "ext4",
"IdVersion": "1.0",
"IdLabel": "hassos-data",
"IdUUID": "b82b23cb-0c47-4bbb-acf5-2a2afa8894a2",
"Configuration": [],
"CryptoBackingDevice": "/",
"HintPartitionable": true,
"HintSystem": false,
"HintIgnore": false,
"HintAuto": true,
"HintName": "",
"HintIconName": "",
"HintSymbolicIconName": "",
"UserspaceMountOptions": []
}

Some files were not shown because too many files have changed in this diff Show More