diff --git a/tests/smoke_test/test_basic.py b/tests/smoke_test/test_basic.py index ce73f677f..b25d422a2 100644 --- a/tests/smoke_test/test_basic.py +++ b/tests/smoke_test/test_basic.py @@ -87,6 +87,29 @@ def test_systemctl_no_cycles(shell): assert not output, f"Found Systemd dependency cycles:\n{"\n".join(output)}" +def test_host_connectivity(shell): + output = shell.run_check("curl -f https://checkonline.home-assistant.io/online.txt") + assert "NetworkManager is online" in output + output = shell.run_check("nmcli network connectivity check") + assert "full" in output, f"Connectivity check failed, nmcli reports: {output}" + + +@pytest.mark.dependency(depends=["test_init"]) +@pytest.mark.timeout(10) +def test_supervisor_connectivity(shell): + # checks URL used by connectivity checks via docker0 bridge + output = shell.run_check("docker exec -ti hassio_supervisor curl -f https://checkonline.home-assistant.io/online.txt") + assert "NetworkManager is online" in output + + +@pytest.mark.dependency(depends=["test_init"]) +@pytest.mark.timeout(10) +def test_hassio_connectivity(shell): + # checks URL used by connectivity checks via hassio bridge + output = shell.run_check("docker exec -ti hassio_cli curl -f https://checkonline.home-assistant.io/online.txt") + assert "NetworkManager is online" in output + + @pytest.mark.dependency(depends=["test_init"]) def test_custom_swap_size(shell, target): output = shell.run_check("stat -c '%s' /mnt/data/swapfile") diff --git a/tests/supervisor_test/test_supervisor.py b/tests/supervisor_test/test_supervisor.py index d8f4c4b56..2b8bc1b2a 100644 --- a/tests/supervisor_test/test_supervisor.py +++ b/tests/supervisor_test/test_supervisor.py @@ -59,7 +59,9 @@ def test_check_supervisor(shell_json): def test_update_supervisor(shell_json): supervisor_info = shell_json("ha supervisor info --no-progress --raw-json") supervisor_version = supervisor_info.get("data").get("version") - if supervisor_version == supervisor_info.get("data").get("version_latest"): + supervisor_version_latest = supervisor_info.get("data").get("version_latest") + assert supervisor_version_latest, "Missing latest supervisor version info" + if supervisor_version == supervisor_version_latest: logger.info("Supervisor is already up to date") pytest.skip("Supervisor is already up to date") else: