Skip to content

Commit 294dbba

Browse files
SmithCharthnez
andcommitted
test/userspace: Check that the system state is running
This test catches situations where some service is broken to the point that it does not start anymore. Co-authored-by: Leonard Göhrs <[email protected]>
1 parent 3e1e4ac commit 294dbba

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_userspace.py

+12
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ def test_hostname(shell, check):
9191
assert serial_number in etc_hostname
9292

9393

94+
def test_system_running(shell):
95+
"""
96+
Test if the system state is running.
97+
"""
98+
99+
# This will exit non-zero if we have any other state than "running", but we are interested in the string output.
100+
# So let's ignore the returncode.
101+
[state], _, _ = shell.run("systemctl is-system-running")
102+
103+
assert state == "running"
104+
105+
94106
@pytest.fixture
95107
def clocktree(shell):
96108
"""

0 commit comments

Comments
 (0)