mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 20:35:55 +00:00
22 lines
688 B
Python
22 lines
688 B
Python
"""Test CGroup/Agent dbus interface."""
|
|
|
|
import pytest
|
|
|
|
from supervisor.coresys import CoreSys
|
|
from supervisor.exceptions import DBusNotConnectedError
|
|
|
|
|
|
async def test_dbus_osagent_cgroup_add_devices(coresys: CoreSys, dbus: list[str]):
|
|
"""Test wipe data partition on host."""
|
|
with pytest.raises(DBusNotConnectedError):
|
|
await coresys.dbus.agent.cgroup.add_devices_allowed("9324kl23j4kl", "*:* rwm")
|
|
|
|
await coresys.dbus.agent.connect(coresys.dbus.bus)
|
|
|
|
dbus.clear()
|
|
assert (
|
|
await coresys.dbus.agent.cgroup.add_devices_allowed("9324kl23j4kl", "*:* rwm")
|
|
is None
|
|
)
|
|
assert dbus == ["/io/hass/os/CGroup-io.hass.os.CGroup.AddDevicesAllowed"]
|