mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 02:49:43 +00:00
OS-Agent support (#2811)
* OS-Agent support * add agent to host feature * Add support for os-agent on devcontainer * Rename core * fix tests * add setter * add cgroup / apparmor * all interfaces added * fix import * Add tests * More tests * Finish tests * reformating xml files * fix doc string * address comments * change return value * fix tests * Update supervisor/dbus/agent/__init__.py Co-authored-by: Joakim Sørensen <joasoe@gmail.com> * Update scripts/supervisor.sh Co-authored-by: Joakim Sørensen <joasoe@gmail.com> Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
This commit is contained in:
28
tests/dbus/agent/test_datadisk.py
Normal file
28
tests/dbus/agent/test_datadisk.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Test Datadisk/Agent dbus interface."""
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from supervisor.coresys import CoreSys
|
||||
from supervisor.exceptions import DBusNotConnectedError
|
||||
|
||||
|
||||
async def test_dbus_osagent_datadisk(coresys: CoreSys):
|
||||
"""Test coresys dbus connection."""
|
||||
assert coresys.dbus.agent.datadisk.current_device is None
|
||||
|
||||
await coresys.dbus.agent.connect()
|
||||
await coresys.dbus.agent.update()
|
||||
|
||||
assert coresys.dbus.agent.datadisk.current_device.as_posix() == "/dev/sda"
|
||||
|
||||
|
||||
async def test_dbus_osagent_datadisk_change_device(coresys: CoreSys):
|
||||
"""Change datadisk on device."""
|
||||
|
||||
with pytest.raises(DBusNotConnectedError):
|
||||
await coresys.dbus.agent.datadisk.change_device(Path("/dev/sdb"))
|
||||
|
||||
await coresys.dbus.agent.connect()
|
||||
|
||||
assert await coresys.dbus.agent.datadisk.change_device(Path("/dev/sdb")) is None
|
||||
Reference in New Issue
Block a user