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 BE11719CCFCE; 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 4K19kh18S5z4f5D; 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=gZYB+6E+TcjOjqu6bl3CTmwB7R+wGXMT+yoG8ewryHE=; b=ReS8gMOwpxF5JemHbbJgKwnfmicVXqfAG443iRL8OFQ2Qjx02cwCbPFoGr7gAjccMS+1N+ vsYx3NKrdYzkx/JWvSieTLuiJficzYIncfY3UbJpxOT5eiwHPipLFXD+3tzLa0CdPpEYTG znoZbslHfCq8GyiOsosbp0r7uBibKzs8e9BOJ9okvPA8ijp8tDodS+1QaNPpcWTOJW/TW7 TmDobZ/OLM+X+SERO+AZeA7rHGH/fh3PagGEmBbedVdkME08X3JqXq8NfZjDG/nTg6PzXv Ddv+XJ4m6onbP0IWwNRIxtWoXEPcFiB8R8X2x3uT6Cyiw2l8uER0nWSebSqqkQ== 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 D15772556; 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 21JEMZel071864; 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 21JEMZit071861; Sat, 19 Feb 2022 14:22:35 GMT (envelope-from git) Date: Sat, 19 Feb 2022 14:22:35 GMT Message-Id: <202202191422.21JEMZit071861@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: 79a0d63986a1 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 79a0d63986a1efdbff8e568719ea15527cf12610 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=gZYB+6E+TcjOjqu6bl3CTmwB7R+wGXMT+yoG8ewryHE=; b=ZqFoBKq3lSKIavNj6H0y3ytO+Z/gDUjz6xrpkoguHrndotFMHN/SG1j6uXOZ887lMSyvgm wYnQ6T8eN682jmGAnTFq2qyr5Q/ybmCB7aYONI+qZw522Az2cYNhM5qW8tf/XWE982/PdN 94dXA6nTKPNSrjYV4penJ2iXg2UdK1/th+s8YxXU1HTvVtPlQOxEhO0XUsHNsJTA7ddAq0 umkB5vFwLKm/txcbCSaBBP56cW92vzudTwOeqsLA4Sv5yqI5IvKDouLOQZ+HKGrXy2fQwd IyUHJNxhC9isnxp9yGtgvKfZbIuEPrqtJ00Kq/Inn8rQF5LZnaVuOY7mgrnaqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645280556; a=rsa-sha256; cv=none; b=lR5Wpk9q95CjEx1Hg8jHZaluwnkC+RLWrkgHzSeyc+NhGrL/Bok7ijV4aOQArfG7PuyN1C +uxdLpNg/fCSl7rzwQgP9hDDJlh1nC25ZTQw6SdLw48hVytzE4wcWc+pb6/zCwH/p1yUhi Y9JDx1D+IvhkXa13c0alM3Vo2SvDCqgwjTZI5PUj4gIdpXurfnDmICPVeqYvhBA2HBxDcW rx6DbXbjuARGApXYHBWIXPDrWZbpjPRuCI1jqE2tKIgeoOUiadmlj1UFd/sl22YjjWEHRe yaR4G8z2BsEIgpkMqVn5gw5o4eRDK9OGg0TwaNkuhxSEHZolWJpQZuwnAeQYPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=79a0d63986a1efdbff8e568719ea15527cf12610 commit 79a0d63986a1efdbff8e568719ea15527cf12610 Author: Kristof Provost AuthorDate: 2022-02-01 17:27:40 +0000 Commit: Kristof Provost CommitDate: 2022-02-19 08:43:33 +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 692d622bd86a..320522eaacbd 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" }