git: 7659d0fa2b87 - main - pf tests: skip TestHeader6::test_too_many if ipfilter is loaded
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 06 Jun 2025 11:17:14 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=7659d0fa2b873374623e7582e38fb2fe92056c87
commit 7659d0fa2b873374623e7582e38fb2fe92056c87
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-05-27 14:19:04 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-06-06 11:16:00 +0000
pf tests: skip TestHeader6::test_too_many if ipfilter is loaded
IPFilter interferes with the header.py:TestHeader6::test_too_many test, so skip
it if the module is loaded.
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D50661
---
tests/atf_python/utils.py | 10 ++++++++++
tests/sys/netpfil/pf/header.py | 1 +
2 files changed, 11 insertions(+)
diff --git a/tests/atf_python/utils.py b/tests/atf_python/utils.py
index 4bd4b642b131..26911c12aef3 100644
--- a/tests/atf_python/utils.py
+++ b/tests/atf_python/utils.py
@@ -46,6 +46,7 @@ class BaseTest(object):
NEED_ROOT: bool = False # True if the class needs root privileges for the setup
TARGET_USER = None # Set to the target user by the framework
REQUIRED_MODULES: List[str] = []
+ SKIP_MODULES: List[str] = []
def require_module(self, mod_name: str, skip=True):
error_code = libc.modfind(mod_name)
@@ -58,9 +59,18 @@ class BaseTest(object):
else:
raise ValueError(txt)
+ def skip_module(self, mod_name: str):
+ error_code = libc.modfind(mod_name)
+ if error_code == 0:
+ txt = "kernel module '{}' loaded, skip test".format(mod_name)
+ pytest.skip(txt)
+ return
+
def _check_modules(self):
for mod_name in self.REQUIRED_MODULES:
self.require_module(mod_name)
+ for mod_name in self.SKIP_MODULES:
+ self.skip_module(mod_name)
@property
def atf_vars(self) -> Dict[str, str]:
diff --git a/tests/sys/netpfil/pf/header.py b/tests/sys/netpfil/pf/header.py
index 71abc8e9a049..6832cfe6d42b 100644
--- a/tests/sys/netpfil/pf/header.py
+++ b/tests/sys/netpfil/pf/header.py
@@ -125,6 +125,7 @@ class TestHeader(VnetTestTemplate):
class TestHeader6(VnetTestTemplate):
REQUIRED_MODULES = [ "pf" ]
+ SKIP_MODULES = [ "ipfilter" ]
TOPOLOGY = {
"vnet1": {"ifaces": ["if1", "if2"]},
"vnet2": {"ifaces": ["if1", "if2"]},