diff --git a/tests/conftest.py b/tests/conftest.py index c308d5dcac..01886eb951 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -169,11 +169,16 @@ def pytest_collection_modifyitems(config, items) -> None: for item in items: if "skip_for_loadbalancer" in item.keywords: item.add_marker(skip_for_loadbalancer) - if ("-nap" or "-nap-v5") not in config.getoption("--image"): - appprotect = pytest.mark.skip(reason="Skip AppProtect test in non-AP image") + if "-nap" not in config.getoption("--image"): + appprotect = pytest.mark.skip(reason="Skip AppProtect WAF v4 test in non-AP WAF v4 image") for item in items: - if ("appprotect" or "appprotect_waf_v5") in item.keywords: + if "appprotect" in item.keywords: item.add_marker(appprotect) + if "-nap-v5" not in config.getoption("--image"): + appprotect_v5 = pytest.mark.skip(reason="Skip AppProtect WAF v5 test in non-AP WAF v5 image") + for item in items: + if "appprotect_waf_v5" in item.keywords: + item.add_marker(appprotect_v5) if "-dos" not in config.getoption("--image"): dos = pytest.mark.skip(reason="Skip DOS test in non-DOS image") for item in items: