mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-04-02 08:12:47 +01:00
* Drop unsupported architectures and machines from Supervisor Since #5620 Supervisor no longer updates the version information on unsupported architectures and machines. This means users can no longer update to newer version of Supervisor since that PR got released. Furthermore since #6347 we also no longer build for these architectures. With this, any code related to these architectures becomes dead code and should be removed. This commit removes all refrences to the deprecated architectures and machines from Supervisor. This affects the following architectures: - armhf - armv7 - i386 And the following machines: - odroid-xu - qemuarm - qemux86 - raspberrypi - raspberrypi2 - raspberrypi3 - raspberrypi4 - tinker * Create issue if an app using a deprecated architecture is installed This adds a check to the resolution system to detect if an app is installed that uses a deprecated architecture. If so, it will show a warning to the user and recommend them to uninstall the app. * Formally deprecate machine add-on configs as well Not only deprecate add-on configs for unsupported architectures, but also for unsupported machines. * For installed add-ons architecture must always exist Fail hard in case of missing architecture, as this is a required field for installed add-ons. This will prevent the Supervisor from running with an unsupported configuration and causing further issues down the line.
68 lines
1.9 KiB
Python
68 lines
1.9 KiB
Python
"""Test evaluation base."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
from supervisor.addons.addon import Addon
|
|
from supervisor.coresys import CoreSys
|
|
from supervisor.resolution.const import ContextType, IssueType, SuggestionType
|
|
from supervisor.resolution.data import Issue, Suggestion
|
|
from supervisor.resolution.fixups.addon_execute_remove import FixupAddonExecuteRemove
|
|
|
|
|
|
async def test_fixup(coresys: CoreSys, install_addon_ssh: Addon):
|
|
"""Test fixup."""
|
|
addon_execute_remove = FixupAddonExecuteRemove(coresys)
|
|
|
|
assert addon_execute_remove.auto is False
|
|
|
|
coresys.resolution.add_suggestion(
|
|
Suggestion(
|
|
SuggestionType.EXECUTE_REMOVE,
|
|
ContextType.ADDON,
|
|
reference=install_addon_ssh.slug,
|
|
)
|
|
)
|
|
coresys.resolution.add_issue(
|
|
Issue(
|
|
IssueType.DETACHED_ADDON_REMOVED,
|
|
ContextType.ADDON,
|
|
reference=install_addon_ssh.slug,
|
|
)
|
|
)
|
|
|
|
with patch.object(Addon, "uninstall") as uninstall:
|
|
await addon_execute_remove()
|
|
|
|
assert uninstall.called
|
|
|
|
assert len(coresys.resolution.suggestions) == 0
|
|
assert len(coresys.resolution.issues) == 0
|
|
|
|
|
|
async def test_fixup_deprecated_arch_addon(coresys: CoreSys, install_addon_ssh: Addon):
|
|
"""Test fixup for deprecated arch add-on issue."""
|
|
addon_execute_remove = FixupAddonExecuteRemove(coresys)
|
|
|
|
coresys.resolution.add_suggestion(
|
|
Suggestion(
|
|
SuggestionType.EXECUTE_REMOVE,
|
|
ContextType.ADDON,
|
|
reference=install_addon_ssh.slug,
|
|
)
|
|
)
|
|
coresys.resolution.add_issue(
|
|
Issue(
|
|
IssueType.DEPRECATED_ARCH_ADDON,
|
|
ContextType.ADDON,
|
|
reference=install_addon_ssh.slug,
|
|
)
|
|
)
|
|
|
|
with patch.object(Addon, "uninstall") as uninstall:
|
|
await addon_execute_remove()
|
|
|
|
assert uninstall.called
|
|
|
|
assert len(coresys.resolution.suggestions) == 0
|
|
assert len(coresys.resolution.issues) == 0
|