From owner-svn-src-all@freebsd.org Sat Aug 11 16:41:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5036A10734E2; Sat, 11 Aug 2018 16:41:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 063D38866F; Sat, 11 Aug 2018 16:41:08 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBFD419D9E; Sat, 11 Aug 2018 16:41:07 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7BGf7qe028871; Sat, 11 Aug 2018 16:41:07 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7BGf7Yb028870; Sat, 11 Aug 2018 16:41:07 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201808111641.w7BGf7Yb028870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 11 Aug 2018 16:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337646 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 337646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2018 16:41:08 -0000 Author: kp Date: Sat Aug 11 16:41:07 2018 New Revision: 337646 URL: https://svnweb.freebsd.org/changeset/base/337646 Log: pf tests: Basic test for 'set skip in $groupname' This tests for the problem reported in PR 229241, where using a group name in 'set skip on' did not work as expected. Sponsored by: Essen Hackathon Added: head/tests/sys/netpfil/pf/set_skip.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Sat Aug 11 16:40:03 2018 (r337645) +++ head/tests/sys/netpfil/pf/Makefile Sat Aug 11 16:41:07 2018 (r337646) @@ -10,7 +10,8 @@ ATF_TESTS_SH+= pass_block \ fragmentation \ set_tos \ route_to \ - synproxy + synproxy \ + set_skip ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ Added: head/tests/sys/netpfil/pf/set_skip.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/set_skip.sh Sat Aug 11 16:41:07 2018 (r337646) @@ -0,0 +1,36 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "set_skip_group" "cleanup" +set_skip_group_head() +{ + atf_set descr 'Basic set skip test' + atf_set require.user root +} + +set_skip_group_body() +{ + # See PR 229241 + pft_init + + pft_mkjail alcatraz + jexec alcatraz ifconfig lo0 127.0.0.1/8 up + jexec alcatraz ifconfig lo0 group foo + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set skip on foo" \ + "block in proto icmp" + + jexec alcatraz ifconfig + atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 127.0.0.1 +} + +set_skip_group_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "set_skip_group" +}