[Openvpn-devel,v2] t_client: don't abort the script on a stuck tentative state
Commit Message
From: Razvan Cojocaru <razvanc@mailbox.org>
Fail only the affected test run instead of exiting the script. Before
openvpn starts, skip the run and clean up. While it runs, record the
failure and carry on. Drop the post-openvpn check: anything left over
from openvpn already fails the pre/post comparison.
Github: closes OpenVPN/openvpn#1161
Change-Id: Ie62221eb8256a6691e4fccaef2e1eb0e8f49c835
Signed-off-by: Razvan Cojocaru <razvanc@mailbox.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2372
---
This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2372
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
@@ -265,7 +265,7 @@
# ----------------------------------------------------------
# check ifconfig output on whether some address is in "tentative" state
-# repeats calling get_ifconfig_route until it does not
+# repeats calling get_ifconfig_route until it does not, fails after 30s
# arg1: log file
check_tentative_state()
{
@@ -414,8 +414,15 @@
output "save pre-openvpn ifconfig + route"
get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_pre.txt
if ! check_tentative_state $LOGDIR/$SUF:ifconfig_route_pre.txt; then
+ output "skip rest of sub-tests for test run $SUF."
+ SUMMARY_FAIL="$SUMMARY_FAIL $SUF"
+ exit_code=30
printf "$outbuf"
- exit 1
+ if [ -n "$test_cleanup" ]; then
+ echo "cleaning up: '$test_cleanup'"
+ eval $test_cleanup
+ fi
+ continue
fi
output "\nrun pre-openvpn ping tests - targets must not be reachable..."
@@ -523,10 +530,7 @@
# compare whether anything changed in ifconfig/route setup?
output "save ifconfig+route"
get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route.txt
- if ! check_tentative_state $LOGDIR/$SUF:ifconfig_route.txt; then
- printf "$outbuf"
- exit 1
- fi
+ check_tentative_state $LOGDIR/$SUF:ifconfig_route.txt
if [ "$expect_ifconfig4" = "-" ]; then
output "skip ifconfig+route check"
@@ -564,10 +568,6 @@
output "\nsave post-openvpn ifconfig + route..."
get_ifconfig_route >$LOGDIR/$SUF:ifconfig_route_post.txt
- if ! check_tentative_state $LOGDIR/$SUF:ifconfig_route_post.txt; then
- printf "$outbuf"
- exit 1
- fi
output -n "compare pre- and post-openvpn ifconfig + route..."
if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \