Skip to content

Commit d3020ca

Browse files
committed
pf tests: recusrive table printing test
Sponsored by: Rubicon Communications, LLC ("Netgate")
1 parent 7aac81a commit d3020ca

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/sys/netpfil/pf/table.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,43 @@ large_cleanup()
673673
pft_cleanup
674674
}
675675

676+
atf_test_case "show_recursive" "cleanup"
677+
show_recursive_head()
678+
{
679+
atf_set descr 'Test displaying tables in every anchor'
680+
atf_set require.user root
681+
}
682+
683+
show_recursive_body()
684+
{
685+
pft_init
686+
687+
vnet_mkjail alcatraz
688+
689+
pft_set_rules alcatraz \
690+
691+
(echo "table <bar> persist"
692+
echo "block in quick from <bar> to any"
693+
) | jexec alcatraz pfctl -a anchorage -f -
694+
695+
pft_set_rules noflush alcatraz \
696+
"table <foo> counters { 192.0.2.1 }" \
697+
"pass in from <foo>" \
698+
"anchor anchorage"
699+
700+
jexec alcatraz pfctl -sr -a "*"
701+
702+
atf_check -s exit:0 -e ignore -o match:'-pa-r-- bar@anchorage' \
703+
jexec alcatraz pfctl -v -a "*" -sT
704+
atf_check -s exit:0 -e ignore -o match:'--a-r-C foo' \
705+
jexec alcatraz pfctl -v -a "*" -sT
706+
}
707+
708+
show_recursive_cleanup()
709+
{
710+
pft_cleanup
711+
}
712+
676713
atf_init_test_cases()
677714
{
678715
atf_add_test_case "v4_counters"
@@ -689,4 +726,5 @@ atf_init_test_cases()
689726
atf_add_test_case "anchor"
690727
atf_add_test_case "flush"
691728
atf_add_test_case "large"
729+
atf_add_test_case "show_recursive"
692730
}

0 commit comments

Comments
 (0)