From nobody Tue Dec 17 10:07:52 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 4YCCDS3rdrz5h0kt; Tue, 17 Dec 2024 10:07:52 +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 4YCCDS1Vljz49VR; Tue, 17 Dec 2024 10:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430072; 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=7H0r29FLYMyQA6YGB66zaOr3XH3KkfoK7aapQrB7ZKY=; b=ozp4nXHzFKJTFT0IVNCuORCB3xTtGqYoO4JCVH8ymacBpV0gJS8j+7VpwG1DlWqmnAQAmS 9+fnKgzM/M0gAAqZUFWfo4HLciIfqjKBe0jzUE+phBhkx2jcOZ19VEwpJhgvcCbx0zu6wn ZlIyqjSVtwATp/tv57RbJqT2jbioFTs8qBkRpHtzwpyJKioVnVZuhXDbu/88Z3sIdoaw0H jcpMlOyoceX7JlQz6WTi9z24/sXS8BrL7UH2/9K59Vb4cclOy6vCgNcwNclXIu4U9TLuE4 m5gp6vgq9jRWSYMcAL68ZbYCoWUneBHMZhQv++QXeKjj9BPmnD2C6m2JN3eVSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430072; 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=7H0r29FLYMyQA6YGB66zaOr3XH3KkfoK7aapQrB7ZKY=; b=AONvw6KTJnjKKAcmWB0ER4xi2DDsk06Chy3IjJSCZgZ4wYFwaLrMrWA9PArtbOXyDvzR7Z 5pMZ6cd3jk35MoHEfnzeGkhC3pR4vCkitrWoMGk4vKTwnydO6Zj9sVACaNT16s2ob7bkXf Y676ZpJfcLkZ6QzRKIBy9EK9Cvs7J4s1GBevAL79tu6fZPzSNt6lDMRuH8B16JVR+bpzc9 bOgu4A2b2KShtTXXb/Y7M5jIQhHxhQYoiVxqOCxGp5Ldqb3Vmxn8rgXhzsukjvw+SnlmO4 L60scwdEJdfnd95JSn9gjahwJxR1xsLBlxkRYoFcwY6q3yiU4ehsRJRmWh054Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734430072; a=rsa-sha256; cv=none; b=cQZ7FytQz5lPUVrFx9/HqkdzGzBnt9887p9wtEzQgFmZOkCvrzpFMxR9n93B2hRbaWgVq/ n9gS6lx8GKNNkHesTxahif0HF2BCPN+3GOiN4v88jtXY2fpEW9Wz0Gqoj91kJQHjj6FeRZ Sn71DtVVmUmL4fpuYpL8Q6XRSLllksRy00TKQZr/JWgSksoQIVNimdv8TrT2TcAaCW5Xh3 6HuF3UkQRii49pxHry43dVQNnWZwVRiicPvQfaCT+3iaZ0swIwUecbzz6f+2uE9WZb3keI RCMYbLRqVFjUmyE4Gv7k3NC2OwUF8VUP3QtP/fmD7OTuzqXrevOLZhXirsX20g== 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 4YCCDS17J1zJVF; Tue, 17 Dec 2024 10:07:52 +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 4BHA7qFu023824; Tue, 17 Dec 2024 10:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BHA7qYb023821; Tue, 17 Dec 2024 10:07:52 GMT (envelope-from git) Date: Tue, 17 Dec 2024 10:07:52 GMT Message-Id: <202412171007.4BHA7qYb023821@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: 22c634905bd4 - main - pf tests: add a TCP test case for nat64 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: 22c634905bd4e26e76ad5fc36b1785003523aeb1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=22c634905bd4e26e76ad5fc36b1785003523aeb1 commit 22c634905bd4e26e76ad5fc36b1785003523aeb1 Author: Kristof Provost AuthorDate: 2024-10-28 16:51:50 +0000 Commit: Kristof Provost CommitDate: 2024-12-17 10:07:14 +0000 pf tests: add a TCP test case for nat64 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D47792 --- tests/sys/netpfil/pf/nat64.sh | 52 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index cdbc3a6edc01..4c365be0d309 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -26,14 +26,7 @@ . $(atf_get_srcdir)/utils.subr -atf_test_case "icmp_echo" "cleanup" -icmp_echo_head() -{ - atf_set descr 'ICMP echo NAT64 test' - atf_set require.user root -} - -icmp_echo_body() +nat64_setup() { pft_init @@ -60,6 +53,18 @@ icmp_echo_body() jexec rtr pfctl -e pft_set_rules rtr \ "pass in on ${epair}b inet6 from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" +} + +atf_test_case "icmp_echo" "cleanup" +icmp_echo_head() +{ + atf_set descr 'Basic NAT64 ICMP echo test' + atf_set require.user root +} + +icmp_echo_body() +{ + nat64_setup # One ping atf_check -s exit:0 -o ignore \ @@ -76,7 +81,38 @@ icmp_echo_cleanup() pft_cleanup } +atf_test_case "tcp" "cleanup" +tcp_head() +{ + atf_set descr 'TCP NAT64 test' + atf_set require.user root +} + +tcp_body() +{ + nat64_setup + + echo "foo" | jexec dst nc -l 1234 & + + # Sanity check & delay for nc startup + atf_check -s exit:0 -o ignore \ + ping6 -c 1 64:ff9b::192.0.2.2 + + rcv=$(nc -w 3 -6 64:ff9b::c000:202 1234) + if [ "${rcv}" != "foo" ]; + then + echo "rcv=${rcv}" + atf_fail "Failed to connect to TCP server" + fi +} + +tcp_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "icmp_echo" + atf_add_test_case "tcp" }