From nobody Tue Dec 17 10:08:09 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 4YCCDn3fHmz5h0p2; Tue, 17 Dec 2024 10:08: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCCDn1Xtyz4BHB; Tue, 17 Dec 2024 10:08:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430089; 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=Q67e3Nf5b/VJTvnZN6gwLpBFva4CR4wfUgWHCcDunxU=; b=qS+lNlZBuFbkxdKbRkr0wjea8t34vupxbcrxcPrEfQKhuAURPgn7nKR24EcH4XUzA/wXF3 uMit1ZWaoZTCvQ+fLmwq12a8ieEpsHc7vbOPfz9uTlcm8uc7AVdEAst7CPfpVbS0NAPLyi rmZTFEO2xfY79lyxmYcl6MMsN7AMkSJmPoh4oQcaENNhDTi3JQufmBL7Lr5qnuZVx+0F0w W3vngdAbvA9hZLglhXsy1fIOo6EFo+JtorpurbUxOb5vWPP22svgewOSCoSQ2uj5uiQqq8 HC6A2HfJm/0IFH0xsC5b6DQj7clSXH8ixCc4LIydNgOsJXJXc/ds9sm1SNQuPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430089; 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=Q67e3Nf5b/VJTvnZN6gwLpBFva4CR4wfUgWHCcDunxU=; b=SE/BK/jHeBT70wrPiVlHqUTQPx8ZuC0yKatHfF1TckpSFij5gJS2GIACjcCZVPHm1CRR17 kd1khln1BbRfVjNTWXmFpPK+fSbfXgA2+kKF24NCwxYELYYcONQaUB37IPgbZ1NBzoGkDM gGp1Dje7y/SVNYEbKKWnmt4SJZJfX5sqsQeRLahd4HU0zw1b5J0klWxRfozsa8Jh8V0ZTJ 2QjIdOVXtMEKNPgoUnOeZPn+UIzFchNEvbFY5XUvoGiOqbPm9jesT5waIYYJNfd6ElwLNN 5yr7kAa4EbW8FfHCsRZnP4OkfgGuioCqc5vzUFqlMf+jVVzEBgs6A1zQ05DKQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734430089; a=rsa-sha256; cv=none; b=Q3oFHZhWIoXt3d13WM2Hn6IuZhvVjARGQbAx9/sZK3OMjbOdJT6cGQOC2r3iuheay4gZNH Rt28PdgfqaJp5XXCfgvkVLu/wyxCVbbEkUxrt+aMTIjFKpqIo11TJ+GGpoThbx7wG4mHJg AjTA8QpXR3KWinn7d0Agn1OUob35F7AxYzGZxfEmOJRlyI3IdzrHCNkFXQZ19tBnjEi2P9 BSBSo1ScWoIOWsTY9DqDRfSVX3lXEnxhj5uNs2ZEW0vX1rqpnamV3RiNRTWSHk0pYWZTA5 QGA0EF+nBoE8ixlRkD7WOvdVgEHzkf4cpivAzUDnRtxUSIINeqwlc/Mhvrxo3g== 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 4YCCDn102PzJVP; Tue, 17 Dec 2024 10:08:09 +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 4BHA893f024653; Tue, 17 Dec 2024 10:08:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BHA89WQ024650; Tue, 17 Dec 2024 10:08:09 GMT (envelope-from git) Date: Tue, 17 Dec 2024 10:08:09 GMT Message-Id: <202412171008.4BHA89WQ024650@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: 27fca15016a9 - main - pf tests: validate ToS translation with nat64 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: 27fca15016a90f0d044176ba5f8f5b0fa91469ba Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27fca15016a90f0d044176ba5f8f5b0fa91469ba commit 27fca15016a90f0d044176ba5f8f5b0fa91469ba Author: Kristof Provost AuthorDate: 2024-12-02 17:01:42 +0000 Commit: Kristof Provost CommitDate: 2024-12-17 10:07:17 +0000 pf tests: validate ToS translation with nat64 Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/nat64.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 9e91e95570c1..c1202dfee2e8 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -203,6 +203,38 @@ sctp_cleanup() pft_cleanup } +atf_test_case "tos" "cleanup" +tos_head() +{ + atf_set descr 'ToS translation test' + atf_set require.user root +} + +tos_body() +{ + nat64_setup + + # Ensure we can distinguish ToS on the destination + jexec dst pfctl -e + pft_set_rules dst \ + "pass" \ + "block in inet tos 8" + + atf_check -s exit:0 -o ignore \ + ping6 -c 1 -z 4 64:ff9b::192.0.2.2 + atf_check -s exit:2 -o ignore \ + ping6 -c 1 -z 8 64:ff9b::192.0.2.2 + atf_check -s exit:0 -o ignore \ + ping6 -c 1 -z 16 64:ff9b::192.0.2.2 + + jexec dst pfctl -sr -vv +} + +tos_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "icmp_echo" @@ -210,4 +242,5 @@ atf_init_test_cases() atf_add_test_case "tcp" atf_add_test_case "udp" atf_add_test_case "sctp" + atf_add_test_case "tos" }