Exemple #1
0
async def test_interface_update_payload_ethernet_ipv6(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)
    inet = coresys.dbus.network.interfaces[TEST_INTERFACE]

    interface.ipv6.method = InterfaceMethod.STATIC
    interface.ipv6.address = [ip_interface("2a03:169:3df5:0:6be9:2588:b26a:a679/64")]
    interface.ipv6.nameservers = [
        ip_address("2606:4700:4700::64"),
        ip_address("2606:4700:4700::6400"),
    ]
    interface.ipv6.gateway = ip_address("fe80::da58:d7ff:fe00:9c69")

    data = interface_update_payload(
        interface,
        name=inet.settings.connection.id,
        uuid=inet.settings.connection.uuid,
    )
    assert DBus.parse_gvariant(data)["ipv6"]["method"] == "manual"
    assert (
        DBus.parse_gvariant(data)["ipv6"]["address-data"][0]["address"]
        == "2a03:169:3df5:0:6be9:2588:b26a:a679"
    )
    assert DBus.parse_gvariant(data)["ipv6"]["address-data"][0]["prefix"] == 64
    assert DBus.parse_gvariant(data)["ipv6"]["dns"] == [
        50543257694033307102031451402929176676,
        50543257694033307102031451402929202176,
    ]
    assert (
        DBus.parse_gvariant(data)["connection"]["uuid"] == inet.settings.connection.uuid
    )
    assert DBus.parse_gvariant(data)["connection"]["id"] == inet.settings.connection.id
    assert DBus.parse_gvariant(data)["connection"]["type"] == "802-3-ethernet"
    assert DBus.parse_gvariant(data)["connection"]["interface-name"] == interface.name
    assert DBus.parse_gvariant(data)["ipv6"]["gateway"] == "fe80::da58:d7ff:fe00:9c69"
async def test_interface_update_payload_ethernet_ipv4(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)
    inet = coresys.dbus.network.interfaces[TEST_INTERFACE]

    interface.ipv4.method = InterfaceMethod.STATIC
    interface.ipv4.address = [ip_interface("192.168.1.1/24")]
    interface.ipv4.nameservers = [ip_address("1.1.1.1"), ip_address("1.0.1.1")]
    interface.ipv4.gateway = ip_address("192.168.1.1")

    data = interface_update_payload(
        interface,
        name=inet.settings.connection.id,
        uuid=inet.settings.connection.uuid,
    )
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "manual"
    assert (DBus.parse_gvariant(data)["ipv4"]["address-data"][0]["address"] ==
            "192.168.1.1")
    assert DBus.parse_gvariant(data)["ipv4"]["address-data"][0]["prefix"] == 24
    assert DBus.parse_gvariant(data)["ipv4"]["dns"] == [16843009, 16842753]
    assert (DBus.parse_gvariant(data)["connection"]["uuid"] ==
            inet.settings.connection.uuid)
    assert DBus.parse_gvariant(data)["connection"]["id"] == "Supervisor eth0"
    assert DBus.parse_gvariant(data)["connection"]["type"] == "802-3-ethernet"
    assert DBus.parse_gvariant(
        data)["connection"]["interface-name"] == interface.name
    assert DBus.parse_gvariant(data)["ipv4"]["gateway"] == "192.168.1.1"
async def test_interface_update_payload(network_interface):
    """Test interface update payload."""
    data = interface_update_payload(network_interface, **{"method": "auto"})
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "auto"

    data = interface_update_payload(
        network_interface, **{"address": "1.1.1.1", "dns": ["1.1.1.1", "1.0.0.1"]}
    )
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "manual"
    assert DBus.parse_gvariant(data)["ipv4"]["address-data"][0]["address"] == "1.1.1.1"
    assert DBus.parse_gvariant(data)["ipv4"]["dns"] == [16843009, 16777217]
async def test_interface_update_payload_ethernet(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)

    data = interface_update_payload(interface)
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "auto"
    assert DBus.parse_gvariant(data)["ipv6"]["method"] == "auto"

    assert (DBus.parse_gvariant(data)["802-3-ethernet"]["assigned-mac-address"]
            == "preserve")

    assert DBus.parse_gvariant(data)["connection"]["mdns"] == 2
    assert DBus.parse_gvariant(data)["connection"]["llmnr"] == 2
