Verified Commit 748f9db2 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

tests/test_bootup: check if services we want are enabled

This checks not only if services we want are running but also if they
are enabled.
The real reason for this is not to cover issue of disabled but running
service as that is highly unlikely. This rather covers services that
spawn actually no process but still we have to check if they are enabled
and thus executed in some manner. There is a lot of such services.
parent 1912c20a
......@@ -32,10 +32,10 @@ def test_processes(client_board, process):
client_board.run(f"pgrep -x '{process}' || pgrep -x \"$(which '{process}')\"")
@pytest.mark.parametrize("service", [
basic_services = [
"atd",
"cron",
"dnsmasq",
"kresd",
"foris-controller",
"foris-ws",
"fosquitto",
......@@ -48,13 +48,46 @@ def test_processes(client_board, process):
"syslog-ng",
"sysntpd",
"umdns",
]
@pytest.mark.parametrize("service", basic_services + [
pytest.param("kresd", marks=pytest.mark.not_board("turris1x")),
pytest.param("unbound", marks=pytest.mark.board("turris1x")),
])
def test_services(client_board, service):
"""Check that various essential processes are running.
def test_running_services(client_board, service):
"""Check that various essential services are running.
"""
assert service_is_running(service, client_board)
@pytest.mark.parametrize("service", basic_services + [
"boot",
"done",
"gpio_switch",
"led",
pytest.param("mox_autosetup", marks=pytest.mark.board("mox")),
pytest.param("rainbow", marks=pytest.mark.not_board("mox")),
"resolver",
pytest.param("setup_led", marks=pytest.mark.board("turris1x")),
"srv",
"sysctl",
"sysfixtime",
"sysfsutils",
"system",
"ucitrack",
"umount",
pytest.param("update_mac", marks=pytest.mark.board("turris1x")),
"updater-journal-recover",
"urandom_seed",
pytest.param("zram", marks=pytest.mark.board("mox")),
])
def test_services(client_board, service):
"""Check that various essential services are enabled.
"""
client_board.run(f"/etc/init.d/{service} enabled")
def test_lighttpd(lan1_client):
"""Test that there is access to router interface.
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment