diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2023-03-20 13:58:34 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2023-03-20 15:39:14 +0000 |
| commit | a6719858a48019aa54e1ea3be57d17fa88b080c6 (patch) | |
| tree | 34cd2091072d01ba3e6ce957e932dc1029b08e3d /tests | |
| parent | 53247cdf12449e90f6736ae563e4cce8315c923f (diff) | |
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/sys/netpfil/pf/pfsync.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/sys/netpfil/pf/pfsync.sh b/tests/sys/netpfil/pf/pfsync.sh index 3871d6be8e14..810b4e203a1f 100644 --- a/tests/sys/netpfil/pf/pfsync.sh +++ b/tests/sys/netpfil/pf/pfsync.sh @@ -669,6 +669,39 @@ ipsec_cleanup() pft_cleanup } +atf_test_case "timeout" "cleanup" +timeout_head() +{ + atf_set descr 'Trigger pfsync_timeout()' + atf_set require.user root +} + +timeout_body() +{ + pft_init + + vnet_mkjail one + + jexec one ifconfig lo0 127.0.0.1/8 up + jexec one ifconfig lo0 inet6 ::1/128 up + + pft_set_rules one \ + "pass all" + jexec one pfctl -e + jexec one ifconfig pfsync0 defer up + + jexec one ping -c 1 ::1 + jexec one ping -c 1 127.0.0.1 + + # Give pfsync_timeout() time to fire (a callout on a 1 second delay) + sleep 2 +} + +timeout_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic" @@ -678,4 +711,5 @@ atf_init_test_cases() atf_add_test_case "pbr" atf_add_test_case "pfsync_pbr" atf_add_test_case "ipsec" + atf_add_test_case "timeout" } |
