Page MenuHomeFreeBSD

D46039.id141118.diff
No OneTemporary

D46039.id141118.diff

diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py
--- a/tests/atf_python/sys/net/vnet.py
+++ b/tests/atf_python/sys/net/vnet.py
@@ -334,6 +334,10 @@
NEED_ROOT: bool = True
TOPOLOGY = {}
+ def _check_modules(self):
+ libc.kldload("if_epair.ko")
+ self.require_module("if_epair")
+
def _get_vnet_handler(self, vnet_alias: str):
handler_name = "{}_handler".format(vnet_alias)
return getattr(self, handler_name, None)
@@ -451,6 +455,8 @@
def setup_method(self, _method):
"""Sets up all the required topology and handlers for the given test"""
super().setup_method(_method)
+ self._check_modules()
+
# TestIP6Output.test_output6_pktinfo[ipandif]
topology_id = get_topology_id(self.test_id)
topology = self.TOPOLOGY
diff --git a/tests/sys/common/vnet.subr b/tests/sys/common/vnet.subr
--- a/tests/sys/common/vnet.subr
+++ b/tests/sys/common/vnet.subr
@@ -11,11 +11,36 @@
sed -i "" /^$1\$/d created_interfaces.lst
}
+_vnet_check_req()
+{
+ type=$1
+
+ # If the module is loaded don't bother to go through all the effort of
+ # creating an interface.
+ if kldstat -q -n if_${type}.ko; then
+ return
+ fi
+
+ tmp=$(ifconfig $type create 2>/dev/null)
+ if [ -z "${tmp}" ]; then
+ atf_skip "if_${type}.ko is required to run this test."
+ return
+ fi
+ ifconfig ${tmp} destroy &
+}
+
vnet_init()
{
if [ "`sysctl -i -n kern.features.vimage`" != 1 ]; then
atf_skip "This test requires VIMAGE"
fi
+
+ # Check if we can create if_epair or if_bridge interfaces.
+ # We may be running in a jail already, unable to load modules.
+ # If so, skip this test because it very likely (but not certainly)
+ # wants at least one of those
+ _vnet_check_req epair
+ _vnet_check_req bridge
}
vnet_mkepair()
diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr
--- a/tests/sys/netpfil/pf/utils.subr
+++ b/tests/sys/netpfil/pf/utils.subr
@@ -83,6 +83,8 @@
pflog_init()
{
+ pft_init
+
if ! kldstat -q -m pflog; then
atf_skip "This test requires pflog"
fi

File Metadata

Mime Type
text/plain
Expires
Wed, Jul 1, 10:16 AM (9 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34554706
Default Alt Text
D46039.id141118.diff (2 KB)

Event Timeline