Change in openvpn[release/2.6]: tests: Allow to override openvpn binary used
A message that is not in the archive (sent off-list or not yet received): gerrit.1765215972000.Ida7a64a299cd5bf7ae4f0cc725756b5f5cc408f9@...2715...
Attention is currently required from: cron2, plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email
to review the following change.
Change subject: tests: Allow to override openvpn binary used
......................................................................
tests: Allow to override openvpn binary used
This makes it easy to test an installed binary for example.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26648.html
---
M tests/t_client.sh.in
M tests/t_cltsrv.sh
M tests/t_lpback.sh
M tests/t_net.sh
4 files changed, 15 insertions(+), 12 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/1424/1
tests/t_client.sh.in +4 -3
@@ -18,6 +18,7 @@ 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 @@ 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
@@ -352,9 +353,9 @@ 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
tests/t_cltsrv.sh +3 -2
@@ -22,6 +22,7 @@ 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 @@ 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 $!
tests/t_lpback.sh +7 -6
@@ -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 @@ # 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 @@ # 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 @@ 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.$$
tests/t_net.sh +1 -1
@@ -7,7 +7,7 @@ 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
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: Ida7a64a299cd5bf7ae4f0cc725756b5f5cc408f9
Gerrit-Change-Number: 1424
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos.
cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email )
Change subject: tests: Allow to override openvpn binary used
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: Ida7a64a299cd5bf7ae4f0cc725756b5f5cc408f9
Gerrit-Change-Number: 1424
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 08 Dec 2025 19:39:35 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH 1/1 tests: Allow to override openvpn binary used
In reply to a message not in the archiveFrom: Frank Lichtenheld <[email protected]...>
This makes it easy to test an installed binary for example.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26648.html
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1424
(cherry picked from commit d623aa6c29545a7f00daaa73d87818a9c5b1e942)
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to release/2.6.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1424
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
tests/t_client.sh.in +4 -3
@@ -18,6 +18,7 @@ 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 @@ 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
@@ -352,9 +353,9 @@ 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
tests/t_cltsrv.sh +3 -2
@@ -22,6 +22,7 @@ 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 @@ 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 $!
tests/t_lpback.sh +7 -6
@@ -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 @@ # 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 @@ # 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 @@ 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.$$
tests/t_net.sh +1 -1
@@ -7,7 +7,7 @@ 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
[Openvpn-devel] [PATCH applied] Re: tests: Allow to override openvpn binary used
And finally, the backport to t_client.sh which is needed to make the buildbot conditionals "does this openvpn binary have BF-CBC support? if not, skip this test!" work properly.
Again, no code change - just test scripts this time.
Your patch has been applied to the release/2.6 branch.
commit 966cdeb33d182a9b9d5474c26a7bfa8ac20231d5
Author: Frank Lichtenheld Date: Mon Dec 8 20:39:42 2025 +0100
tests: Allow to override openvpn binary used
Signed-off-by: Frank Lichtenheld <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26648.html
Signed-off-by: Gert Doering <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1424
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34907.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: tests: Allow to override openvpn binary used
......................................................................
tests: Allow to override openvpn binary used
This makes it easy to test an installed binary for example.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26648.html
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1424
(cherry picked from commit d623aa6c29545a7f00daaa73d87818a9c5b1e942)
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34907.html
---
M tests/t_client.sh.in
M tests/t_cltsrv.sh
M tests/t_lpback.sh
M tests/t_net.sh
4 files changed, 15 insertions(+), 12 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/1424/2
tests/t_client.sh.in +4 -3
@@ -18,6 +18,7 @@ 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 @@ 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
@@ -352,9 +353,9 @@ 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
tests/t_cltsrv.sh +3 -2
@@ -22,6 +22,7 @@ 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 @@ 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 $!
tests/t_lpback.sh +7 -6
@@ -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 @@ # 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 @@ # 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 @@ 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.$$
tests/t_net.sh +1 -1
@@ -7,7 +7,7 @@ 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
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: Ida7a64a299cd5bf7ae4f0cc725756b5f5cc408f9
Gerrit-Change-Number: 1424
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email )
Change subject: tests: Allow to override openvpn binary used
......................................................................
tests: Allow to override openvpn binary used
This makes it easy to test an installed binary for example.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg26648.html
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1424
(cherry picked from commit d623aa6c29545a7f00daaa73d87818a9c5b1e942)
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34907.html
---
M tests/t_client.sh.in
M tests/t_cltsrv.sh
M tests/t_lpback.sh
M tests/t_net.sh
4 files changed, 15 insertions(+), 12 deletions(-)
tests/t_client.sh.in +4 -3
@@ -18,6 +18,7 @@ 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 @@ 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
@@ -352,9 +353,9 @@ 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
tests/t_cltsrv.sh +3 -2
@@ -22,6 +22,7 @@ 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 @@ 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 $!
tests/t_lpback.sh +7 -6
@@ -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 @@ # 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 @@ # 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 @@ 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.$$
tests/t_net.sh +1 -1
@@ -7,7 +7,7 @@ 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
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1424?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: Ida7a64a299cd5bf7ae4f0cc725756b5f5cc408f9
Gerrit-Change-Number: 1424
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>