aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2010-08-10 12:39:28 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-10-21 11:40:36 +0200
commit5086d75d8e8a3ec294cdb4ef5dacc403acc96bac (patch)
tree8c3d1d26b1e80a24ed0c20e9cbe1d0a25540915b
parentfull "VPN client connect" test framework for OpenVPN (diff)
downloadopenvpn-5086d75d8e8a3ec294cdb4ef5dacc403acc96bac.tar.xz
Build t_client.sh by configure at run-time.
This is now built using "configure", knows how to find "ip", "ifconfig" and "netstat" (configure does the work :-) ), *and* has been tested on Solaris (works!). extend configure.ac to find "netstat" binary and to chmod +x "t_client.sh" Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: David Sommerseth <dazo@users.sourceforge.net> Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r--configure.ac8
-rwxr-xr-x[-rw-r--r--]t_client.sh.in (renamed from t_client.sh)28
2 files changed, 22 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index c817938..4777108 100644
--- a/configure.ac
+++ b/configure.ac
@@ -266,6 +266,13 @@ AC_ARG_WITH(route-path,
)
AC_DEFINE_UNQUOTED(ROUTE_PATH, "$ROUTE", [Path to route tool])
+AC_ARG_WITH(netstat-path,
+ [ --with-netstat-path=PATH Path to netstat tool],
+ [NETSTAT="$withval"],
+ [AC_PATH_PROG([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc])]
+)
+AC_DEFINE_UNQUOTED(NETSTAT_PATH, "$NETSTAT", [Path to netstat tool])
+
AC_ARG_WITH(mem-check,
[ --with-mem-check=TYPE Build with debug memory checking, TYPE = dmalloc or valgrind],
[MEMCHECK="$withval"]
@@ -913,6 +920,7 @@ if test -z "${htmldir}"; then
fi
# end workaround
+AC_CONFIG_FILES([t_client.sh], [chmod +x t_client.sh])
AC_OUTPUT([
Makefile
openvpn.spec
diff --git a/t_client.sh b/t_client.sh.in
index 3a0dadb..664b2fd 100644..100755
--- a/t_client.sh
+++ b/t_client.sh.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@SHELL@
#
# run OpenVPN client against ``test reference'' server
# - check that ping, http, ... via tunnel works
@@ -79,13 +79,13 @@ fail()
# this is higly system dependent...
get_ifconfig_route()
{
- # linux / iproute2?
- if [ -x /sbin/ip -o -x /usr/sbin/ip ]
+ # linux / iproute2? (-> if configure got a path)
+ if [ "@IPROUTE@" != "ip" ]
then
echo "-- linux iproute2 --"
- ip addr show | grep -v valid_lft
- ip route show
- ip -6 route show | sed -e 's/expires [0-9]*sec //'
+ @IPROUTE@ addr show | grep -v valid_lft
+ @IPROUTE@ route show
+ @IPROUTE@ -6 route show | sed -e 's/expires [0-9]*sec //'
return
fi
@@ -93,27 +93,27 @@ get_ifconfig_route()
case `uname -s` in
Linux)
echo "-- linux / ifconfig --"
- LANG=C ifconfig -a |egrep "( addr:|encap:)"
- LANG=C netstat -rn -4 -6
+ LANG=C @IFCONFIG@ -a |egrep "( addr:|encap:)"
+ LANG=C @NETSTAT@ -rn -4 -6
return
;;
FreeBSD|NetBSD|Darwin)
echo "-- FreeBSD/NetBSD/Darwin [MacOS X] --"
- ifconfig -a | egrep "(flags=|inet)"
- netstat -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }'
+ @IFCONFIG@ -a | egrep "(flags=|inet)"
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }'
return
;;
OpenBSD)
echo "-- OpenBSD --"
- ifconfig -a | egrep "(flags=|inet)" | \
+ @IFCONFIG@ -a | egrep "(flags=|inet)" | \
sed -e 's/pltime [0-9]*//' -e 's/vltime [0-9]*//'
- netstat -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }'
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$NF }'
return
;;
SunOS)
echo "-- Solaris --"
- ifconfig -a | egrep "(flags=|inet)"
- netstat -rn
+ @IFCONFIG@ -a | egrep "(flags=|inet)"
+ @NETSTAT@ -rn | awk '$3 !~ /^UHL/ { print $1,$2,$3,$6 }'
return
;;
esac