summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2012-05-27 23:19:11 +0300
committerDavid Sommerseth <davids@redhat.com>2012-06-01 12:30:46 +0200
commit47c990009c79fe2a96206c54e0240cb2dd8cdf02 (patch)
tree1ec74d2dfe6b019de37b12437a7c7c2c8089792a /tests
parent4f6f17767d91df264b9ab26526dc018a23e9f040 (diff)
downloadopenvpn-47c990009c79fe2a96206c54e0240cb2dd8cdf02.tar.gz
openvpn-47c990009c79fe2a96206c54e0240cb2dd8cdf02.tar.xz
openvpn-47c990009c79fe2a96206c54e0240cb2dd8cdf02.zip
repair t_client.sh test after build system revolution
- run t_client.sh at "make check" time - in t_client.sh, read t_client.rc from source *or* build dir (as before) - @IP@ evaluates to "" now (not "ip") if iproute2 not found - adapt script - introduce $SETUP_TIME_WAIT to delay "waiting for openvpn startup" longer than the default delay of 10 seconds - this is needed for test servers with a high network RTT Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: David Sommerseth <davids@redhat.com> Message-Id: 20120527202737.GV1161@greenie.muc.de URL: http://article.gmane.org/gmane.network.openvpn.devel/6616 Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am5
-rwxr-xr-xtests/t_client.sh.in13
2 files changed, 10 insertions, 8 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6ae845b..b7980e0 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -12,13 +12,12 @@
MAINTAINERCLEANFILES = \
$(srcdir)/Makefile.in
-test_scripts = t_lpback.sh t_cltsrv.sh
+test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh
TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)"
TESTS = $(test_scripts)
dist_noinst_SCRIPTS = \
$(test_scripts) \
- t_cltsrv-down.sh \
- t_client.sh
+ t_cltsrv-down.sh
diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in
index 7ba124c..92e4d2e 100755
--- a/tests/t_client.sh.in
+++ b/tests/t_client.sh.in
@@ -14,16 +14,19 @@
srcdir="${srcdir:-.}"
top_builddir="${top_builddir:-..}"
-if [ -r "${srcdir}"/t_client.rc ] ; then
+if [ -r "${top_builddir}"/t_client.rc ] ; then
+ . "${top_builddir}"/t_client.rc
+elif [ -r "${srcdir}"/t_client.rc ] ; then
. "${srcdir}"/t_client.rc
else
- echo "$0: cannot find 't_client.rc' in ('${srcdir}'). SKIPPING TEST." >&2
+ echo "$0: cannot find 't_client.rc' in build dir ('${top_builddir}')" >&2
+ echo "$0: or source directory ('${srcdir}'). SKIPPING TEST." >&2
exit 77
fi
if [ ! -x "${top_builddir}/src/openvpn/openvpn" ]
then
- echo "no (executable) openvpn binary in current directory. FAIL." >&2
+ echo "no (executable) openvpn binary in current build tree. FAIL." >&2
exit 1
fi
@@ -83,7 +86,7 @@ fail()
get_ifconfig_route()
{
# linux / iproute2? (-> if configure got a path)
- if [ "@IPROUTE@" != "ip" ]
+ if [ "@IPROUTE@" != "" ]
then
echo "-- linux iproute2 --"
@IPROUTE@ addr show | grep -v valid_lft
@@ -236,7 +239,7 @@ do
trap "$RUN_SUDO kill $opid ; trap - 0 ; exit 1" 1 2 3 15
echo "wait for connection to establish..."
- sleep 10
+ sleep ${SETUP_TIME_WAIT:-10}
# test whether OpenVPN process is still there
if $RUN_SUDO kill -0 $opid