diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sys/netpfil/pf/route_to.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 7e8310bceb30..31a47e75c82e 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -407,6 +407,55 @@ ifbound_cleanup() pft_cleanup } +atf_test_case "dummynet_frag" "cleanup" +dummynet_frag_head() +{ + atf_set descr 'Test fragmentation with route-to and dummynet' + atf_set require.user root +} + +dummynet_frag_body() +{ + pft_init + dummynet_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + ifconfig ${epair_one}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair_one}b ${epair_two}a + jexec alcatraz ifconfig ${epair_one}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair_two}a 198.51.100.1/24 up + jexec alcatraz sysctl net.inet.ip.forwarding=1 + + vnet_mkjail singsing ${epair_two}b + jexec singsing ifconfig ${epair_two}b 198.51.100.2/24 up + jexec singsing route add default 198.51.100.1 + + route add 198.51.100.0/24 192.0.2.2 + + jexec alcatraz dnctl pipe 1 config bw 1000Byte/s burst 4500 + jexec alcatraz dnctl pipe 2 config + # This second pipe ensures that the pf_test(PF_OUT) call in pf_route() doesn't + # delay packets in dummynet (by inheriting pipe 1 from the input rule). + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set reassemble yes" \ + "pass in route-to (${epair_two}a 198.51.100.2) inet proto icmp all icmp-type echoreq dnpipe 1" \ + "pass out dnpipe 2" + + + atf_check -s exit:0 -o ignore ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore ping -c 1 -s 4000 198.51.100.2 +} + +dummynet_frag_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" @@ -416,4 +465,5 @@ atf_init_test_cases() atf_add_test_case "icmp_nat" atf_add_test_case "dummynet" atf_add_test_case "ifbound" + atf_add_test_case "dummynet_frag" } |