def test_systemd_unitlist_complex():
    """Test Systemd Unit list simple."""
    raw = "([('systemd-remount-fs.service', 'Remount Root and \"Kernel File Systems\"', 'loaded', 'active', 'exited', '', objectpath '/org/freedesktop/systemd1/unit/systemd_2dremount_2dfs_2eservice', uint32 0, '', objectpath '/'), ('sys-subsystem-net-devices-veth5714b4e.device', '/sys/subsystem/net/devices/veth5714b4e for \" is', 'loaded', 'active', 'plugged', '', '/org/freedesktop/systemd1/unit/sys_2dsubsystem_2dnet_2ddevices_2dveth5714b4e_2edevice', 0, '', '/')],)"

    # parse data
    data = DBus.parse_gvariant(raw)

    assert data == [[
        [
            "systemd-remount-fs.service",
            'Remount Root and "Kernel File Systems"',
            "loaded",
            "active",
            "exited",
            "",
            "/org/freedesktop/systemd1/unit/systemd_2dremount_2dfs_2eservice",
            0,
            "",
            "/",
        ],
        [
            "sys-subsystem-net-devices-veth5714b4e.device",
            '/sys/subsystem/net/devices/veth5714b4e for " is',
            "loaded",
            "active",
            "plugged",
            "",
            "/org/freedesktop/systemd1/unit/sys_2dsubsystem_2dnet_2ddevices_2dveth5714b4e_2edevice",
            0,
            "",
            "/",
        ],
    ]]
Exemple #6
0
async def test_interface_update_payload_ethernet(network_interface):
    """Test interface update payload."""
    data = interface_update_payload(network_interface, **{"method": "auto"})
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "auto"

    data = interface_update_payload(
        network_interface, **{
            "address": "1.1.1.1",
            "dns": ["1.1.1.1", "1.0.0.1"]
        })
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "manual"
    assert DBus.parse_gvariant(
        data)["ipv4"]["address-data"][0]["address"] == "1.1.1.1"
    assert DBus.parse_gvariant(data)["ipv4"]["dns"] == [16843009, 16777217]
    assert (DBus.parse_gvariant(data)["connection"]["uuid"] ==
            "0c23631e-2118-355c-bbb0-8943229cb0d6")
Exemple #7
0
async def test_interface_update_payload_wireless(network_interface):
    """Test interface update payload."""
    network_interface.connection._properties["Type"] = ConnectionType.WIRELESS
    data = interface_update_payload(network_interface, **{"method": "auto"})
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "auto"

    data = interface_update_payload(
        network_interface, **{
            "address": "1.1.1.1",
            "dns": ["1.1.1.1", "1.0.0.1"]
        })
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "manual"
    assert DBus.parse_gvariant(
        data)["ipv4"]["address-data"][0]["address"] == "1.1.1.1"
    assert DBus.parse_gvariant(data)["802-11-wireless"]["ssid"] == [
        78, 69, 84, 84
    ]
def test_networkmanager_dns_properties_empty():
    """Test NetworkManager DNS properties."""
    raw = "({'Mode': <'default'>, 'RcManager': <'resolvconf'>, 'Configuration': <@aa{sv} []>},)"

    # parse data
    data = DBus.parse_gvariant(raw)

    assert data == [{"Mode": "default", "RcManager": "resolvconf", "Configuration": []}]
def test_simple_return():
    """Test Simple return value."""
    raw = "(objectpath '/org/freedesktop/systemd1/job/35383',)"

    # parse data
    data = DBus.parse_gvariant(raw)

    assert data == ["/org/freedesktop/systemd1/job/35383"]
Exemple #10
0
async def test_interface_update_payload_wireless_open(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)

    interface.type = InterfaceType.WIRELESS
    interface.wifi = WifiConfig(
        WifiMode.INFRASTRUCTURE, "Test", AuthMethod.OPEN, None, 0
    )

    data = interface_update_payload(interface)

    assert DBus.parse_gvariant(data)["connection"]["type"] == "802-11-wireless"
    assert DBus.parse_gvariant(data)["802-11-wireless"]["ssid"] == [84, 101, 115, 116]
    assert DBus.parse_gvariant(data)["802-11-wireless"]["mode"] == "infrastructure"
    assert (
        DBus.parse_gvariant(data)["802-11-wireless"]["assigned-mac-address"] == "stable"
    )
    assert "802-11-wireless-security" not in DBus.parse_gvariant(data)
