1# $FreeBSD$ 2 3. $(atf_get_srcdir)/utils.subr 4 5atf_test_case "set_skip_group" "cleanup" 6set_skip_group_head() 7{ 8 atf_set descr 'Basic set skip test' 9 atf_set require.user root 10} 11 12set_skip_group_body() 13{ 14 # See PR 229241 15 pft_init 16 17 vnet_mkjail alcatraz 18 jexec alcatraz ifconfig lo0 127.0.0.1/8 up 19 jexec alcatraz ifconfig lo0 group foo 20 jexec alcatraz pfctl -e 21 pft_set_rules alcatraz "set skip on foo" \ 22 "block in proto icmp" 23 24 jexec alcatraz ifconfig 25 atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 26} 27 28set_skip_group_cleanup() 29{ 30 pft_cleanup 31} 32 33atf_test_case "set_skip_group_lo" "cleanup" 34set_skip_group_lo_head() 35{ 36 atf_set descr 'Basic set skip test, lo' 37 atf_set require.user root 38} 39 40set_skip_group_lo_body() 41{ 42 # See PR 229241 43 pft_init 44 45 vnet_mkjail alcatraz 46 jexec alcatraz ifconfig lo0 127.0.0.1/8 up 47 jexec alcatraz pfctl -e 48 pft_set_rules alcatraz "set skip on lo" \ 49 "block on lo0" 50 51 atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 52 pft_set_rules noflush alcatraz "set skip on lo" \ 53 "block on lo0" 54 atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 55 jexec alcatraz pfctl -s rules 56} 57 58set_skip_group_lo_cleanup() 59{ 60 pft_cleanup 61} 62 63atf_init_test_cases() 64{ 65 atf_add_test_case "set_skip_group" 66 atf_add_test_case "set_skip_group_lo" 67} 68