From 6d698d4d3da5afec6fbdc39de0442bb2cfd94417 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <cynerd@email.cz>
Date: Wed, 8 Jul 2020 19:26:21 +0200
Subject: [PATCH] tests: add bootup tests

These are simple tests to check system that was just booted.
---
 tests/test_bootup.py | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 tests/test_bootup.py

diff --git a/tests/test_bootup.py b/tests/test_bootup.py
new file mode 100644
index 0000000..a0b19a5
--- /dev/null
+++ b/tests/test_bootup.py
@@ -0,0 +1,37 @@
+"""These are test that check that everything we need is running after boot. This does simple and quick tests to catch
+general errors such as disabled core services.
+"""
+import pytest
+
+
+def test_syslog_ng(client_board):
+    """Check that syslog-ng is running by checking if there is /var/log/messages (default log output).
+    """
+    client_board.run("[ -f /var/log/messages ]")
+
+
+@pytest.mark.parametrize("process", [
+    "crond",
+    "dnsmasq",
+    "kresd",
+    "lighttpd",
+    "mosquitto",
+    "netifd",
+    "odhcpd",
+    "rpcd",
+    "sshd",
+    "syslog-ng",
+    "ubusd",
+    "watchdog",
+
+])
+def test_processes(client_board, process):
+    """Check that various essential processes are running.
+    """
+    client_board.run("pgrep -x '{p}' || pgrep -x \"$(which '{p}')\"".format(p=process))
+
+
+def test_lighttpd(client_board):
+    """Test that there is access to router interface.
+    """
+    # TODO
-- 
GitLab