async def test_interface_update_payload_ethernet_ipv6_auto(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)
    inet = coresys.dbus.network.interfaces[TEST_INTERFACE]

    interface.ipv6.method = InterfaceMethod.AUTO
    data = interface_update_payload(
        interface,
        name=inet.settings.connection.id,
        uuid=inet.settings.connection.uuid,
    )
    assert DBus.parse_gvariant(data)["ipv6"]["method"] == "auto"
    assert (DBus.parse_gvariant(data)["connection"]["uuid"] ==
            inet.settings.connection.uuid)
    assert DBus.parse_gvariant(data)["connection"]["id"] == "Supervisor eth0"
    assert DBus.parse_gvariant(data)["connection"]["type"] == "802-3-ethernet"
    assert DBus.parse_gvariant(
        data)["connection"]["interface-name"] == interface.name
Exemple #12
0
async def test_interface_update_payload_ethernet_ipv4_disabled(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)
    inet = coresys.dbus.network.interfaces[TEST_INTERFACE]

    interface.ipv4.method = InterfaceMethod.DISABLED

    data = interface_update_payload(
        interface,
        name=inet.settings.connection.id,
        uuid=inet.settings.connection.uuid,
    )
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "disabled"
    assert (
        DBus.parse_gvariant(data)["connection"]["uuid"] == inet.settings.connection.uuid
    )
    assert DBus.parse_gvariant(data)["connection"]["id"] == inet.settings.connection.id
    assert DBus.parse_gvariant(data)["connection"]["type"] == "802-3-ethernet"
    assert DBus.parse_gvariant(data)["connection"]["interface-name"] == interface.name
def test_v6():
    """Test IPv6 Property."""
    raw = "({'addresses': <[([byte 0x20, 0x01, 0x04, 0x70, 0x79, 0x2d, 0x00, 0x01, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10], uint32 64, [byte 0x20, 0x01, 0x04, 0x70, 0x79, 0x2d, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])]>, 'dns': <[[byte 0x20, 0x01, 0x04, 0x70, 0x79, 0x2d, 0x00, 0x01, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05]]>})"

    data = DBus.parse_gvariant(raw)

    assert data == [{
        "addresses": [[
            [32, 1, 4, 112, 121, 45, 0, 1, 0, 18, 0, 0, 0, 0, 0, 16],
            64,
            [32, 1, 4, 112, 121, 45, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1],
        ]],
        "dns": [[32, 1, 4, 112, 121, 45, 0, 1, 0, 18, 0, 0, 0, 0, 0, 5]],
    }]
def test_networkmanager_binary_string_data():
    """Test NetworkManager Binary string datastrings."""
    raw = "({'802-11-wireless': {'mac-address-blacklist': <@as []>, 'mac-address': <b'*~_\\\\035\\\\311'>, 'mode': <'infrastructure'>, 'security': <'802-11-wireless-security'>, 'seen-bssids': <['7C:2E:BD:98:1B:06']>, 'ssid': <[byte 0x4e, 0x45, 0x54, 0x54]>}, 'connection': {'id': <'NETT'>, 'interface-name': <'wlan0'>, 'permissions': <@as []>, 'timestamp': <uint64 1598526799>, 'type': <'802-11-wireless'>, 'uuid': <'13f9af79-a6e9-4e07-9353-165ad57bf1a8'>}, 'ipv6': {'address-data': <@aa{sv} []>, 'addresses': <@a(ayuay) []>, 'dns': <@aay []>, 'dns-search': <@as []>, 'method': <'auto'>, 'route-data': <@aa{sv} []>, 'routes': <@a(ayuayu) []>}, '802-11-wireless-security': {'auth-alg': <'open'>, 'key-mgmt': <'wpa-psk'>}, 'ipv4': {'address-data': <@aa{sv} []>, 'addresses': <@aau []>, 'dns': <@au []>, 'dns-search': <@as []>, 'method': <'auto'>, 'route-data': <@aa{sv} []>, 'routes': <@aau []>}, 'proxy': {}},)"

    data = DBus.parse_gvariant(raw)

    assert data == [{
        "802-11-wireless": {
            "mac-address": [42, 126, 95, 29, 195, 137],
            "mac-address-blacklist": [],
            "mode": "infrastructure",
            "security": "802-11-wireless-security",
            "seen-bssids": ["7C:2E:BD:98:1B:06"],
            "ssid": [78, 69, 84, 84],
        },
        "802-11-wireless-security": {
            "auth-alg": "open",
            "key-mgmt": "wpa-psk"
        },
        "connection": {
            "id": "NETT",
            "interface-name": "wlan0",
            "permissions": [],
            "timestamp": 1598526799,
            "type": "802-11-wireless",
            "uuid": "13f9af79-a6e9-4e07-9353-165ad57bf1a8",
        },
        "ipv4": {
            "address-data": [],
            "addresses": [],
            "dns": [],
            "dns-search": [],
            "method": "auto",
            "route-data": [],
            "routes": [],
        },
        "ipv6": {
            "address-data": [],
            "addresses": [],
            "dns": [],
            "dns-search": [],
            "method": "auto",
            "route-data": [],
            "routes": [],
        },
        "proxy": {},
    }]
def test_single_byte():
    """Test a singlebyte response."""
    raw = "({'Flags': <uint32 1>, 'WpaFlags': <uint32 0>, 'RsnFlags': <uint32 392>, 'Ssid': <[byte 0x53, 0x59, 0x53, 0x48, 0x41, 0x43, 0x4b, 0x5f, 0x48, 0x6f, 0x6d, 0x65]>, 'Frequency': <uint32 5660>, 'HwAddress': <'18:4B:0D:A3:A1:9C'>, 'Mode': <uint32 2>, 'MaxBitrate': <uint32 540000>, 'Strength': <byte 0x2c>, 'LastSeen': <1646569>},)"

    data = DBus.parse_gvariant(raw)

    assert data == [{
        "Flags": 1,
        "Frequency": 5660,
        "HwAddress": "18:4B:0D:A3:A1:9C",
        "LastSeen": 1646569,
        "MaxBitrate": 540000,
        "Mode": 2,
        "RsnFlags": 392,
        "Ssid": [83, 89, 83, 72, 65, 67, 75, 95, 72, 111, 109, 101],
        "Strength": [44],
        "WpaFlags": 0,
    }]
async def test_interface_update_payload_vlan(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)

    interface.type = InterfaceType.VLAN
    interface.vlan = VlanConfig(10, interface.name)

    data = interface_update_payload(interface)
    assert DBus.parse_gvariant(data)["ipv4"]["method"] == "auto"
    assert DBus.parse_gvariant(data)["ipv6"]["method"] == "auto"

    assert DBus.parse_gvariant(data)["vlan"]["id"] == 10
    assert DBus.parse_gvariant(data)["vlan"]["parent"] == interface.name
    assert DBus.parse_gvariant(data)["connection"]["type"] == "vlan"
    assert DBus.parse_gvariant(
        data)["connection"]["id"] == "Supervisor eth0.10"
    assert "interface-name" not in DBus.parse_gvariant(data)["connection"]
Exemple #17
0
def dbus() -> DBus:
    """Mock DBUS."""

    async def mock_get_properties(_, interface):
        return load_json_fixture(f"{interface.replace('.', '_')}.json")

    async def mock_send(_, command):
        filetype = "xml" if "--xml" in command else "fixture"
        fixture = f"{command[6].replace('/', '_')[1:]}.{filetype}"
        return load_fixture(fixture)

    with patch("supervisor.utils.gdbus.DBus._send", new=mock_send), patch(
        "supervisor.dbus.interface.DBusInterface.is_connected",
        return_value=True,
    ), patch("supervisor.utils.gdbus.DBus.get_properties", new=mock_get_properties):

        dbus_obj = DBus(DBUS_NAME_NM, DBUS_OBJECT_BASE)

        yield dbus_obj
def test_networkmanager_dns_properties():
    """Test NetworkManager DNS properties."""
    raw = "({'Mode': <'default'>, 'RcManager': <'file'>, 'Configuration': <[{'nameservers': <['192.168.23.30']>, 'domains': <['syshack.local']>, 'interface': <'eth0'>, 'priority': <100>, 'vpn': <false>}]>},)"

    # parse data
    data = DBus.parse_gvariant(raw)

    assert data == [{
        "Mode":
        "default",
        "RcManager":
        "file",
        "Configuration": [{
            "nameservers": ["192.168.23.30"],
            "domains": ["syshack.local"],
            "interface": "eth0",
            "priority": 100,
            "vpn": False,
        }],
    }]
