From nobody Tue Jun 28 11:59:33 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 9AC1A8633E8; Tue, 28 Jun 2022 11:59:34 +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 4LXNS60wmFz3Qj8; Tue, 28 Jun 2022 11:59:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417574; 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=373cPpNIbaO2nGf4scAEcbB4O6fKqCMPm23zi3PBm8Y=; b=jMp5SXH+8XHtMQu6Ok9gk1Z7y/3kbwj27I+024eh+tQ8CWpcnNXMA3zRiZkMt4g2Uud4OF AUIpIDCwPWxZv+86fXOfuJkhPKbRdknpsste8b35FAiebnGssefmI8o1RlYmSLrpoHQML2 efKauhxK0YIg9TV4wGdhYQSokhJYAAFPnxIb0wHNdOIHJMnNfj9Hm16vYmBJSsdGBewgww Mr3Mft2LuH4cgGXYNfWC3qGow0tUHdT6rx97n3AUWWIDJSkpPDEJ9VvNzV3jEu5Ka8m69T CQinf3zb649YK7jnsAaa/xXllW6OYupr+PccufuDh1QsMZ762jY7Pi68cCO6Yw== 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 C771B1C909; Tue, 28 Jun 2022 11:59:33 +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 25SBxX1Q055607; Tue, 28 Jun 2022 11:59:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25SBxXho055606; Tue, 28 Jun 2022 11:59:33 GMT (envelope-from git) Date: Tue, 28 Jun 2022 11:59:33 GMT Message-Id: <202206281159.25SBxXho055606@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: 08926ae328d5 - main - if_ovpn tests: timeout on clients 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: 08926ae328d59f18a0b9674260c0f054cb3ff262 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417574; 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=373cPpNIbaO2nGf4scAEcbB4O6fKqCMPm23zi3PBm8Y=; b=ipdea4+xWIWOR39klvL34tcCsFoPH+FNmDMwErYx7+Zl0zoRyDAFPnDJLc4IYSNXbK8KqX x6j3d1gUdtNL9tOVAbf9pyQylngiesdg83U421WiCjedEYGLHM13ejy+1XsLrNjbfcU1vV LHxl33xKLdDxMkYisXn+AJkN/ZuJJEqDC2z2uNgBMVw7/ugUhwadPiKMqwTlnqHgmPxGk1 BMb1Yd2TzUcBAZp6MUQ9I5CESToja7gY/+s5yEm0kAV/aAPICvWj6ixfrwf3WNjVB9NXip KRv4zl8blqegTtLKYm4OnUGGsHgmJ5tMKnajF/qx7t/ApfqNz1zRb9KQTRM7gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656417574; a=rsa-sha256; cv=none; b=tisKIhdGU/75uprZWUe9q8IeTnFQ+hu/3impRb2L+/16LTmjECRNva4kwkBvD0xEoqUn/q 0y4Iu1OcaL+MlfzsZ6fKqBhmEgKgQqTcGWt6GAYtg2W2AbYd03UW/+Bjc9+GQT2zHFrFZ+ itMLCrs9HL4KSeJQ6vb+PnYYdnCCKC9142zU8p4TgeyPw6AQd47tEjH2Okcim3hddVBRLZ wwUMffA2Rgyi7ruSdnP0Qoq75AXmKM23aa7fv+dAU0lW02lWfchJ/xqVOv75s6IAhajdzr rDG/Gshqhtj3YU2tSQe7TbF534Iw4M6qr8FgMTfu76GTFux0CbaJABrADl/WMQ== 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=08926ae328d59f18a0b9674260c0f054cb3ff262 commit 08926ae328d59f18a0b9674260c0f054cb3ff262 Author: Kristof Provost AuthorDate: 2022-04-26 13:09:59 +0000 Commit: Kristof Provost CommitDate: 2022-06-28 11:50:45 +0000 if_ovpn tests: timeout on clients Test that openvpn (DCO) clients are notified and handle timeout events. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D35091 --- tests/sys/net/if_ovpn/if_ovpn.sh | 85 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index 338605de98d4..d9e2f371287f 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -98,7 +98,92 @@ atf_test_case "4in4" "cleanup" ovpn_cleanup } +atf_test_case "timeout_client" "cleanup" +timeout_client_head() +{ + atf_set descr 'IPv4 in IPv4 tunnel' + atf_set require.user root + atf_set require.progs openvpn +} + +timeout_client_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 udp4 + + cipher AES-256-GCM + auth SHA256 + + local 192.0.2.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 2 10 + " + 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 + + ping 2 + ping-exit 10 + " + + # 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 + + # Kill the server + jexec a killall openvpn + + # Now wait for the client to notice + sleep 20 + + if [ jexec b pgrep openvpn ]; then + jexec b ps auxf + atf_fail "OpenVPN client still running?" + fi +} + +timeout_client_cleanup() +{ + ovpn_cleanup +} + atf_init_test_cases() { atf_add_test_case "4in4" + atf_add_test_case "timeout_client" }