From nobody Mon Nov 18 17:58:23 2024 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 4Xsb2m2Cgtz5dNbw; Mon, 18 Nov 2024 17:58:24 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xsb2m1kk6z46sP; Mon, 18 Nov 2024 17:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731952704; 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=OCYFnezNqDrIcn45WMfmqjSoZnPeGN60IbKi2HXIOGA=; b=yjTvvh9P4lvJqCOLuogiDdPMcuNUTbIYFKOvu4vbFbipjwCylVG5Ct9iEg+cPnfGXMuVXw 28qCpSCsq0j/xQ79OTDqCok5QQggVV718yJTeLktGHLmZqQW78+4GpfO5vG1oTq6KEFM1B GSweUrkqOhVprBfxls88IeGdRKs6UxseVRNpvZUdvtedET4V1l6/kVDlhOAhvJ1AIba5fj 2yKA9djcZ7EQfRVKW8NEauVzZ0iHkU1DK4/PVwaMZhWEgLpFAHTvTMJ1A9gJBBJu2C+O4N UaX9md8zHkqroeYspG9sXSAkOu49rFj4rxJluMSTcXtaEiYZ2tLGr7aKL2DPnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731952704; 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=OCYFnezNqDrIcn45WMfmqjSoZnPeGN60IbKi2HXIOGA=; b=B/uk/A8A8V/rkDxW52q9Gom3PlQmVpNCClpjOmrfuauGhuWedxNk9H0XRq36lHhkOhXrAD 4RPH1pD/h669YemWLDQ5gGyYH5NfN1XEW05Se85Ve3OZsMQMBtpUTHCPUK7gNnZ3ry6dw3 abJeO/lFh+VHQrUJDCl7DyQjgr1IfYbJHWXPQkhGU9OoVvjW9ygxwSswPZSM0rCWqH3QrF /md8kn8pJm+rUxTQQIHhz1w8AEvOd0mLxVjaMwL287pD9/whMcwCcHQc2+rnAdIM3ipXUE lS71JGu3gVKoU+njI4GfxkAdnm26xL1ZYLKrj+d7ECYN+tEdlLRf68F0rzlzEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731952704; a=rsa-sha256; cv=none; b=uPITMG3mX9mhIWZQTk0ZwuOZ47XvuwYCTarQeWwQ7SO25okGgj6BE0nWeASzvEP7Kl/q7A fIb+bzU6VxNqUddY2uZGq2VGxOvkMJguZQyLmTB24uXljCUJmfAazMBFLP/+Ce7Omjk7oq gxI8DTVSonbpYVJ/dJBKnhh42+RoSfBZCmUwSy5RJ3SImRjwJuV/1m9L5Tys7IBPgwCP/v Z56SsPsjnqM2uCYkGXz5uM5wN+zHoFOA3Zoke/7I7EtLlJr8cf1an62bNqXKeUnYTNOzTy UMsNz0DT5CZuQAkGDfSpUf4xvQBj98loXNyVcVTresxzKLUuQU7jN3rusNTBhg== 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 4Xsb2m0x9Rzqyg; Mon, 18 Nov 2024 17:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AIHwNYu038235; Mon, 18 Nov 2024 17:58:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AIHwNYY038232; Mon, 18 Nov 2024 17:58:23 GMT (envelope-from git) Date: Mon, 18 Nov 2024 17:58:23 GMT Message-Id: <202411181758.4AIHwNYY038232@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: 5eee34fa0351 - main - pf tests: check counters on anchors 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 5eee34fa0351f1fdb240f7d085145c05e9ed95d5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5eee34fa0351f1fdb240f7d085145c05e9ed95d5 commit 5eee34fa0351f1fdb240f7d085145c05e9ed95d5 Author: Kristof Provost AuthorDate: 2024-11-18 13:40:01 +0000 Commit: Kristof Provost CommitDate: 2024-11-18 17:57:53 +0000 pf tests: check counters on anchors Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/anchor.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index 25d9d5b6df03..847f8d4f6dab 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -233,6 +233,44 @@ quick_cleanup() pft_cleanup } +atf_test_case "counter" "cleanup" +counter_head() +{ + atf_set descr 'Test counters on anchors' + atf_set require.user root +} + +counter_body() +{ + pft_init + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}a + + ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "anchor \"foo\" {\n\ + pass\n\ + }" + + # Generate traffic + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + atf_check -s exit:0 -e ignore \ + -o match:'[ Evaluations: 1 Packets: 2 Bytes: 168 States: 1 ]' \ + jexec alcatraz pfctl -sr -vv +} + +counter_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" @@ -241,4 +279,5 @@ atf_init_test_cases() atf_add_test_case "wildcard" atf_add_test_case "nested_label" atf_add_test_case "quick" + atf_add_test_case "counter" }