From nobody Tue Jun 28 11:59:37 2022 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 6765A8636EB; Tue, 28 Jun 2022 11:59:39 +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 4LXNSB2s5dz3Qwd; Tue, 28 Jun 2022 11:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417578; 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=8cF5j91rGBna2sLjxd4F/m9mLVxhXpZgvDVs5sN7Whk=; b=thP1zaoGns5dB0LG5W4H0j5M6BmaBo9TndF0KBQQygmQLy8CRaVjVyjqpQmil0tu6hoMBv 5bJOF33FobOcck78hBBFm1FazPgK2kTUvrGZkbraXxjcUt4FsEEXM10q/sVKzq4n1rf/1u /UNMIbEp9v9uk48QlQ0JG7Mj1V+tjVUM3NQXPqk/s9Jdl6PSfDt9X9XAuZY+gIQJ8zzumq XLpgFjprgccVUVR5Zs6sbPaMvB4Y8vDnSAI8rtxdet+sY0SBFDxAGuHJUX+Gb56EJ+K50V hkHk6JRhdtv1vkypEPHyA9JYNtq8obIbmb0MD3Wl4/30+Jok2/KbYCxL4W91IQ== 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 25FB31C984; Tue, 28 Jun 2022 11:59:37 +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 25SBxbuc055686; Tue, 28 Jun 2022 11:59:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25SBxbIN055685; Tue, 28 Jun 2022 11:59:37 GMT (envelope-from git) Date: Tue, 28 Jun 2022 11:59:37 GMT Message-Id: <202206281159.25SBxbIN055685@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: 85a15e4704e4 - main - if_ovpn tests: IPv6 in IPv4 and IPv4 in IPv6 tunnels 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 85a15e4704e4f0a7ef6808ef8569f1458371102b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417578; 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=8cF5j91rGBna2sLjxd4F/m9mLVxhXpZgvDVs5sN7Whk=; b=aTBt/eNvE4m6LwDxGvIUN5VIrOU9zRDUj4SZOJdVU2k5Xq/GU0Xl6OeaKXH6ZzZFUgiy47 0V3XeJOrAUeRHJVIagqGJlbHuZelqKxHzJ59yzLAnwpUBloBc4u25k0dPmfOQpFlDA29gD fJHtSi4DuUBJPpJjbl/Q3ia/BVBMKZLWzRm59J4WjjdfR0S8R8SmpoG/9DBILHmPUrI62N JJNFc4vTsCr8jm6YEE8XCvsxcvwnBg7WwszZM9nScbnJeR31KVuaytozT+AgoxLa9jvdE+ 9iUG2M46fUsSxtVC3fV7OKh1266CzJZmSb5i/fI3vtURmSoCmn1eC2xtA4lpOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656417578; a=rsa-sha256; cv=none; b=rgFQklwZkGT5ihzwbf9s27L5nr9Azotcg7bRLsTIQKmxeNmkNlwPrmlEiGSTJaPoZtCtqi vGVqRUs7NkjitFLfVcVg3zZtAQluaErOfcBrILfMUkboTs2N7hizEh0KuxEuFiWqIxSsxR snDrQmdFRlRze5DdWEYGvJD4MDpYWNwxLogsGU1TomJYTEpt7qpDV8ZnK3RT/lSaPcvy6w wM9BFrqikTlgtyYt5oLSD4wWZzrF5Sm/obVUHLwXK5MZkGFQkJfrihADqafwjmV3tpSqO+ FW9fOa3zV2Bwllufr7PwPytbV4EmOsMiiD8aV5BI7bqdDoRDq18HqPpaJXW4TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=85a15e4704e4f0a7ef6808ef8569f1458371102b commit 85a15e4704e4f0a7ef6808ef8569f1458371102b Author: Kristof Provost AuthorDate: 2022-05-20 11:06:09 +0000 Commit: Kristof Provost CommitDate: 2022-06-28 11:51:15 +0000 if_ovpn tests: IPv6 in IPv4 and IPv4 in IPv6 tunnels Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/net/if_ovpn/if_ovpn.sh | 147 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index febc692bd8f0..b7c91af5d010 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -98,6 +98,151 @@ atf_test_case "4in4" "cleanup" ovpn_cleanup } +atf_test_case "6in4" "cleanup" +6in4_head() +{ + atf_set descr 'IPv6 in IPv4 tunnel' + atf_set require.user root + atf_set require.progs openvpn +} + +6in4_body() +{ + ovpn_init + + l=$(vnet_mkepair) + + vnet_mkjail a ${l}a + jexec a ifconfig ${l}a 192.0.2.1/24 up + vnet_mkjail b ${l}b + jexec b ifconfig ${l}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore jexec a ping -c 1 192.0.2.2 + + ovpn_start a " + dev ovpn0 + dev-type tun + proto udp + + cipher AES-256-GCM + auth SHA256 + + local 192.0.2.1 + server-ipv6 2001:db8:1::/64 + + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/server.crt + key $(atf_get_srcdir)/server.key + dh $(atf_get_srcdir)/dh.pem + + mode server + script-security 2 + auth-user-pass-verify /usr/bin/true via-env + topology subnet + + keepalive 100 600 + " + ovpn_start b " + dev tun0 + dev-type tun + + client + + remote 192.0.2.1 + auth-user-pass $(atf_get_srcdir)/user.pass + + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/client.crt + key $(atf_get_srcdir)/client.key + dh $(atf_get_srcdir)/dh.pem + + keepalive 100 600 + " + + # Give the tunnel time to come up + sleep 10 + + atf_check -s exit:0 -o ignore jexec b ping6 -c 3 2001:db8:1::1 +} + +6in4_cleanup() +{ + ovpn_cleanup +} + +atf_test_case "4in6" "cleanup" +4in6_head() +{ + atf_set descr 'IPv4 in IPv6 tunnel' + atf_set require.user root + atf_set require.progs openvpn +} + +4in6_body() +{ + ovpn_init + + l=$(vnet_mkepair) + + vnet_mkjail a ${l}a + jexec a ifconfig ${l}a inet6 2001:db8::1/64 up no_dad + vnet_mkjail b ${l}b + jexec b ifconfig ${l}b inet6 2001:db8::2/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore jexec a ping6 -c 1 2001:db8::2 + + ovpn_start a " + dev ovpn0 + dev-type tun + proto udp6 + + cipher AES-256-GCM + auth SHA256 + + local 2001:db8::1 + server 198.51.100.0 255.255.255.0 + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/server.crt + key $(atf_get_srcdir)/server.key + dh $(atf_get_srcdir)/dh.pem + + mode server + script-security 2 + auth-user-pass-verify /usr/bin/true via-env + topology subnet + + keepalive 100 600 + " + ovpn_start b " + dev tun0 + dev-type tun + + client + + remote 2001:db8::1 + auth-user-pass $(atf_get_srcdir)/user.pass + + ca $(atf_get_srcdir)/ca.crt + cert $(atf_get_srcdir)/client.crt + key $(atf_get_srcdir)/client.key + dh $(atf_get_srcdir)/dh.pem + + keepalive 100 600 + " + + # Give the tunnel time to come up + sleep 10 + + atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1 +} + +4in6_cleanup() +{ + ovpn_cleanup +} + atf_test_case "6in6" "cleanup" 6in6_head() { @@ -258,6 +403,8 @@ timeout_client_cleanup() atf_init_test_cases() { atf_add_test_case "4in4" + atf_add_test_case "6in4" atf_add_test_case "6in6" + atf_add_test_case "4in6" atf_add_test_case "timeout_client" }