diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -326,11 +326,7 @@ # Host is client, jail 'gw' is the captive portal gateway, jail 'srv' # is a random (web)server. We use the echo protocol rather than http # for the test, because that's easier. - pft_init - - if ! kldstat -q -m dummynet; then - atf_skip "This test requires dummynet" - fi + dummynet_init epair_gw=$(vnet_mkepair) epair_srv=$(vnet_mkepair) diff --git a/tests/sys/netpfil/pf/match.sh b/tests/sys/netpfil/pf/match.sh --- a/tests/sys/netpfil/pf/match.sh +++ b/tests/sys/netpfil/pf/match.sh @@ -36,10 +36,7 @@ dummynet_body() { - pft_init - if ! kldstat -q -m dummynet; then - atf_skip "This test requires dummynet" - fi + dummynet_init epair=$(vnet_mkepair) vnet_mkjail alcatraz ${epair}b 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 @@ -87,6 +87,15 @@ fi } +dummynet_init() +{ + pft_init + + if ! kldstat -q -m dummynet; then + atf_skip "This test requires dummynet" + fi +} + pft_set_rules() { jname=$1