From nobody Tue Jun 28 11:59:41 2022 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 6AF51863B43; Tue, 28 Jun 2022 11:59:43 +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 4LXNSG50cxz3Qnd; Tue, 28 Jun 2022 11:59:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417583; 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=BrewSGReqXVd5vdOi+ltYjTgmrA4PfDAEzfKyT5Xua0=; b=n6webYiUvH5k0NqkHlQ78H3LyxAU3FwFahdt717cMKBumzCbh/V2A747871erSEZBAY2YW vOuE9Pypg3eIsMteDtXNHGYe/iqSsj876lEAbOSvP5eVNDpz9Ipe/BOA/vZl5lVGUTwRWO V/pmkoq9WlUKzZag9A04PzwrZphqVdHWHUIfKw2Zbz35uCikCQ53AOuvU/iQHLGT/BrP7X 5XfXFDeWOeIQ6MCYL9ZfyRKT1N6raUNfTkZoTyEnCyWOiOjnKDZSH+L14vD7aYATZJI5hq 6NpyGSP/YT5aGrVO6nYfmm2UtTx15NqGwXf3JR2W9aKmUUkJ8I5uT6mmLWFVqw== 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 AF5AC1C90C; Tue, 28 Jun 2022 11:59:41 +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 25SBxfZA055783; Tue, 28 Jun 2022 11:59:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25SBxfpS055782; Tue, 28 Jun 2022 11:59:41 GMT (envelope-from git) Date: Tue, 28 Jun 2022 11:59:41 GMT Message-Id: <202206281159.25SBxfpS055782@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: a7a273546e38 - main - if_ovpn tests: test multiple simultaneous clients 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: 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: a7a273546e389af8fab3b7d9cc6c449a2ab4f84e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656417583; 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=BrewSGReqXVd5vdOi+ltYjTgmrA4PfDAEzfKyT5Xua0=; b=RefmuP4+36ObuXhe4k8NgsWVtfEllpCAlaPgZzLkoxVKl/xktXPHc8GGd9fzXbMm7DZEKJ U3Fpg7USLEvIvsYPsLiSWrJwD5qfSTyKMWbVrmnZMWB7z+LWdH0roT47Kt/88kTBWsnQTR 0gaIHb5QJOXDEYg1Y0KRPs/Czh+sRZAU6lhpT3UAmPWci4v47SO67yoT03h9asm99C44M5 Q+Xwf/ejZTRCjS01hHIdHPGza5+gUPVnyhVBjNKGjLCCb8YMcIqOKNnpAzCchMwy8rmh6s 9W7CzyUYIyPonmV3TCghz3AaNjVCgq/IsdmxzAwLZgiqshm56XyxcVBIHSRiDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656417583; a=rsa-sha256; cv=none; b=TvqZbflJ7gOhiqnyqnlRCnqLmX5zRYQGqAQ4WCotmomn1FDl5cipaIDrwfw2TCxLjNdOgK ulFm+sKC0E+t/tGQcf6oZYWUlP1zf28ytVCYWfdUVKupPT3djPIcXi6S2HKcVUhtBlP1z8 2nE/joFRzFkiLkzRB4sv8XgfE/WmrOeOZiH9vgsX+nUUtw47FZAT/p/oA790b7ub82eNE6 HDSYazur+JNVH5GbCbsv18pvxK25P1hN8CVI6fFbciLElYs4x3hskrXRU9W1QSurBv5+gF W2BzWghvtEsPManDiff7n/kgquAUw4O8J1Q9NBKGu3XecC6HhcAInaNB8uCk+A== 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=a7a273546e389af8fab3b7d9cc6c449a2ab4f84e commit a7a273546e389af8fab3b7d9cc6c449a2ab4f84e Author: Kristof Provost AuthorDate: 2022-06-15 08:56:49 +0000 Commit: Kristof Provost CommitDate: 2022-06-28 11:51:41 +0000 if_ovpn tests: test multiple simultaneous clients Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/net/if_ovpn/if_ovpn.sh | 112 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index 49266c6597e6..280897031a6d 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -401,6 +401,117 @@ timeout_client_cleanup() ovpn_cleanup } +atf_test_case "multi_client" "cleanup" +multi_client_head() +{ + atf_set descr 'Multiple simultaneous clients' + atf_set require.user root + atf_set require.progs openvpn +} + +multi_client_body() +{ + ovpn_init + + bridge=$(vnet_mkbridge) + srv=$(vnet_mkepair) + one=$(vnet_mkepair) + two=$(vnet_mkepair) + + ifconfig ${bridge} up + + ifconfig ${srv}a up + ifconfig ${bridge} addm ${srv}a + ifconfig ${one}a up + ifconfig ${bridge} addm ${one}a + ifconfig ${two}a up + ifconfig ${bridge} addm ${two}a + + vnet_mkjail srv ${srv}b + jexec srv ifconfig ${srv}b 192.0.2.1/24 up + vnet_mkjail one ${one}b + jexec one ifconfig ${one}b 192.0.2.2/24 up + vnet_mkjail two ${two}b + jexec two ifconfig ${two}b 192.0.2.3/24 up + + # Sanity checks + atf_check -s exit:0 -o ignore jexec one ping -c 1 192.0.2.1 + atf_check -s exit:0 -o ignore jexec two ping -c 1 192.0.2.1 + + jexec srv sysctl net.inet.ip.forwarding=1 + + ovpn_start srv " + 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 + duplicate-cn + script-security 2 + auth-user-pass-verify /usr/bin/true via-env + topology subnet + + keepalive 100 600 + " + ovpn_start one " + 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 + " + ovpn_start two " + 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 one ping -c 3 198.51.100.1 + atf_check -s exit:0 -o ignore jexec two ping -c 3 198.51.100.1 + + # Client-to-client communication + atf_check -s exit:0 -o ignore jexec one ping -c 3 198.51.100.3 + atf_check -s exit:0 -o ignore jexec two ping -c 3 198.51.100.2 +} + +multi_client_cleanup() +{ + ovpn_cleanup +} + atf_test_case "route_to" "cleanup" route_to_head() { @@ -576,6 +687,7 @@ atf_init_test_cases() atf_add_test_case "6in6" atf_add_test_case "4in6" atf_add_test_case "timeout_client" + atf_add_test_case "multi_client" atf_add_test_case "route_to" atf_add_test_case "chacha" }