From owner-dev-commits-src-all@freebsd.org Wed Sep 1 13:28:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7794066A6FA; Wed, 1 Sep 2021 13:28:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H04dH0NLRz3QsL; Wed, 1 Sep 2021 13:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2579825EA3; Wed, 1 Sep 2021 13:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 181DSYi4047762; Wed, 1 Sep 2021 13:28:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 181DSYwT047761; Wed, 1 Sep 2021 13:28:34 GMT (envelope-from git) Date: Wed, 1 Sep 2021 13:28:34 GMT Message-Id: <202109011328.181DSYwT047761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 231384bd0c0b - stable/12 - pf tests: Test ALTQ on top of if_bridge MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 231384bd0c0bb6fa7f7d0f0c7d8c607413c4f68c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2021 13:28:35 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=231384bd0c0bb6fa7f7d0f0c7d8c607413c4f68c commit 231384bd0c0bb6fa7f7d0f0c7d8c607413c4f68c Author: Kristof Provost AuthorDate: 2021-08-25 09:08:38 +0000 Commit: Kristof Provost CommitDate: 2021-09-01 07:39:51 +0000 pf tests: Test ALTQ on top of if_bridge Reviewed by: donner MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31676 (cherry picked from commit 062463698eeafc7f75ce22541a244238f37ef2e2) --- tests/sys/netpfil/pf/altq.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/sys/netpfil/pf/altq.sh b/tests/sys/netpfil/pf/altq.sh index ebb28f34c22e..2b5b1828595f 100644 --- a/tests/sys/netpfil/pf/altq.sh +++ b/tests/sys/netpfil/pf/altq.sh @@ -145,6 +145,54 @@ cbq_vlan_cleanup() altq_cleanup } +atf_test_case "codel_bridge" "cleanup" +codel_bridge_head() +{ + atf_set descr 'codel over if_bridge test' + atf_set require.user root +} + +codel_bridge_body() +{ + altq_init + is_altq_supported codel + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + + vnet_mkjail altq_codel_bridge ${epair}b + + bridge=$(jexec altq_codel_bridge ifconfig bridge create) + jexec altq_codel_bridge ifconfig ${bridge} addm ${epair}b + jexec altq_codel_bridge ifconfig ${epair}b up + jexec altq_codel_bridge ifconfig ${bridge} 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + + jexec altq_codel_bridge pfctl -e + pft_set_rules altq_codel_bridge \ + "altq on ${bridge} bandwidth 1000b codelq queue { slow }" \ + "match queue slow" \ + "pass" + + # "Saturate the link" + ping -i .1 -c 5 -s 1200 192.0.2.2 + + # We should now be hitting the limits and get these packet dropped. + rcv=$(ping -i .1 -c 5 -s 1200 192.0.2.2 | tr "," "\n" | awk '/packets received/ { print $1; }') + echo "Received $rcv packets" + if [ ${rcv} -gt 1 ] + then + atf_fail "Received ${rcv} packets in a saturated link" + fi +} + +codel_bridge_cleanup() +{ + altq_cleanup +} + atf_test_case "prioritise" "cleanup" prioritise_head() { @@ -242,5 +290,6 @@ atf_init_test_cases() atf_add_test_case "hfsc" atf_add_test_case "match" atf_add_test_case "cbq_vlan" + atf_add_test_case "codel_bridge" atf_add_test_case "prioritise" }