From nobody Tue Dec 17 10:08:19 2024 X-Original-To: dev-commits-src-all@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 4YCCDz6863z5h0rg; Tue, 17 Dec 2024 10:08:19 +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 4YCCDz2sRnz4CMw; Tue, 17 Dec 2024 10:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430099; 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=U3lWjvBxTIHGQIcNB/pzJrtqEhDnou3PBrNepncUqGA=; b=lpYLnza6S2Y17bNbyyrhP6WLoGZZRtHi77drtp073m23WrEzgsGfATd75j/G/XISzVplEC cFRPRVVPy4uzMjYCv7cq7UWNBJOqdC4LKJiT4ezMovqZhHbUjEdLEHgcVXK0Aodf8O838i F+R53XTWfJYpNzIYaPBHbYfwl69PmQXRwQZxKCB+75hzePz0FxwNuz/hDKgEnPQb3Z92vQ K2SqfX/doKJvwXGHHKqs5rv+SxmY8SrCLElJyNhU3txkXO1rpZuNxtGEFcYGp+ue4QBK85 n1yUEGWVeYzcpphu/z1RkBtZt2YrBWFNWvbSrAhHszfFSzCxK2QlWir8dV8zrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430099; 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=U3lWjvBxTIHGQIcNB/pzJrtqEhDnou3PBrNepncUqGA=; b=JglhO8Jk3Yh20BizcCQg1PJyzqE61VUI55spUYiVSRkFBtn2fPZ/Gp+oAoxfdEGfN3MXdI LItEfDrUfdLOt0cmyQp85f2zm7VheyW5xtAvrDJUsy2WW6dxTk3klUqI4jBOjDzK9TTftW K8LbSjUtu+p5+KFQKEnQ6zZN28X1gb9wLZ/O+uriAIHKuQ5hgMn94TJC9a7kJw5wc+w2sQ dAjB9N5HpZmg3/BNUNZmFL8gDhiVF8dKp4mZJjF+fDAgoUrx8id29lcX66KcdgcUrq8tIP PerjRO65nI5OaVC7E6FXSBNxFvGRAUjlBLlJ9ML9bX6WFlXL50Jyk6+vzTlJiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734430099; a=rsa-sha256; cv=none; b=IBQjRyUrvh7HkiirZnkYqLrjDWGrfbVmYHt93j0uFOmW6AVT8Kej7dvKnhYapiyuw4woGz hXW9X3/rjHAVFwMnCwWz9aoJYWS7il5dbKUrH2GkasuSe74OMtxB1ev6El8sVWoclbTf5F hzQ+K/p62VGygY8y4OrA4a7HEFKuXFz3iy9S9yhJvQuwA5yIWu9BLvHEkeq2db47SKUSQl nErVtnNJkiHAt3xEE9BwlRNi/iOJyffX0jhs2zB+HDCAilTPvg+C61orF8TtL7r9jxtSBX B6ssqAfmg3hIgStOSsRL8x8RCbCPGY5S1hG5geI71gyBGI/0zLMxFCue9NejjA== 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 4YCCDz2TbGzJS3; Tue, 17 Dec 2024 10:08:19 +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 4BHA8JeG025180; Tue, 17 Dec 2024 10:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BHA8JHA025177; Tue, 17 Dec 2024 10:08:19 GMT (envelope-from git) Date: Tue, 17 Dec 2024 10:08:19 GMT Message-Id: <202412171008.4BHA8JHA025177@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: 32cac604487b - main - pf tests: test dummynet on nat64 rules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 32cac604487b4c6a8588c5df7641bdb5b452711f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=32cac604487b4c6a8588c5df7641bdb5b452711f commit 32cac604487b4c6a8588c5df7641bdb5b452711f Author: Kristof Provost AuthorDate: 2024-12-12 14:35:34 +0000 Commit: Kristof Provost CommitDate: 2024-12-17 10:07:18 +0000 pf tests: test dummynet on nat64 rules Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/nat64.sh | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 318b6a61bcab..79fa0c99a311 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -555,6 +555,60 @@ table_round_robin_cleanup() pft_cleanup } +atf_test_case "dummynet" "cleanup" +dummynet_head() +{ + atf_set descr 'Test dummynet on af-to rules' + atf_set require.user root +} + +dummynet_body() +{ + pft_init + dummynet_init + + epair_link=$(vnet_mkepair) + epair=$(vnet_mkepair) + + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + route -6 add default 2001:db8::1 + + vnet_mkjail rtr ${epair}b ${epair_link}a + jexec rtr ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + jexec rtr ifconfig ${epair_link}a 192.0.2.1/24 up + + vnet_mkjail dst ${epair_link}b + jexec dst ifconfig ${epair_link}b 192.0.2.2/24 up + jexec dst route add default 192.0.2.1 + + # Sanity checks + atf_check -s exit:0 -o ignore \ + ping6 -c 1 2001:db8::1 + atf_check -s exit:0 -o ignore \ + jexec dst ping -c 1 192.0.2.1 + + jexec rtr pfctl -e + jexec rtr dnctl pipe 1 config delay 600 + pft_set_rules rtr \ + "set reassemble yes" \ + "set state-policy if-bound" \ + "pass in on ${epair}b inet6 from any to 64:ff9b::/96 dnpipe 1 af-to inet from (${epair_link}a)" + + # The ping request will pass, but take 1.2 seconds (.6 in, .6 out) + # So this works: + atf_check -s exit:0 -o ignore \ + ping6 -c 1 -t 2 64:ff9b::192.0.2.2 + + # But this times out: + atf_check -s exit:2 -o ignore \ + ping6 -c 1 -t 1 64:ff9b::192.0.2.2 +} + +dummynet_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "icmp_echo" @@ -569,4 +623,5 @@ atf_init_test_cases() atf_add_test_case "table" atf_add_test_case "table_range" atf_add_test_case "table_round_robin" + atf_add_test_case "dummynet" }