Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/smoke_test/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion tests/supervisor_test/test_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down