Verified Commit 34197d04 authored by Karel Koci's avatar Karel Koci 🤘 Committed by Karel Koci
Browse files

tests: start using deploy mark

The tests added in df0bf8d057735d316fc35f36928b2875b39e3f87 made it
necessary to start using deploy mark. The deploy mark is used on tests
needed to pass for deploy to proceed. These should be minimal necessary
tests and should be fast enough.
The reasoning why we need it here is because in most cases it should be
enough the check in the test_no_wan that runs fast. The additional
slower but more general test TestNoInternetAccess should cover only
corner case and thus is not essentially required as a blocker for
deploy.
parent b592db4b
......@@ -6,6 +6,7 @@ from . import common
# pylint: disable=no-self-use
@pytest.mark.deploy
class TestInternet(common.InternetTests):
"""Test WAN with network settings configured statically.
"""
......
......@@ -11,6 +11,7 @@ from . import common
# TODO: add support for IPV6, currently we only test IPv4
@pytest.mark.deploy
class TestStatic(common.InternetTests):
"""Test WAN with network settings configured statically.
"""
......@@ -40,6 +41,7 @@ class TestStatic(common.InternetTests):
client_board.run("uci commit network")
@pytest.mark.deploy
class TestDHCP(common.InternetTests):
"""Test WAN with network settings provided by DHCP server.
"""
......
......@@ -12,6 +12,7 @@ sentinel_services = [
]
@pytest.mark.deploy
@pytest.mark.parametrize("service", sentinel_services)
def test_service_running(client_board, service):
"""Check if expected processes we need for Sentinel are running and thus all should be correctly configured.
......@@ -19,6 +20,7 @@ def test_service_running(client_board, service):
assert service_is_running(service, client_board)
@pytest.mark.deploy
@pytest.mark.parametrize("service", sentinel_services)
def test_service_enabled(client_board, service):
"""Check if expected processes we need for Sentinel are running and thus all should be correctly configured.
......
......@@ -8,12 +8,14 @@ from nsfarm.cli import Shell
from nsfarm.toolbox import service_is_running
@pytest.mark.deploy
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.deploy
@pytest.mark.parametrize("process", [
"crond",
"dnsmasq",
......@@ -53,6 +55,7 @@ basic_services = [
]
@pytest.mark.deploy
@pytest.mark.parametrize("service", basic_services + [
pytest.param("kresd", marks=pytest.mark.not_board("turris1x")),
pytest.param("unbound", marks=pytest.mark.board("turris1x")),
......@@ -63,6 +66,7 @@ def test_running_services(client_board, service):
assert service_is_running(service, client_board)
@pytest.mark.deploy
@pytest.mark.parametrize("service", basic_services + [
"boot",
"done",
......@@ -90,6 +94,7 @@ def test_services(client_board, service):
client_board.run(f"/etc/init.d/{service} enabled")
@pytest.mark.deploy
def test_lighttpd(lan1_client):
"""Test that there is access to router interface.
"""
......@@ -97,6 +102,7 @@ def test_lighttpd(lan1_client):
pexp.run("wget 192.168.1.1 && rm index.html")
@pytest.mark.deploy
def test_no_wan(client_board):
"""Wan interface should be in default configured to none and thus disabled.
"""
......
......@@ -3,6 +3,7 @@
import pytest
@pytest.mark.deploy
def test_fw_printenv(client_board):
"""Check that we can access uboot environment.
"""
......
......@@ -5,6 +5,7 @@ attribute access.
import pytest
@pytest.mark.deploy
@pytest.mark.parametrize("hwtype", [
pytest.param("atsha", marks=pytest.mark.board("omnia", "turris1x")),
pytest.param("otp", marks=pytest.mark.board("mox")),
......@@ -16,6 +17,7 @@ def test_hw_type(hwtype, client_board):
assert client_board.output == hwtype
@pytest.mark.deploy
def test_serial_number(request, client_board):
"""Check that syslog-ng is running by checking if there is /var/log/messages (default log output).
"""
......
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