From nobody Thu Mar 24 13:15:53 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 8D0841A39CFF; Thu, 24 Mar 2022 13:15:54 +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 4KPQhV1Fvxz3NT7; Thu, 24 Mar 2022 13:15:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648127754; 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=je62nAws4SsnAePomVzIwOJTiwmhhjeUd0C4nw45Mtw=; b=BdJbTRNLZCMpNZFy97SQZ2AqEYDOiOtLUP3XNwquCwsU3Y/yQ/zS3mQExHWPzASWbmiN7R +kZRaECYAayzMgumwib6Y0Lv2J0N6S0KE8v3NACDNkXTnGQBwfTVZVkghqe2/fXiiTLVka h9HpTcmStjU2ZanKIM4i7QjARbszzpGFYjAeqPD8CTSlFAgarAAiQpPy6xnG5olJlVmyPZ 5PlvaO/yjPHjnBGQE6BWUzzHWyT2RdMEuaqLeoeKMTxhTiGq1fUvo3eZ4ZyTCPUchcByqB XaZwzVoedi9UdjAFL24/YfNMsag4EPvv6le7bYqABEeaev4EzKdRDPVokdjHnQ== 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 06A511890F; Thu, 24 Mar 2022 13:15:54 +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 22ODFr8b032417; Thu, 24 Mar 2022 13:15:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22ODFrjd032416; Thu, 24 Mar 2022 13:15:53 GMT (envelope-from git) Date: Thu, 24 Mar 2022 13:15:53 GMT Message-Id: <202203241315.22ODFrjd032416@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: 10d71d02cfb2 - stable/13 - pf tests: Test retrieving nested nat-anchors 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: 10d71d02cfb2203220b06abe224bb514aa3d754c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648127754; 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=je62nAws4SsnAePomVzIwOJTiwmhhjeUd0C4nw45Mtw=; b=MnFUWKPkClK3i3Ndf6ieMIGrgfPaD8rSKhI+Qk5ORNtEz86KNtueAy0uRS0EocygoQ4zMn +aMs4d2qajZK02fJjqMWcQBZTQn9MQ/hCR5kkLWzoU7dcVJdUrodvH/TmGlPP5nOr50lu9 51WRNOoOuMm7cUCoxZtcqWeWiOfjn9T556UzN4OZkke0xv2f2ig4ipEVTYFBPuSNXi/Kyu RvWNKT4TXGxfi8blZrU6+ZeNTlLi4qA1XOKbgX8Dnu1xdbP2XySo+oSzfWfCO3UQf6B0WH 01A1z5Ix1JwL/TMDZsr/mQ5xU/2wSmWKeT1ITwyDZM1vljDojdxwTNgsHzGALA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648127754; a=rsa-sha256; cv=none; b=T93JC6u+QMo2ttONueHFYmwH9advrjmZ6fKmRhbWIQvk0leouUW7imSc0I3vLndyl0VK2l Clg+csP/E4agE5QcruFHWGMbO4LYhsUr+Femoixz9UoEVIR7tiLF/enSBXYvkJ8xn7xa/i 0Pd05XJhu3ZH4EULwtNowDi3v9GqKg7OhEfKhh2LZj86GcpIMFJ8jhbMkf3nTJ/G1Y6X+L O2HFVoy35N1/UhE1hPJZfmVtqHlYYv0hz+EL0RrDl8u0epPhChW1dzsIwwJ9qe2j6FJ9by XU6Cy1ab3RPLjjhLGiLGDP8U3of8xf/73nnOViYsTIq+d6N/XIptTsF5c2cyuQ== 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=10d71d02cfb2203220b06abe224bb514aa3d754c commit 10d71d02cfb2203220b06abe224bb514aa3d754c Author: Kristof Provost AuthorDate: 2022-03-17 17:33:50 +0000 Commit: Kristof Provost CommitDate: 2022-03-24 09:44:54 +0000 pf tests: Test retrieving nested nat-anchors MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 3c3a19d1f42af049e798b193d4fd2a872c7c8fec) --- tests/sys/netpfil/pf/nat.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index 3fabb32db80f..a957dfd59c78 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -84,7 +84,43 @@ exhaust_cleanup() pft_cleanup } +atf_test_case "nested_anchor" "cleanup" +nested_anchor_head() +{ + atf_set descr 'Test setting and retrieving nested nat anchors' + atf_set require.user root +} + +nested_anchor_body() +{ + pft_init + + epair=$(vnet_mkepair) + + vnet_mkjail nat ${epair}a + + pft_set_rules nat \ + "nat-anchor \"foo\"" + + echo "nat-anchor \"bar\"" | jexec nat pfctl -g -a foo -f - + echo "nat on ${epair}a from any to any -> (${epair}a)" | jexec nat pfctl -g -a "foo/bar" -f - + + atf_check -s exit:0 -o inline:"nat-anchor \"foo\" all { + nat-anchor \"bar\" all { + nat on ${epair}a all -> (${epair}a) round-robin + } +} +" jexec nat pfctl -sn -a "*" + +} + +nested_anchor_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "exhaust" + atf_add_test_case "nested_anchor" }