The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=26a7be91ad693cacaa28ead4b655d88d0ee2ae1a

commit 26a7be91ad693cacaa28ead4b655d88d0ee2ae1a
Author:     Kristof Provost <k...@freebsd.org>
AuthorDate: 2025-02-11 10:25:24 +0000
Commit:     Kristof Provost <k...@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"
 }

Reply via email to