From nobody Mon Jun 20 09:09:09 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 754608767DD; Mon, 20 Jun 2022 09:09:10 +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 4LRP3B1P0hz3C85; Mon, 20 Jun 2022 09:09:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655716150; 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=lBEAgPO1UgzTY00Lj5cf/5S/+SV9pV/NfpZU6lyNI8k=; b=vXwtZn4fKlsuUBPjuI6mw9Lgvxgusj/BN2900CMyJiregaY8xRCKmYJ4R+p5roXIEwAabX CY0DIkby466FPh9VHZ3GQTflmn3X9+xMuGS/5kgwRZwTm7/yOkzv+0kQZlkzS5jf52uoMD ZjdaqQbXLT8EuKbzcCI9q6nIMIXJ750thYeTPQaUyHExZ5stnMXNXrzU/kUaeA+lXf/hrq gCRCnUzq+HQfPWxNtUKd6pufWh6LnbsmN82P5zFmvE8Zza/zLIZ2rwJBm2QZMItHkICAsA GhwCEVqAcAEUaoOh0Hcx1Cskm6NJVMbX0PV+OPY3lACUvkQvctmy+o4MBM0jNg== 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 E8F301A5BE; Mon, 20 Jun 2022 09:09:09 +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 25K999nV004545; Mon, 20 Jun 2022 09:09:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25K999TK004544; Mon, 20 Jun 2022 09:09:09 GMT (envelope-from git) Date: Mon, 20 Jun 2022 09:09:09 GMT Message-Id: <202206200909.25K999TK004544@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: 3fccdfab6430 - 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: 3fccdfab6430e8c415dfa6d0be04d5ebcd121429 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655716150; 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=lBEAgPO1UgzTY00Lj5cf/5S/+SV9pV/NfpZU6lyNI8k=; b=jiaz2tvXD7iYQVJHz74dkOAKy3xoUlMCiayY6tDG8XdUzbQ3PeAMELTYv0TFIl6ny0htnx +2XwTLNB7Sf7JqmWgEcKpkzlGa6UBJ3eSwMk/NwybBbS6bv9SVf5I2PAKkMObQ83C15aTD +3eREWv65tPxV88p9AR75d7NyuxlsfSSAhEqoJll5O5PCdZNqW3Hy5Es2q/1W684qOet6W LfI2EVNfyjVL7BfRHy/uR2SpFuvoCMnBM0exo8al7CXDXH691Kdw/YJFHCevQj+EEqzVQ1 MN1iQGUW6uVJVageftsGah5guxSkAzzgoMsPyruF3QyO5O90Ul4f6SobLIY0Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655716150; a=rsa-sha256; cv=none; b=Rwa7TWzvRfcN3m5Rsd5SxwLSU1vzfn1EyTcWdoal65pgD9F/sSLWYHK7L+dGoflKslc+TI Pwl1x11tCr9tsj4yGzu3NdcINsRrEaxl8ciXvRlfv/x5s78SX5eeDecSGqsemO9W/aNyZ1 QQZu3j9S4n0gRchgMfGPalVQbc+7L0Cdht4twtvVuZAnmuhMPtq1LovKqvJtqevTL4fZCK f66JjefrkbyqoG7tk01t0c/D1zdRr24lvlO89ora9B4JEv0LbnkwOnpJBuUJMbVOC1Pfdl 6wbRUV6KvbFPjntC0xTxJO4OzZa84Qoe+bAEUD7ag4s+L0aynFs+w1n6DLvrJQ== 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=3fccdfab6430e8c415dfa6d0be04d5ebcd121429 commit 3fccdfab6430e8c415dfa6d0be04d5ebcd121429 Author: Kristof Provost AuthorDate: 2022-05-31 12:55:15 +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/D35364 --- tests/sys/netpfil/pf/ether.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh index dc580b234c39..283267b98c54 100644 --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -553,6 +553,46 @@ ip_cleanup() pft_cleanup } +atf_test_case "tag" "cleanup" +tag_head() +{ + atf_set descr 'Test setting tags' + atf_set require.user root +} + +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 pass in tag foo" \ + "block in tagged foo" + + atf_check -s exit:2 -o ignore ping -c 1 192.0.2.2 + + pft_set_rules alcatraz \ + "ether pass in tag bar" \ + "block in tagged foo" + + # Still passes when tagged differently + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 +} + +tag_cleanup() +{ + pft_cleanup +} + atf_test_case "match_tag" "cleanup" match_tag_head() { @@ -604,5 +644,6 @@ atf_init_test_cases() atf_add_test_case "dummynet" atf_add_test_case "anchor" atf_add_test_case "ip" + atf_add_test_case "tag" atf_add_test_case "match_tag" }