def test_get_property():
    """Test Property parsing."""
    raw = "({'Hostname': <'hassio'>, 'StaticHostname': <'hassio'>, 'PrettyHostname': <''>, 'IconName': <'computer-embedded'>, 'Chassis': <'embedded'>, 'Deployment': <'production'>, 'Location': <''>, 'KernelName': <'Linux'>, 'KernelRelease': <'4.14.98-v7'>, 'KernelVersion': <'#1 SMP Sat May 11 02:17:06 UTC 2019'>, 'OperatingSystemPrettyName': <'HassOS 2.12'>, 'OperatingSystemCPEName': <'cpe:2.3:o:home_assistant:hassos:2.12:*:production:*:*:*:rpi3:*'>, 'HomeURL': <'https://hass.io/'>},)"

    # parse data
    data = DBus.parse_gvariant(raw)

    assert data[0] == {
        "Hostname": "hassio",
        "StaticHostname": "hassio",
        "PrettyHostname": "",
        "IconName": "computer-embedded",
        "Chassis": "embedded",
        "Deployment": "production",
        "Location": "",
        "KernelName": "Linux",
        "KernelRelease": "4.14.98-v7",
        "KernelVersion": "#1 SMP Sat May 11 02:17:06 UTC 2019",
        "OperatingSystemPrettyName": "HassOS 2.12",
        "OperatingSystemCPEName": "cpe:2.3:o:home_assistant:hassos:2.12:*:production:*:*:*:rpi3:*",
        "HomeURL": "https://hass.io/",
    }
Exemple #20
0
async def test_interface_update_payload_wireless_web(coresys):
    """Test interface update payload."""
    interface = coresys.host.network.get(TEST_INTERFACE)

    interface.type = InterfaceType.WIRELESS
    interface.wifi = WifiConfig(
        WifiMode.INFRASTRUCTURE, "Test", AuthMethod.WEP, "password", 0
    )

    data = interface_update_payload(interface)

    assert DBus.parse_gvariant(data)["connection"]["type"] == "802-11-wireless"
    assert DBus.parse_gvariant(data)["802-11-wireless"]["ssid"] == [84, 101, 115, 116]
    assert DBus.parse_gvariant(data)["802-11-wireless"]["mode"] == "infrastructure"

    assert DBus.parse_gvariant(data)["802-11-wireless-security"]["auth-alg"] == "none"
    assert DBus.parse_gvariant(data)["802-11-wireless-security"]["key-mgmt"] == "none"
    assert DBus.parse_gvariant(data)["802-11-wireless-security"]["psk"] == "password"
