From nobody Sat Feb 19 14:22:35 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CB79819CCC74; Sat, 19 Feb 2022 14:22:36 +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 4K19kh14hSz4dj0; Sat, 19 Feb 2022 14:22:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645280556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s8Ztxmz5qWZCNSiL+Utpcv7jqImJNJ5AWzqD6/0qrtU=; b=efHGOAz+810dFlT+1CRbpIA1Sq23ooHoHEWl9BzLuskTDtRopTS29s3IUsRU07gLdzu/Lx XR1K1BmnLBRDDPzGP/NZJZ6VwVwWJBTErOur7VW2DY8NzzL5Aj9yyGZLwo/YwD8XaxwyVw ihRE8eh5OaQcuM2hq2H/fwrXbm7fHZBQUoOrbcewkUe4DpFdjOmRnW964d9+CJg3IVqERP SCqZeNb8TFVwv3DiImyKTOdjOetyAewHEzAIVhPP9hKgIaEjfQ/b7qMd2QEraiJK0mL4Kw M4s1w0yND7yij40Hw/9G65IEXFjMotDW0LTJ6SwlPMKWlUbwcV86v7L6eFMCPw== 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 D0F132895; Sat, 19 Feb 2022 14:22:35 +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 21JEMZT2071863; Sat, 19 Feb 2022 14:22:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21JEMZ3c071862; Sat, 19 Feb 2022 14:22:35 GMT (envelope-from git) Date: Sat, 19 Feb 2022 14:22:35 GMT Message-Id: <202202191422.21JEMZ3c071862@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: ef4108f7c0ee - stable/12 - pf tests: Test adding counters to an existing table List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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: ef4108f7c0ee086cf74a5d5876bb87aa68fe553b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645280556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s8Ztxmz5qWZCNSiL+Utpcv7jqImJNJ5AWzqD6/0qrtU=; b=Vtj6vtxmt8nz2XlZ0u7ooqJvQXWZHSSFj6dkgNKyzIFAAXqIJOZHlA3J60dGSCV/myNHu/ NgQF38yrx7Lfl8Z9aG4T3xwmm9JlxmCLXcUTNHrU6TpH3K5OXYXK2ShpwhX2m49iakCaUp F2qXXca4D0oGnTc7fBP2y3KkHALij6yRc+xEXDXv0XJ4rwUUSAdxMqPhUd1H168OiTwGbl EM64zySS1BpzAjULRowWFJTGbzlcNz4c7CfcC4jLuLGDKrdSPrTk46TvJvmeJ5qIle/LXU 0NuVFiIXImtNA8p9ZAVtNUj7P93Ny1zHv4filOpw+drlh3hNflRyBmRVrJOwAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645280556; a=rsa-sha256; cv=none; b=XQ6L1TLfTGxYFzwMHCRfkzM3g0BXTJZFDlqyA1cVF5fmDQdOdF8A2t7kI4rqSpv/odPV8e FglWr6fgDTgPVFnz7GMs9vpMXWEqDdblXOtxMoDRDu+vmYrMP9OOxzV+tiKUFNyN+l0+Ss e989bwlFNS5HsWN7dTCysu0DuXeHsFgO4zUHLBmUnlp6a7ngdJPO6UUyLr6uZBc1anFmbT bDOv79LLmHQOV/vMTALi2yvWiBEyXky2CNO6yFdLQOw3zHui9AC81ZuvIcZWNRfk9GjtX+ Os2NBBQj35IuJz/RY/GNuXPOhKNSinXX3wpHJRnhdbZoPseBdnf6iBLvnpGVCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ef4108f7c0ee086cf74a5d5876bb87aa68fe553b commit ef4108f7c0ee086cf74a5d5876bb87aa68fe553b Author: Kristof Provost AuthorDate: 2022-02-01 17:27:40 +0000 Commit: Kristof Provost CommitDate: 2022-02-19 08:43:34 +0000 pf tests: Test adding counters to an existing table MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D34132 (cherry picked from commit 109418996514111d887b6790c617cbc7cc3f41a5) --- tests/sys/netpfil/pf/table.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index 41ff4e3da84e..e6b8a8bb6d0f 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -242,6 +242,42 @@ pr259689_cleanup() pft_cleanup } +atf_test_case "precreate" "cleanup" +precreate_head() +{ + atf_set descr 'Test creating a table without counters, then loading rules that add counters' + atf_set require.user root +} + +precreate_body() +{ + pft_init + +set -x + vnet_mkjail alcatraz + + jexec alcatraz pfctl -t foo -T add 192.0.2.1 + jexec alcatraz pfctl -t foo -T show + + pft_set_rules noflush alcatraz \ + "table counters persist" \ + "pass in from " + + # Expect all counters to be zero + atf_check -s exit:0 -e ignore \ + -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'In/Pass:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Pass:.*'"$TABLE_STATS_ZERO_REGEXP" \ + jexec alcatraz pfctl -t foo -T show -vv + +} + +precreate_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4_counters" @@ -250,4 +286,5 @@ atf_init_test_cases() atf_add_test_case "network" atf_add_test_case "automatic" atf_add_test_case "pr259689" + atf_add_test_case "precreate" }