From nobody Sat Feb 05 10:07:21 2022 X-Original-To: dev-commits-src-main@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 903C6198C639; Sat, 5 Feb 2022 10:07:22 +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 4JrSkd5jtTz4j9d; Sat, 5 Feb 2022 10:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644055642; 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=Lu93/wbODQALyIuVPToLlstua2SWHq6XqzoAsb388Is=; b=aAjcHJGR0vFxJWHYpqux2K3XVB49uncKl9vrLLy64/iQFlxG0b+xSh1/aypyrBpLNX/DUO +Utm+N/ZPvovR1ueNdGOgbccSgVQc5i0cQO53RFl6kP8Pyjp21MYBrHyIPMZv8L+JtzSyo 5nx8gTdwFibdxNiSF0Z8QKh7f/GMf+JTmzw89NJ1xz6EcEvFnn8BNpw9nPNwRSf4ldVkD6 nkKG2lSvmXWI52oPNdRijvfVjUFw2NrJqW2SfDwG2eP/WrPW5jAe9xbWKE49dyiHNkWkLk k66/o13hMtpWH0GG1OCcKwZbMhDD3HEbMfs22EzhZNvCYSgDEiSSrAhPXpqu7A== 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 3509C1D682; Sat, 5 Feb 2022 10:07:21 +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 215A7LI1032897; Sat, 5 Feb 2022 10:07:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 215A7Lhp032896; Sat, 5 Feb 2022 10:07:21 GMT (envelope-from git) Date: Sat, 5 Feb 2022 10:07:21 GMT Message-Id: <202202051007.215A7Lhp032896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 109418996514 - main - pf tests: Test adding counters to an existing table List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 109418996514111d887b6790c617cbc7cc3f41a5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644055642; 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=Lu93/wbODQALyIuVPToLlstua2SWHq6XqzoAsb388Is=; b=toH/BIvDvFEgGUIyjktqwtdcA4bdm8gKstAIXMsGyKWRe3kWjEBZ2i0hWcNgh3VnExc3xT EqQQ6v0bQS91uCo97C9Mqh1bQ0KK/aGAqVAE0FDpXQDTjJUwBy+bQc7NrC3H8busNRhw5S QQ2Qs2U59YgPWNDF2XTX7Gt8MrKhLXJNiU6rrfgBQ4ZaQghdxfDUYw0d3V5YXXqnMavZC2 HItReR0XMyC6ALLMxJiJR4K9O4g9jDKX781/z3XMAdsaKeisDXGjoyQEPdllQxalZvxrHf jxhAfy008qVQ3jjlLhhqNIdfmZ7msXkOp7eD1VAWp0+yt7DJL/fpKcP03HatFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644055642; a=rsa-sha256; cv=none; b=JgIaH5fpYnT32kkzR2f5edVIaHnLw5JExmYaB2e4yCzkmBykqFp9vz7idMdJYUviiikYvZ y8OvQ2urHMRaxEClxXjXOP0xg3a7WhLwhwWeucKdiOIh4yE7fUvoWjL0fec7LRXI6kdaff myjTJ0cv3IuNKKjIBe+V/t/N6g4f7p1cr2LCvokJ05HSLGevIeuZnSRjc07or1fF4/dd4T mbIkEZbFl7UbRRYaPhlC2nDjD8qtHObbtXwdCTzAyGb+BvsOcinnJVnwEFyUWGxmCZ/vwX PZ3d9YXxZem4nLWSGacGkf2Q4KT2uZ+LyenDGVxzas/ECGjSYECPHlVJY5NS3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=109418996514111d887b6790c617cbc7cc3f41a5 commit 109418996514111d887b6790c617cbc7cc3f41a5 Author: Kristof Provost AuthorDate: 2022-02-01 17:27:40 +0000 Commit: Kristof Provost CommitDate: 2022-02-05 09:29: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 --- 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 49772706bdd3..9b170b53e9e3 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 "automatic" atf_add_test_case "network" atf_add_test_case "pr259689" + atf_add_test_case "precreate" }