Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2372?usp=email
to review the following change.
Change subject: t_client: don't abort the script on a stuck tentative state
......................................................................
t_client: don't abort the script on a stuck tentative state
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. After it stops, run the pre/post comparison
without the tentative flags.
Github: closes OpenVPN/openvpn#1161
Change-Id: Ie62221eb8256a6691e4fccaef2e1eb0e8f49c835
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M tests/t_client.sh.in
1 file changed, 17 insertions(+), 11 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/72/2372/1
diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in
index d81cef0..39c3a2f 100755
--- a/tests/t_client.sh.in
+++ b/tests/t_client.sh.in
@@ -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"
@@ -563,15 +567,17 @@
fi
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
+ post_cmp=$LOGDIR/$SUF:ifconfig_route_post.txt
+ get_ifconfig_route >$post_cmp
+ if ! check_tentative_state $post_cmp; then
+ # already reported, compare without the tentative flags
+ sed 's/ tentative//g' $post_cmp
>$LOGDIR/$SUF:ifconfig_route_post_nt.txt
+ post_cmp=$LOGDIR/$SUF:ifconfig_route_post_nt.txt
fi
output -n "compare pre- and post-openvpn ifconfig + route..."
if diff $LOGDIR/$SUF:ifconfig_route_pre.txt \
- $LOGDIR/$SUF:ifconfig_route_post.txt
>$LOGDIR/$SUF:ifconfig_route_diff.txt; then
+ $post_cmp >$LOGDIR/$SUF:ifconfig_route_diff.txt; then
output " OK.\n"
else
output "\n\n" "$(cat $LOGDIR/$SUF:ifconfig_route_diff.txt)" "\n"
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2372?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie62221eb8256a6691e4fccaef2e1eb0e8f49c835
Gerrit-Change-Number: 2372
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel