Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Oct 2020 12:41:11 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r366648 - head/tests/sys/netpfil/pf
Message-ID:  <202010121241.09CCfBOu042120@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Mon Oct 12 12:41:10 2020
New Revision: 366648
URL: https://svnweb.freebsd.org/changeset/base/366648

Log:
  pf tests: Test that 'set skip on <group>' works on new group members
  
  There's a know issue where new group members don't get the 'set skip on'
  applied until the rules are re-loaded.
  
  Do this by setting rules that block all traffic, but skip members of the
  'epair' group. If we can communicate over the epair interface we know the set
  skip rule took effect, even if the rule was set before the interface was
  created.
  
  MFC after:	2 weeks

Modified:
  head/tests/sys/netpfil/pf/set_skip.sh

Modified: head/tests/sys/netpfil/pf/set_skip.sh
==============================================================================
--- head/tests/sys/netpfil/pf/set_skip.sh	Mon Oct 12 12:39:37 2020	(r366647)
+++ head/tests/sys/netpfil/pf/set_skip.sh	Mon Oct 12 12:41:10 2020	(r366648)
@@ -85,8 +85,41 @@ set_skip_group_lo_cleanup()
 	pft_cleanup
 }
 
+atf_test_case "set_skip_dynamic" "cleanup"
+set_skip_dynamic_head()
+{
+	atf_set descr "Cope with group changes"
+	atf_set require.user root
+}
+
+set_skip_dynamic_body()
+{
+	pft_init
+
+	set -x
+
+	vnet_mkjail alcatraz
+	jexec alcatraz pfctl -e
+	pft_set_rules alcatraz "set skip on epair" \
+		"block"
+
+	epair=$(vnet_mkepair)
+	ifconfig ${epair}a 192.0.2.2/24 up
+	ifconfig ${epair}b vnet alcatraz
+
+	jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up
+
+	atf_check -s exit:0 -o ignore jexec alcatraz ping -c 1 192.0.2.2
+}
+
+set_skip_dynamic_cleanup()
+{
+	pft_cleanup
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case "set_skip_group"
 	atf_add_test_case "set_skip_group_lo"
+	atf_add_test_case "set_skip_dynamic"
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010121241.09CCfBOu042120>