From nobody Mon Jun 20 09:09:08 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 2431287699A; Mon, 20 Jun 2022 09:09:09 +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 4LRP386ydbz3CFs; Mon, 20 Jun 2022 09:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655716149; 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=3V1UKnNnXQdYpkNkt+rzvujk5UjtMaK1ApD7BTxbXow=; b=ffOdvvV5tijzSfTDz1MTeaHYHt4kHTT5wKA7ihIn8hGa2gK8bFPO/RVKiROhGcJz5WoRju nqm4sTB27SzbOC+y07UbgAMnA+2Rc+5OyiTQ2Hr4rys8yGW4bhV439XRN+3+EF9GG77Eil ss8jjlp2odv6xA4FnmUr/hwDBSeHiavOxqU0z+c3oX3FI9qENBU1y2UqbmpjQuJ4C8kTPa alBiE0mwL/5eyIz8tfrH/dZlXB/5pdNaW4Z87i4dkhoxWtjLr25RJ1Y8uRNJj4aqCEhkQC X4mUH50mzCoD417T9bOdz9ZLKCB5kOdEwYbD3r96v6NePz0d99rpbCLHT3Fgjg== 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 CBB761A5BD; Mon, 20 Jun 2022 09:09:08 +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 25K998GM004521; Mon, 20 Jun 2022 09:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25K998ff004520; Mon, 20 Jun 2022 09:09:08 GMT (envelope-from git) Date: Mon, 20 Jun 2022 09:09:08 GMT Message-Id: <202206200909.25K998ff004520@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: 7b271afd6277 - main - pf tests: basic 'tagged' test for Ethernet rules 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: 7b271afd62777ea81e96914d143905fc047e9a08 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655716149; 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=3V1UKnNnXQdYpkNkt+rzvujk5UjtMaK1ApD7BTxbXow=; b=MiCUmrdg/OjBSzq9rDrgOqWD9dTHaQyFTuPIa9XdQNPBXjleJk6jFDfWH5e4cvNq46otDL j5yual+tbk0ohqtzw5GDsU1SrwDgjof7owinZuz+7ibvWfzceLKIm4WJQmHTX+zWaE0myv MZ/DMnVHw3W8R9Rt42z+OnqWqewmn+UUYvulIVT1vfmF9++lh6kkb4qfxCqsalQ7AVCy8+ zWbfeDNhNRfstbkZa7lEJjhpTG8lE2fIPA3mODLJDtGqKMfFrjup+4vsQO2lncyKV7DpYx PIvqtbjPXv+AT1/OF5WcveH7oAs2Kkc06G8WopS5w1+/49VHC4SYNiaasY8sHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655716149; a=rsa-sha256; cv=none; b=W28mm5rueEmjKyTELvEXKdVahwD+oPLtHbB7TaiZnzZNfuqVERaCofQKgVUvkyEzAhjUo3 1VXEyxy/ShXPiVgZJj51Tjh90lNptMssPnh8AlLtfBWZ8Zn3qfVrpgslCqzKE4G4EK5dV/ fxLg+OotR/+Nzvc8tQgcVruJUohkmaYocKSP/gnBTtSTvbJVHaH86Gv29NxFvazZ7SqYwt /J1S9T0VBoJ4mWz/cQl677GeR6zP2xOzx2U31Ys/yI54SFA3h27xC5tarZaMstinB5nmMY KZcEBZLCMXR7In8+AyAQKFx8jvrX3Ce7SfOoztA2dSOPIIwzdALSDmCyyY8M+Q== 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=7b271afd62777ea81e96914d143905fc047e9a08 commit 7b271afd62777ea81e96914d143905fc047e9a08 Author: Kristof Provost AuthorDate: 2022-05-31 12:40:05 +0000 Commit: Kristof Provost CommitDate: 2022-06-20 08:16:20 +0000 pf tests: basic 'tagged' test for Ethernet rules Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D35363 --- tests/sys/netpfil/pf/ether.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh index 7a8b9e0d9b38..dc580b234c39 100644 --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -553,6 +553,47 @@ ip_cleanup() pft_cleanup } +atf_test_case "match_tag" "cleanup" +match_tag_head() +{ + atf_set descr 'Test matching tags' + atf_set require.user root +} + +match_tag_body() +{ + pft_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "ether block out tagged foo" \ + "pass in proto icmp tag foo" + + atf_check -s exit:2 -o ignore ping -c 1 192.0.2.2 + + pft_set_rules alcatraz \ + "ether block out tagged bar" \ + "pass in proto icmp tag foo" + + # Still passes when tagged differently + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 +} + +match_tag_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "mac" @@ -563,4 +604,5 @@ atf_init_test_cases() atf_add_test_case "dummynet" atf_add_test_case "anchor" atf_add_test_case "ip" + atf_add_test_case "match_tag" }