From 5d164b12d14241c2ebc3a474e36b34e2a56ab667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Wed, 11 Sep 2024 23:30:01 +0200 Subject: [PATCH] Add test for no failed Systemd units (#3583) Test that systemctl reports no failed units at the end of the basic test. --- tests/smoke_test/test_basic.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/smoke_test/test_basic.py b/tests/smoke_test/test_basic.py index f73077897..9e466e198 100644 --- a/tests/smoke_test/test_basic.py +++ b/tests/smoke_test/test_basic.py @@ -71,3 +71,8 @@ def test_supervisor_logs(shell): def test_systemctl_status(shell): output = shell.run_check("systemctl --no-pager -l status -a || true") _LOGGER.info("%s", "\n".join(output)) + +@pytest.mark.dependency(depends=["test_init"]) +def test_systemctl_check_no_failed(shell): + output = shell.run_check("systemctl --no-pager -l list-units --state=failed") + assert "0 loaded units listed." in output, f"Some units failed:\n{"\n".join(output)}"