From 1615b50e6b4cd45a4e6b3235b95a924895efd48e Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 16 Mar 2026 16:24:46 +0100 Subject: [PATCH] Fix pytests --- tests/os/test_data_disk.py | 1 + tests/resolution/fixup/test_system_adopt_data_disk.py | 4 ++++ tests/resolution/fixup/test_system_execute_reboot.py | 2 ++ 3 files changed, 7 insertions(+) diff --git a/tests/os/test_data_disk.py b/tests/os/test_data_disk.py index 63b25e520..2b31e1654 100644 --- a/tests/os/test_data_disk.py +++ b/tests/os/test_data_disk.py @@ -271,6 +271,7 @@ async def test_datadisk_migrate_between_external_renames( all_dbus_services["os_agent"].emit_properties_changed({"Version": "1.5.0"}) await all_dbus_services["os_agent"].ping() + await coresys.core.set_state(CoreState.RUNNING) await coresys.os.datadisk.migrate_disk("Generic-Flash-Disk-61BCDDB6") assert datadisk_service.MarkDataMove.calls == [()] diff --git a/tests/resolution/fixup/test_system_adopt_data_disk.py b/tests/resolution/fixup/test_system_adopt_data_disk.py index 1366cebcb..cbb24399d 100644 --- a/tests/resolution/fixup/test_system_adopt_data_disk.py +++ b/tests/resolution/fixup/test_system_adopt_data_disk.py @@ -5,6 +5,7 @@ from dataclasses import dataclass, replace from dbus_fast import DBusError, ErrorType, Variant import pytest +from supervisor.const import CoreState from supervisor.coresys import CoreSys from supervisor.resolution.const import ContextType, IssueType, SuggestionType from supervisor.resolution.data import Issue, Suggestion @@ -98,6 +99,7 @@ async def test_fixup( ["/org/freedesktop/UDisks2/block_devices/mmcblk1p3"], ] + await coresys.core.set_state(CoreState.RUNNING) await system_adopt_data_disk() assert mmcblk1p3_filesystem_service.SetLabel.calls == [ @@ -176,6 +178,7 @@ async def test_fixup_reboot_failed( ["/org/freedesktop/UDisks2/block_devices/mmcblk1p3"], ] + await coresys.core.set_state(CoreState.RUNNING) await system_adopt_data_disk() assert mmcblk1p3_filesystem_service.SetLabel.calls == [ @@ -228,6 +231,7 @@ async def test_fixup_disabled_data_disk( ["/org/freedesktop/UDisks2/block_devices/mmcblk1p3"], ] + await coresys.core.set_state(CoreState.RUNNING) await system_adopt_data_disk() assert mmcblk1p3_filesystem_service.SetLabel.calls == [ diff --git a/tests/resolution/fixup/test_system_execute_reboot.py b/tests/resolution/fixup/test_system_execute_reboot.py index 084cfcde7..f14e4641f 100644 --- a/tests/resolution/fixup/test_system_execute_reboot.py +++ b/tests/resolution/fixup/test_system_execute_reboot.py @@ -1,5 +1,6 @@ """Test fixup system reboot.""" +from supervisor.const import CoreState from supervisor.coresys import CoreSys from supervisor.resolution.const import ContextType, IssueType, SuggestionType from supervisor.resolution.data import Issue, Suggestion @@ -25,6 +26,7 @@ async def test_fixup( ) coresys.resolution.add_issue(Issue(IssueType.REBOOT_REQUIRED, ContextType.SYSTEM)) + await coresys.core.set_state(CoreState.RUNNING) await system_execute_reboot() assert logind_service.Reboot.calls == [(False,)]