Verified Commit 65c8fea6 authored by Karel Koci's avatar Karel Koci 🤘
Browse files

tests: remove serial and wan markers

The only possible execution right now is with serial and wan present.
In reality we need lan1 as well but we have to get around that because
CPU only Mox.
This simply removes parameters and marks for appropriate fixtures.
The effect is just less marks as well as better tests reports as they no
longer report None parameters.
parent d3fe6c6a
......@@ -6,7 +6,5 @@ log_cli_format = %(levelname)s %(name)s %(message)s
markers =
deploy: quick tests to be run as part of deployment process
board(boards): mark test to run only on specified board
serial: requirement of serial port connection to board
wan: requirement of wan ethernet connection to board
lan1: requirement of lan1 ethernet connection to board
lan2: requirement of lan2 ethernet connection to board
......@@ -68,7 +68,7 @@ def pytest_runtest_setup(item):
for boards in item.iter_markers(name="board"):
if board not in boards.args:
pytest.skip(f"test is not compatible with target: {board}")
for conn in ("serial", "wan", "lan1", "lan2"):
for conn in ("lan1", "lan2"):
if item.get_closest_marker(conn) is not None and not item.config.target_config.is_configured(conn):
pytest.skip(f"test requires connection: {conn}")
......@@ -76,7 +76,7 @@ def pytest_runtest_setup(item):
########################################################################################################################
# Resources shared among all tests #####################################################################################
@pytest.fixture(scope="session", name="board", params=[pytest.param(None, marks=pytest.mark.serial)])
@pytest.fixture(scope="session", name="board")
def fixture_board(request):
"""Brings board on. Nothing else.
This is top most fixture for board. It returns board handle.
......@@ -94,14 +94,14 @@ def fixture_lxd():
return nsfarm.lxd.LXDConnection()
@pytest.fixture(scope="session", name="wan", params=[pytest.param(None, marks=pytest.mark.wan)])
@pytest.fixture(scope="session", name="wan")
def fixture_wan(request):
"""Top level fixture used to share WAN interface handler.
"""
return nsfarm.lxd.NetInterface("wan", request.config.target_config.wan)
@pytest.fixture(scope="session", name="lan1", params=[pytest.param(None, marks=pytest.mark.lan1)])
@pytest.fixture(scope="session", name="lan1", params=[pytest.param("lan1", marks=pytest.mark.lan1)])
def fixture_lan1(request):
"""Top level fixture used to share LAN1 interface handler.
"""
......
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