pf tests: Basic test for 'set skip in $groupname'

This tests for the problem reported in PR 229241, where using a group
name in 'set skip on' did not work as expected.

Sponsored by:	Essen Hackathon
This commit is contained in:
kp 2018-08-11 16:41:07 +00:00
parent 264bf696ba
commit 4af4c25f85
2 changed files with 38 additions and 1 deletions

View File

@ -10,7 +10,8 @@ ATF_TESTS_SH+= pass_block \
fragmentation \
set_tos \
route_to \
synproxy
synproxy \
set_skip
${PACKAGE}FILES+= utils.subr \
echo_inetd.conf \

View File

@ -0,0 +1,36 @@
# $FreeBSD$
. $(atf_get_srcdir)/utils.subr
atf_test_case "set_skip_group" "cleanup"
set_skip_group_head()
{
atf_set descr 'Basic set skip test'
atf_set require.user root
}
set_skip_group_body()
{
# See PR 229241
pft_init
pft_mkjail alcatraz
jexec alcatraz ifconfig lo0 127.0.0.1/8 up
jexec alcatraz ifconfig lo0 group foo
jexec alcatraz pfctl -e
pft_set_rules alcatraz "set skip on foo" \
"block in proto icmp"
jexec alcatraz ifconfig
atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1
}
set_skip_group_cleanup()
{
pft_cleanup
}
atf_init_test_cases()
{
atf_add_test_case "set_skip_group"
}