aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2021-04-25 10:18:48 +0000
committerKristof Provost <kp@FreeBSD.org>2021-04-27 07:05:14 +0000
commitdaa5350d0e0c5fbe42c5a057dd37b9d22df91bb7 (patch)
tree239da85287826de9735582598dfbeac309a75e4a
parentd5b08e13dd6beb3436e181ff1f3e034cc8186584 (diff)
downloadsrc-daa5350d0e0c5fbe42c5a057dd37b9d22df91bb7.tar.gz
src-daa5350d0e0c5fbe42c5a057dd37b9d22df91bb7.zip
pf tests: Test using '<ifgroup>:network' in tables
MFC after: 1 week
-rw-r--r--tests/sys/netpfil/pf/table.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh
index 5f23a2c82aa9..2441a3ff84c2 100644
--- a/tests/sys/netpfil/pf/table.sh
+++ b/tests/sys/netpfil/pf/table.sh
@@ -183,10 +183,42 @@ automatic_cleanup()
pft_cleanup
}
+atf_test_case "network" "cleanup"
+network_head()
+{
+ atf_set descr 'Test <ifgroup>:network'
+ atf_set require.user root
+}
+
+network_body()
+{
+ pft_init
+
+ epair=$(vnet_mkepair)
+ ifconfig ${epair}a 192.0.2.1/24 up
+
+ vnet_mkjail alcatraz ${epair}b
+ jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up
+ jexec alcatraz pfctl -e
+
+ pft_set_rules alcatraz \
+ "table <allow> const { epair:network }"\
+ "block in" \
+ "pass in from <allow>"
+
+ atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2
+}
+
+network_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "v4_counters"
atf_add_test_case "v6_counters"
atf_add_test_case "pr251414"
atf_add_test_case "automatic"
+ atf_add_test_case "network"
}