Date: Fri, 14 Feb 2025 17:50:29 GMT From: Kristof Provost <kp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 26a7be91ad69 - main - pf tests: basic 'any' interface test case Message-ID: <202502141750.51EHoTE2061484@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=26a7be91ad693cacaa28ead4b655d88d0ee2ae1a commit 26a7be91ad693cacaa28ead4b655d88d0ee2ae1a Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2025-02-11 10:25:24 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2025-02-14 17:47:53 +0000 pf tests: basic 'any' interface test case Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/pass_block.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/sys/netpfil/pf/pass_block.sh b/tests/sys/netpfil/pf/pass_block.sh index d5ff37b6c167..b8ad5a86b102 100644 --- a/tests/sys/netpfil/pf/pass_block.sh +++ b/tests/sys/netpfil/pf/pass_block.sh @@ -418,6 +418,39 @@ optimize_any_cleanup() pft_cleanup } +atf_test_case "any_if" "cleanup" +any_if_head() +{ + atf_set descr 'Test the any interface keyword' + atf_set require.user root +} + +any_if_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}b 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}a + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "pass in on any" + + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.1 +} + +any_if_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "enable_disable" @@ -428,4 +461,5 @@ atf_init_test_cases() atf_add_test_case "urpf" atf_add_test_case "received_on" atf_add_test_case "optimize_any" + atf_add_test_case "any_if" }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502141750.51EHoTE2061484>