From nobody Wed Apr 16 18:02:53 2025 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 4Zd85B4V57z5t28s; Wed, 16 Apr 2025 18:02: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zd8596qcQz3RKC; Wed, 16 Apr 2025 18:02:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744826574; 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=zRA1n+dGbQIeXfz4SgR8wMjMzbd13qjHdjWVGYpNfcU=; b=pWq+/6yBQqMpBbihIPocZB/797b6aE/TttvtxLN8Oo4uW5zey0Q9qiAul84I/V41kgiFSR KvNCxwMELUstm9lVmtv2XEQOyUQ3F3hNSgNl0H0dlSEmtE/fl19HT7G26cPtPV2/tx8MHv oV0WIGwvf36H+nTJ03aAB8UvVTLyguzh9eSMRbP+aIAK4kEmTghDosLTgspa9Afuf/jQYN pGHvvdbm9yu/RSjMhzT32wDS3BPLpWdEVtSVNwATSxa6g+sEdDxNsLJcGrE+xphRuDDIaE FTvKB0k6sBQyeGTVqrVH9Ogw9lF6WMTwxU1jZ6lnCQlSbdVMztHWf1XzBwS+QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1744826574; a=rsa-sha256; cv=none; b=k+vRXnp6XoRi/smx567W2Z4pg5epxjI7/szcKL/1ufi1HRS9y2DIOaoD+jC57s6bMz2I24 Az/V8CnRrZ/QjKbRSm7N8Zyx5BUZOPVDLBskm62pmUd5RTEDcB7RqsBicAIm0aGU4uPnrG YSZxPd6eggSNuxdDWQmH36dTyQ5UtA4hiwT0i/4rC4ByVw3FeBU17levCPjekTdV/Smw9g mmZrBwKD3ceuOP+cAC8f99wx7mRRQb5a0kyqxUZ+TnJAu6S8A7H8/DNElOQ6EFwWqk1J2j mPGFrBwBR/fS9I7mU4SdQQyEQqCee/PLTnnJM4JmSd88X3N5CICOcedLQ7klUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1744826574; 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=zRA1n+dGbQIeXfz4SgR8wMjMzbd13qjHdjWVGYpNfcU=; b=QFCD1Mb15pBWJobnmrfsmvuBKYOD0oB98PWzkxL6E62muNQiMJE+CIYosQR22lyDiIBVsJ EH3LchHB8LF+hvZLsay9RXxm8mYbyO23+iU9YMI5CCIwUN5mi9eiUIfdguXHN8HAEd21ol AR/rRNn84jiKXkc4Wpi4n8oJSCvSK3CwSv5rLwk3MHRpookklif4jmnEYMe2ALrMURvjAW SYKvcQYWP6Ca6FBUPNljMa3psNf5uRCl3Y4k3dOM9ApJauEpROJWmzOlE6OjsYi9b6RSNo vtkItCBvvxaL/PD9+1xeRHMZuB8r35mpo/0nTP1feHpJLl6/tSlGbfPfyeCotQ== 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 4Zd8596QPBz1RpZ; Wed, 16 Apr 2025 18:02:53 +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 53GI2rYV075783; Wed, 16 Apr 2025 18:02:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53GI2rUA075780; Wed, 16 Apr 2025 18:02:53 GMT (envelope-from git) Date: Wed, 16 Apr 2025 18:02:53 GMT Message-Id: <202504161802.53GI2rUA075780@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: 5b13b79a5c3a - main - pf tests: test includes inside 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: 5b13b79a5c3a98c6ed42f5ff049bd26ab8a35c99 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b13b79a5c3a98c6ed42f5ff049bd26ab8a35c99 commit 5b13b79a5c3a98c6ed42f5ff049bd26ab8a35c99 Author: Kristof Provost AuthorDate: 2025-04-15 15:45:59 +0000 Commit: Kristof Provost CommitDate: 2025-04-16 14:23:48 +0000 pf tests: test includes inside anchors Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/anchor.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index 463cd4d475e3..fbac10240d8d 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -361,6 +361,46 @@ nat_cleanup() pft_cleanup } +atf_test_case "include" "cleanup" +include_head() +{ + atf_set descr 'Test including inside anchors' + atf_set require.user root +} + +include_body() +{ + pft_init + + wd=`pwd` + + 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 + + echo "pass" > ${wd}/extra.conf + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "block" \ + "anchor \"foo\" {\n\ + include \"${wd}/extra.conf\"\n\ + }" + + jexec alcatraz pfctl -sr + + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 +} + +include_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" @@ -372,4 +412,5 @@ atf_init_test_cases() atf_add_test_case "quick_nested" atf_add_test_case "counter" atf_add_test_case "nat" + atf_add_test_case "include" }