summaryrefslogtreecommitdiff
path: root/app/openvpn/tests
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-06-13 13:24:13 +0200
committerParménides GV <parmegv@sdf.org>2014-06-13 13:24:13 +0200
commit69b10487fcd63dfe1e94fa97c9f3fd9b035646b4 (patch)
treed4960893a4444634d404c7fbe4fa3e8778d30179 /app/openvpn/tests
parent9f6cfff38ae87922adc022300e1e2fd1c0d4c3e4 (diff)
parente45929e220fe49e30235a1d4d36c1a413547f8bf (diff)
Merge branch 'develop'
Diffstat (limited to 'app/openvpn/tests')
-rw-r--r--app/openvpn/tests/t_client.rc-sample8
-rwxr-xr-xapp/openvpn/tests/t_client.sh.in27
2 files changed, 30 insertions, 5 deletions
diff --git a/app/openvpn/tests/t_client.rc-sample b/app/openvpn/tests/t_client.rc-sample
index dcb3e4ae..6e666077 100644
--- a/app/openvpn/tests/t_client.rc-sample
+++ b/app/openvpn/tests/t_client.rc-sample
@@ -59,18 +59,18 @@ OPENVPN_BASE_P2P="..."
RUN_TITLE_1="testing tun/udp/ipv4+ipv6"
OPENVPN_CONF_1="$OPENVPN_BASE_P2MP --dev tun --proto udp --remote $REMOTE --port 51194"
EXPECT_IFCONFIG4_1="10.100.50.6"
-EXPECT_IFCONFIG6_1="2001:dba:a050::1:0"
+EXPECT_IFCONFIG6_1="2001:db8:a050::1:0"
PING4_HOSTS_1="10.100.50.1 10.100.0.1"
-PING6_HOSTS_1="2001:dba::1 2001:dba:a050::1"
+PING6_HOSTS_1="2001:db8::1 2001:db8:a050::1"
# Test 2: TCP / p2mp tun
#
RUN_TITLE_2="testing tun/tcp/ipv4+ipv6"
OPENVPN_CONF_2="$OPENVPN_BASE_P2MP --dev tun --proto tcp --remote $REMOTE --port 51194"
EXPECT_IFCONFIG4_2="10.100.51.6"
-EXPECT_IFCONFIG6_2="2001:dba:a051::1:0"
+EXPECT_IFCONFIG6_2="2001:db8:a051::1:0"
PING4_HOSTS_2="10.100.51.1 10.100.0.1"
-PING6_HOSTS_1="2001:dba::1 2001:dba:a051::1"
+PING6_HOSTS_2="2001:db8::1 2001:db8:a051::1"
# Test 3: UDP / p2p tun
# ...
diff --git a/app/openvpn/tests/t_client.sh.in b/app/openvpn/tests/t_client.sh.in
index 189eecce..52c5ed1a 100755
--- a/app/openvpn/tests/t_client.sh.in
+++ b/app/openvpn/tests/t_client.sh.in
@@ -24,6 +24,18 @@ else
exit 77
fi
+# Check for external dependencies
+which fping > /dev/null
+if [ $? -ne 0 ]; then
+ echo "$0: fping is not available in \$PATH" >&2
+ exit 77
+fi
+which fping6 > /dev/null
+if [ $? -ne 0 ]; then
+ echo "$0: fping6 is not available in \$PATH" >&2
+ exit 77
+fi
+
if [ ! -x "${top_builddir}/src/openvpn/openvpn" ]
then
echo "no (executable) openvpn binary in current build tree. FAIL." >&2
@@ -91,7 +103,7 @@ get_ifconfig_route()
echo "-- linux iproute2 --"
@IPROUTE@ addr show | grep -v valid_lft
@IPROUTE@ route show
- @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -e 's/expires [0-9]*sec//'
+ @IPROUTE@ -o -6 route show | grep -v ' cache' | sed -E -e 's/ expires [0-9]*sec//' -e 's/ (mtu|hoplimit|cwnd|ssthresh) [0-9]+//g' -e 's/ (rtt|rttvar) [0-9]+ms//g'
return
fi
@@ -209,6 +221,8 @@ SUMMARY_FAIL=
for SUF in $TEST_RUN_LIST
do
# get config variables
+ eval test_prep=\"\$PREPARE_$SUF\"
+ eval test_cleanup=\"\$CLEANUP_$SUF\"
eval test_run_title=\"\$RUN_TITLE_$SUF\"
eval openvpn_conf=\"\$OPENVPN_CONF_$SUF\"
eval expect_ifconfig4=\"\$EXPECT_IFCONFIG4_$SUF\"
@@ -219,6 +233,11 @@ do
echo -e "\n### test run $SUF: '$test_run_title' ###\n"
fail_count=0
+ if [ -n "$test_prep" ]; then
+ echo -e "running preparation: '$test_prep'"
+ eval $test_prep
+ fi
+
echo "save pre-openvpn ifconfig + route"
get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_pre.txt
@@ -304,6 +323,12 @@ do
SUMMARY_FAIL="$SUMMARY_FAIL $SUF"
exit_code=30
fi
+
+ if [ -n "$test_cleanup" ]; then
+ echo -e "cleaning up: '$test_cleanup'"
+ eval $test_cleanup
+ fi
+
done
if [ -z "$SUMMARY_OK" ] ; then SUMMARY_OK=" none"; fi