From patchwork Thu May 11 10:12:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3210 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:7b9a:b0:c3:1364:a2a2 with SMTP id j26csp4194182dyk; Thu, 11 May 2023 03:14:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71Pb2eSsr+6/wwzDU9nGgXVfH3KWxkz1st91HmCEUz2TQmi7ITDnzvvvoBcq0Ao4E3iPsh X-Received: by 2002:a92:d30b:0:b0:331:add1:b765 with SMTP id x11-20020a92d30b000000b00331add1b765mr14561206ila.19.1683800053398; Thu, 11 May 2023 03:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683800053; cv=none; d=google.com; s=arc-20160816; b=VbBQO16HdzRsTFrEeuwxlDmtpC6xwfyzHQdroim6Seg6BxDtcxwjO5iVwhFmI86l6F 8M8uUgPnjjqgP+eGQI0Q3BAWhaT/dQZjw4DcBB+4EXJu9O1pDJcX46whunFA5fYuTab6 Z+EUV3b3WFfRq35qP7SF15yxjXL2CBFoGe6ny9v7loZoCj67PvVXz0/rckSAKgaD5xdZ AEY+Ug2eT0af29j0xVGfEWPwLaVDxdGZpmaqfeiQKopyX5y081Bg9YHu0+Oa9/TFraPe bKseQfiOzlb9gL34Rgys7rIIzkPgqkehVIBMZWw26kZzMAn9dg6/stjuuTRObO5p1HKF o/pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature :dkim-signature; bh=h1e2EQio2gDISfnVUeqqZrLC33mBVc6CFdu8tKwq4Hg=; b=aszUrLLcLd0rxaoFhqyntEVywgKpWuBIPDI1/A7mr51gWVh8JzlqZmMYiMWbO6Qg4z G1tEntwYg8WykiwFVriaoouGwXg3ch/sIIyB4IEQVDKUc57YzbYpJkBy912sik8qGi1u tcnHjMS0c8hdI1AXZLLPCmmBhsxkYWi8FZYv+JdqnFWd9BpvZYrHcAtrFblpWm5XdU8j mzayqRH9tAvpf9tcyle8dhNFQfeRqPWtqM3ER4+ANaHcR5Efq2+/RkrtHRblcODTzcbz /rYNZowtlD5NLRamxPtky44HSin+7tX2zbDYDRXrv4Z+lIDIXVkDpDQiifqCwpN+IZaY yTrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Zt4fJmQs; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=j68pHbxU; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=mcpJywwp; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id r4-20020a922a04000000b003319818affdsi8165123ile.126.2023.05.11.03.14.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2023 03:14:13 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Zt4fJmQs; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=j68pHbxU; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=mcpJywwp; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1px3IL-0004m3-74; Thu, 11 May 2023 10:13:09 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1px3IJ-0004lt-H4 for openvpn-devel@lists.sourceforge.net; Thu, 11 May 2023 10:13:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=aYemq/0UFO4Fx9OxOH8B05mqEeJ9oFCeNzM06V5LrJc=; b=Zt4fJmQsdFQjc0vlcpCzmb0o+X z2qVpvI7oVlcsFku8CVGOgkMm954lJAHwZkz3wA6CvCqg1y8+pya/j2bCPE9KWZJFu03lYUPFPQ6T pwjIXdkpnBPu02ctRvDgkroQibbP5a3TvDoMuVNDppbCiaUu/rKxIS3Z6o32oZ/LYm6c=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=aYemq/0UFO4Fx9OxOH8B05mqEeJ9oFCeNzM06V5LrJc=; b=j 68pHbxUOgsngO+1UpqKvf5Zm1yVBQLxtL29iG7MLtKcCOdbfWN4hEA7JuL8fQUd8ON+HLoqfBVPBK tSCxPM/U7RDlZ2yPbObgqe/234QkQQdTHDDZhjWv/MuLWa75R+NXjoLQfSuoMbktiwO7fyubcRr2Q A70Bdb/G31y+UBdk=; Received: from mout-p-202.mailbox.org ([80.241.56.172]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1px3IF-0002Qs-61 for openvpn-devel@lists.sourceforge.net; Thu, 11 May 2023 10:13:07 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4QH74k247yz9sZW for ; Thu, 11 May 2023 12:12:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1683799974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aYemq/0UFO4Fx9OxOH8B05mqEeJ9oFCeNzM06V5LrJc=; b=mcpJywwpb46P3lcBAWXGsn0QynbCOFs0Yz0Yam5wHnXov2VkkjvCgTTU1LoP7G+LmsP3BA i2aGnY/Osjt8JzjhueECOsC7WfkCe5nJIZjxiAYnqy5PsWcqU5uMMIVqy8sPnv2GaIU8mn xYq2HIShV8OVEvHRamLKrUzKEZVWA2UZfSw6S2jnMfH149OVic4A/ZC2z6Mj4oRMl1GoZN +vgQHhx0NCtAfy5CZ91YAPtKKfcdqGKiUUYdyo5XtoBFrWIx/dMOe7fE0FKNAy1zoYIvUX ya7d4aY1qM/kl8uBs1exjy1/m/bVFKwQP9eY6ksE8TmOw0rF/NkWx0vxD57CuQ== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Thu, 11 May 2023 12:12:53 +0200 Message-Id: <20230511101253.369196-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4QH74k247yz9sZW X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This makes it easy to test an installed binary for example. Signed-off-by: Frank Lichtenheld --- tests/t_client.sh.in | 7 ++++--- tests/t_cltsrv.sh | 5 +++-- tests/t_lpback.sh | 13 +++++++------ tests/t_net.sh | 2 +- 4 files changed, 15 [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.172 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1px3IF-0002Qs-61 Subject: [Openvpn-devel] [PATCH] tests: Allow to override openvpn binary used X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1765592324772735638?= X-GMAIL-MSGID: =?utf-8?q?1765592324772735638?= This makes it easy to test an installed binary for example. Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- tests/t_client.sh.in | 7 ++++--- tests/t_cltsrv.sh | 5 +++-- tests/t_lpback.sh | 13 +++++++------ tests/t_net.sh | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in index e919456a..99e6f9c6 100755 --- a/tests/t_client.sh.in +++ b/tests/t_client.sh.in @@ -18,6 +18,7 @@ TCLIENT_SKIP_RC="${TCLIENT_SKIP_RC:-77}" srcdir="${srcdir:-.}" top_builddir="${top_builddir:-..}" +openvpn="${openvpn:-${top_builddir}/src/openvpn/openvpn}" if [ -r "${top_builddir}"/t_client.rc ] ; then . "${top_builddir}"/t_client.rc elif [ -r "${srcdir}"/t_client.rc ] ; then @@ -49,7 +50,7 @@ if [ $? -ne 0 ]; then exit "${TCLIENT_SKIP_RC}" fi -if [ ! -x "${top_builddir}/src/openvpn/openvpn" ] +if [ ! -x "${openvpn}" ] then echo "no (executable) openvpn binary in current build tree. FAIL." >&2 exit 1 @@ -340,9 +341,9 @@ do pidfile="${top_builddir}/tests/$LOGDIR/openvpn-$SUF.pid" openvpn_conf="$openvpn_conf --writepid $pidfile $up" output " run openvpn $openvpn_conf" - echo "# src/openvpn/openvpn $openvpn_conf" >$LOGDIR/$SUF:openvpn.log + echo "# ${openvpn} $openvpn_conf" >$LOGDIR/$SUF:openvpn.log umask 022 - $RUN_SUDO "${top_builddir}/src/openvpn/openvpn" $openvpn_conf >>$LOGDIR/$SUF:openvpn.log & + $RUN_SUDO "${openvpn}" $openvpn_conf >>$LOGDIR/$SUF:openvpn.log & sudopid=$! # Check if OpenVPN has initialized before continuing. It will check every 3rd second up diff --git a/tests/t_cltsrv.sh b/tests/t_cltsrv.sh index 752251e4..4a8643ae 100755 --- a/tests/t_cltsrv.sh +++ b/tests/t_cltsrv.sh @@ -22,6 +22,7 @@ set -e srcdir="${srcdir:-.}" top_srcdir="${top_srcdir:-..}" top_builddir="${top_builddir:-..}" +openvpn="${openvpn:-${top_builddir}/src/openvpn/openvpn}" trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15 trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3 addopts= @@ -55,8 +56,8 @@ success=0 for i in 1 2 3 ; do set +e ( - "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${root}" ${addopts} --setenv role srv --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-server" & - "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${top_srcdir}/sample" ${addopts} --setenv role clt --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-client" + "${openvpn}" --script-security 2 --cd "${root}" ${addopts} --setenv role srv --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-server" & + "${openvpn}" --script-security 2 --cd "${top_srcdir}/sample" ${addopts} --setenv role clt --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-client" ) 3>log.$$.signal >log.$$ 2>&1 e1=$? wait $! diff --git a/tests/t_lpback.sh b/tests/t_lpback.sh index 5aabbd5e..482016a9 100755 --- a/tests/t_lpback.sh +++ b/tests/t_lpback.sh @@ -21,6 +21,7 @@ set -eu top_builddir="${top_builddir:-..}" +openvpn="${openvpn:-${top_builddir}/src/openvpn/openvpn}" trap "rm -f key.$$ tc-server-key.$$ tc-client-key.$$ log.$$ ; trap 0 ; exit 77" 1 2 15 trap "rm -f key.$$ tc-server-key.$$ tc-client-key.$$ log.$$ ; exit 1" 0 3 @@ -71,7 +72,7 @@ fi # Get list of supported ciphers from openvpn --show-ciphers output -CIPHERS=$(${top_builddir}/src/openvpn/openvpn --show-ciphers | \ +CIPHERS=$(${openvpn} --show-ciphers | \ sed -e '/The following/,/^$/d' -e s'/ .*//' -e '/^[[:space:]]*$/d') # SK, 2014-06-04: currently the DES-EDE3-CFB1 implementation of OpenSSL is @@ -90,23 +91,23 @@ fi # Also test cipher 'none' CIPHERS=${CIPHERS}$(printf "\nnone") -"${top_builddir}/src/openvpn/openvpn" --genkey secret key.$$ +"${openvpn}" --genkey secret key.$$ set +e for cipher in ${CIPHERS} do test_start "Testing cipher ${cipher}... " - ( "${top_builddir}/src/openvpn/openvpn" --test-crypto --secret key.$$ --cipher ${cipher} ) >log.$$ 2>&1 + ( "${openvpn}" --test-crypto --secret key.$$ --cipher ${cipher} ) >log.$$ 2>&1 test_end $? log.$$ done test_start "Testing tls-crypt-v2 server key generation... " -"${top_builddir}/src/openvpn/openvpn" \ +"${openvpn}" \ --genkey tls-crypt-v2-server tc-server-key.$$ >log.$$ 2>&1 test_end $? log.$$ test_start "Testing tls-crypt-v2 key generation (no metadata)... " -"${top_builddir}/src/openvpn/openvpn" --tls-crypt-v2 tc-server-key.$$ \ +"${openvpn}" --tls-crypt-v2 tc-server-key.$$ \ --genkey tls-crypt-v2-client tc-client-key.$$ >log.$$ 2>&1 test_end $? log.$$ @@ -118,7 +119,7 @@ while [ $i -lt 732 ]; do i=$(expr $i + 1) done test_start "Testing tls-crypt-v2 key generation (max length metadata)... " -"${top_builddir}/src/openvpn/openvpn" --tls-crypt-v2 tc-server-key.$$ \ +"${openvpn}" --tls-crypt-v2 tc-server-key.$$ \ --genkey tls-crypt-v2-client tc-client-key.$$ "${METADATA}" \ >log.$$ 2>&1 test_end $? log.$$ diff --git a/tests/t_net.sh b/tests/t_net.sh index bc91f825..8134832c 100755 --- a/tests/t_net.sh +++ b/tests/t_net.sh @@ -7,7 +7,7 @@ LAST_TEST=8 srcdir="${srcdir:-.}" top_builddir="${top_builddir:-..}" -openvpn="${top_builddir}/src/openvpn/openvpn" +openvpn="${openvpn:-${top_builddir}/src/openvpn/openvpn}" # bail out right away on non-linux. NetLink (the object of this test) is only