def test_systemd_unitlist_simple():
    """Test Systemd Unit list simple."""
    raw = "([('systemd-remount-fs.service', 'Remount Root and Kernel File Systems', 'loaded', 'active', 'exited', '', objectpath '/org/freedesktop/systemd1/unit/systemd_2dremount_2dfs_2eservice', uint32 0, '', objectpath '/'), ('sys-subsystem-net-devices-veth5714b4e.device', '/sys/subsystem/net/devices/veth5714b4e', 'loaded', 'active', 'plugged', '', '/org/freedesktop/systemd1/unit/sys_2dsubsystem_2dnet_2ddevices_2dveth5714b4e_2edevice', 0, '', '/'), ('rauc.service', 'Rauc Update Service', 'loaded', 'active', 'running', '', '/org/freedesktop/systemd1/unit/rauc_2eservice', 0, '', '/'), ('mnt-data-docker-overlay2-7493c48dd99ab0e68420e3317d93711630dd55a76d4f2a21863a220031203ac2-merged.mount', '/mnt/data/docker/overlay2/7493c48dd99ab0e68420e3317d93711630dd55a76d4f2a21863a220031203ac2/merged', 'loaded', 'active', 'mounted', '', '/org/freedesktop/systemd1/unit/mnt_2ddata_2ddocker_2doverlay2_2d7493c48dd99ab0e68420e3317d93711630dd55a76d4f2a21863a220031203ac2_2dmerged_2emount', 0, '', '/'), ('hassos-hardware.target', 'HassOS hardware targets', 'loaded', 'active', 'active', '', '/org/freedesktop/systemd1/unit/hassos_2dhardware_2etarget', 0, '', '/'), ('dev-zram1.device', '/dev/zram1', 'loaded', 'active', 'plugged', 'sys-devices-virtual-block-zram1.device', '/org/freedesktop/systemd1/unit/dev_2dzram1_2edevice', 0, '', '/'), ('sys-subsystem-net-devices-hassio.device', '/sys/subsystem/net/devices/hassio', 'loaded', 'active', 'plugged', '', '/org/freedesktop/systemd1/unit/sys_2dsubsystem_2dnet_2ddevices_2dhassio_2edevice', 0, '', '/'), ('cryptsetup.target', 'cryptsetup.target', 'not-found', 'inactive', 'dead', '', '/org/freedesktop/systemd1/unit/cryptsetup_2etarget', 0, '', '/'), ('sys-devices-virtual-net-vethd256dfa.device', '/sys/devices/virtual/net/vethd256dfa', 'loaded', 'active', 'plugged', '', '/org/freedesktop/systemd1/unit/sys_2ddevices_2dvirtual_2dnet_2dvethd256dfa_2edevice', 0, '', '/'), ('network-pre.target', 'Network (Pre)', 'loaded', 'inactive', 'dead', '', '/org/freedesktop/systemd1/unit/network_2dpre_2etarget', 0, '', '/'), ('sys-devices-virtual-net-veth5714b4e.device', '/sys/devices/virtual/net/veth5714b4e', 'loaded', 'active', 'plugged', '', '/org/freedesktop/systemd1/unit/sys_2ddevices_2dvirtual_2dnet_2dveth5714b4e_2edevice', 0, '', '/'), ('sys-kernel-debug.mount', 'Kernel Debug File System', 'loaded', 'active', 'mounted', '', '/org/freedesktop/systemd1/unit/sys_2dkernel_2ddebug_2emount', 0, '', '/'), ('slices.target', 'Slices', 'loaded', 'active', 'active', '', '/org/freedesktop/systemd1/unit/slices_2etarget', 0, '', '/'), ('etc-NetworkManager-system\x2dconnections.mount', 'NetworkManager persistent system connections', 'loaded', 'active', 'mounted', '', '/org/freedesktop/systemd1/unit/etc_2dNetworkManager_2dsystem_5cx2dconnections_2emount', 0, '', '/'), ('run-docker-netns-26ede3178729.mount', '/run/docker/netns/26ede3178729', 'loaded', 'active', 'mounted', '', '/org/freedesktop/systemd1/unit/run_2ddocker_2dnetns_2d26ede3178729_2emount', 0, '', '/'), ('dev-disk-by\x2dpath-platform\x2d3f202000.mmc\x2dpart2.device', '/dev/disk/by-path/platform-3f202000.mmc-part2', 'loaded', 'active', 'plugged', 'sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:e624-block-mmcblk0-mmcblk0p2.device', '/org/freedesktop/systemd1/unit/dev_2ddisk_2dby_5cx2dpath_2dplatform_5cx2d3f202000_2emmc_5cx2dpart2_2edevice', 0, '', '/')],)"

    # parse data
    data = DBus.parse_gvariant(raw)

    assert data == [[
        [
            "systemd-remount-fs.service",
            "Remount Root and Kernel File Systems",
            "loaded",
            "active",
            "exited",
            "",
            "/org/freedesktop/systemd1/unit/systemd_2dremount_2dfs_2eservice",
            0,
            "",
            "/",
        ],
        [
            "sys-subsystem-net-devices-veth5714b4e.device",
            "/sys/subsystem/net/devices/veth5714b4e",
            "loaded",
            "active",
            "plugged",
            "",
            "/org/freedesktop/systemd1/unit/sys_2dsubsystem_2dnet_2ddevices_2dveth5714b4e_2edevice",
            0,
            "",
            "/",
        ],
        [
            "rauc.service",
            "Rauc Update Service",
            "loaded",
            "active",
            "running",
            "",
            "/org/freedesktop/systemd1/unit/rauc_2eservice",
            0,
            "",
            "/",
        ],
        [
            "mnt-data-docker-overlay2-7493c48dd99ab0e68420e3317d93711630dd55a76d4f2a21863a220031203ac2-merged.mount",
            "/mnt/data/docker/overlay2/7493c48dd99ab0e68420e3317d93711630dd55a76d4f2a21863a220031203ac2/merged",
            "loaded",
            "active",
            "mounted",
            "",
            "/org/freedesktop/systemd1/unit/mnt_2ddata_2ddocker_2doverlay2_2d7493c48dd99ab0e68420e3317d93711630dd55a76d4f2a21863a220031203ac2_2dmerged_2emount",
            0,
            "",
            "/",
        ],
        [
            "hassos-hardware.target",
            "HassOS hardware targets",
            "loaded",
            "active",
            "active",
            "",
            "/org/freedesktop/systemd1/unit/hassos_2dhardware_2etarget",
            0,
            "",
            "/",
        ],
        [
            "dev-zram1.device",
            "/dev/zram1",
            "loaded",
            "active",
            "plugged",
            "sys-devices-virtual-block-zram1.device",
            "/org/freedesktop/systemd1/unit/dev_2dzram1_2edevice",
            0,
            "",
            "/",
        ],
        [
            "sys-subsystem-net-devices-hassio.device",
            "/sys/subsystem/net/devices/hassio",
            "loaded",
            "active",
            "plugged",
            "",
            "/org/freedesktop/systemd1/unit/sys_2dsubsystem_2dnet_2ddevices_2dhassio_2edevice",
            0,
            "",
            "/",
        ],
        [
            "cryptsetup.target",
            "cryptsetup.target",
            "not-found",
            "inactive",
            "dead",
            "",
            "/org/freedesktop/systemd1/unit/cryptsetup_2etarget",
            0,
            "",
            "/",
        ],
        [
            "sys-devices-virtual-net-vethd256dfa.device",
            "/sys/devices/virtual/net/vethd256dfa",
            "loaded",
            "active",
            "plugged",
            "",
            "/org/freedesktop/systemd1/unit/sys_2ddevices_2dvirtual_2dnet_2dvethd256dfa_2edevice",
            0,
            "",
            "/",
        ],
        [
            "network-pre.target",
            "Network (Pre)",
            "loaded",
            "inactive",
            "dead",
            "",
            "/org/freedesktop/systemd1/unit/network_2dpre_2etarget",
            0,
            "",
            "/",
        ],
        [
            "sys-devices-virtual-net-veth5714b4e.device",
            "/sys/devices/virtual/net/veth5714b4e",
            "loaded",
            "active",
            "plugged",
            "",
            "/org/freedesktop/systemd1/unit/sys_2ddevices_2dvirtual_2dnet_2dveth5714b4e_2edevice",
            0,
            "",
            "/",
        ],
        [
            "sys-kernel-debug.mount",
            "Kernel Debug File System",
            "loaded",
            "active",
            "mounted",
            "",
            "/org/freedesktop/systemd1/unit/sys_2dkernel_2ddebug_2emount",
            0,
            "",
            "/",
        ],
        [
            "slices.target",
            "Slices",
            "loaded",
            "active",
            "active",
            "",
            "/org/freedesktop/systemd1/unit/slices_2etarget",
            0,
            "",
            "/",
        ],
        [
            "etc-NetworkManager-system-connections.mount",
            "NetworkManager persistent system connections",
            "loaded",
            "active",
            "mounted",
            "",
            "/org/freedesktop/systemd1/unit/etc_2dNetworkManager_2dsystem_5cx2dconnections_2emount",
            0,
            "",
            "/",
        ],
        [
            "run-docker-netns-26ede3178729.mount",
            "/run/docker/netns/26ede3178729",
            "loaded",
            "active",
            "mounted",
            "",
            "/org/freedesktop/systemd1/unit/run_2ddocker_2dnetns_2d26ede3178729_2emount",
            0,
            "",
            "/",
        ],
        [
            "dev-disk-by-path-platform-3f202000.mmc-part2.device",
            "/dev/disk/by-path/platform-3f202000.mmc-part2",
            "loaded",
            "active",
            "plugged",
            "sys-devices-platform-soc-3f202000.mmc-mmc_host-mmc0-mmc0:e624-block-mmcblk0-mmcblk0p2.device",
            "/org/freedesktop/systemd1/unit/dev_2ddisk_2dby_5cx2dpath_2dplatform_5cx2d3f202000_2emmc_5cx2dpart2_2edevice",
            0,
            "",
            "/",
        ],
    ]]