pf tests: factor out common dummynet check

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35160
This commit is contained in:
Kristof Provost 2022-05-09 12:14:00 +02:00
parent a908f8f0dc
commit 1977d9a37b
3 changed files with 11 additions and 9 deletions

View File

@ -326,11 +326,7 @@ captive_long_body()
# 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)

View File

@ -36,10 +36,7 @@ dummynet_head()
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

View File

@ -87,6 +87,15 @@ pflog_init()
fi
}
dummynet_init()
{
pft_init
if ! kldstat -q -m dummynet; then
atf_skip "This test requires dummynet"
fi
}
pft_set_rules()
{
jname=$1