git: 1d723c1e565e - main - pf tests: test recursive printing of labels
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 27 Nov 2023 20:38:06 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=1d723c1e565e714e4192883d813ef81e97220f27
commit 1d723c1e565e714e4192883d813ef81e97220f27
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-11-27 15:47:36 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-11-27 20:37:33 +0000
pf tests: test recursive printing of labels
Sponsored by: Rubicon Communications, LLC ("Netgate")
---
tests/sys/netpfil/pf/anchor.sh | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh
index cf6da8740003..b1faa5f6c57e 100644
--- a/tests/sys/netpfil/pf/anchor.sh
+++ b/tests/sys/netpfil/pf/anchor.sh
@@ -130,9 +130,44 @@ wildcard_cleanup()
pft_cleanup
}
+atf_test_case "nested_label" "cleanup"
+nested_label_head()
+{
+ atf_set descr "Test recursive listing of labels"
+ atf_set require.user root
+}
+
+nested_label_body()
+{
+ pft_init
+
+ vnet_mkjail alcatraz
+
+ pft_set_rules alcatraz \
+ "anchor \"foo\" { \n\
+ pass in quick proto icmp label \"passicmp\"\n\
+ anchor \"bar\" { \n\
+ pass in proto tcp label \"passtcp\"\n\
+ } \n\
+ }" \
+ "pass quick from any to any label \"anytoany\""
+
+ atf_check -s exit:0 \
+ -o inline:"passicmp 0 0 0 0 0 0 0 0
+passtcp 0 0 0 0 0 0 0 0
+anytoany 0 0 0 0 0 0 0 0
+" jexec alcatraz pfctl -sl -a*
+}
+
+nested_label_cleanup()
+{
+ pft_cleanup
+}
+
atf_init_test_cases()
{
atf_add_test_case "pr183198"
atf_add_test_case "nested_anchor"
atf_add_test_case "wildcard"
+ atf_add_test_case "nested_label"
}