1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-02-14 23:18:57 +00:00

Fix tests to accommodate wait for container re-download on downgrade (#4368)

Because the OS downgrade performed in tests now triggers change in container
snapshotters, all containers need to be redownloaded. Make sure that CLI
container exists and increase the timeout for the time being.
This commit is contained in:
Jan Čermák
2025-10-29 11:05:59 +01:00
committed by GitHub
parent 4e7b99d233
commit af87ada145

View File

@@ -39,8 +39,14 @@ def test_init(shell, shell_json):
@pytest.mark.dependency(depends=["test_init"])
@pytest.mark.timeout(300)
@pytest.mark.timeout(600) # TODO: reduce to 300 after 17.0 release
def test_os_update(shell, shell_json, target):
def check_container_running(container_name):
out = shell.run_check(
f"docker container inspect -f '{{{{.State.Status}}}}' {container_name} || true"
)
return "running" in out
# fetch version info and OTA URL
shell.run_check("ha su reload --no-progress")
@@ -63,6 +69,13 @@ def test_os_update(shell, shell_json, target):
target.deactivate(shell)
target.activate(shell)
# temporary needed for OS 17.0 -> 16.x path, where all containers must be re-downloaded
while True:
if check_container_running("hassio_supervisor") and check_container_running("hassio_cli"):
break
sleep(1)
# wait for the system to be ready after update
while True:
output = "\n".join(shell.run_check("ha os info || true"))