3 . $(atf_get_srcdir)/utils.subr
5 atf_test_case "basic" "cleanup"
8 atf_set descr 'Basic pfsync test'
9 atf_set require.user root
22 epair_sync=$(vnet_mkepair)
23 epair_one=$(vnet_mkepair)
24 epair_two=$(vnet_mkepair)
26 vnet_mkjail one ${epair_one}a ${epair_sync}a
27 vnet_mkjail two ${epair_two}a ${epair_sync}b
30 jexec one ifconfig ${epair_sync}a 192.0.2.1/24 up
31 jexec one ifconfig ${epair_one}a 198.51.100.1/24 up
32 jexec one ifconfig pfsync0 \
33 syncdev ${epair_sync}a \
37 jexec two ifconfig ${epair_two}a 198.51.100.2/24 up
38 jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up
39 jexec two ifconfig pfsync0 \
40 syncdev ${epair_sync}b \
48 "set skip on ${epair_sync}a" \
52 "set skip on ${epair_sync}b" \
55 ifconfig ${epair_one}b 198.51.100.254/24 up
57 ping -c 1 -S 198.51.100.254 198.51.100.1
59 # Give pfsync time to do its thing
62 if ! jexec two pfctl -s states | grep icmp | grep 198.51.100.1 | \
63 grep 198.51.100.2 ; then
64 atf_fail "state not found on synced host"
73 atf_test_case "defer" "cleanup"
76 atf_set descr 'Defer mode pfsync test'
77 atf_set require.user root
92 atf_add_test_case "basic"
93 atf_add_test_case "defer"