Attention is currently required from: flichtenheld, mattock, plaisthos.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/775?usp=email
to look at the new patch set (#5).
Change subject: t_server_null: forcibly kill misbehaving servers
......................................................................
t_server_null: forcibly kill misbehaving servers
Change-Id: Ic0f98cd3b87a7b86e032e63167ac9036f7c08fcb
Signed-off-by: Samuli Seppänen <[email protected]>
---
M tests/t_server_null.sh
M tests/t_server_null_default.rc
M tests/t_server_null_server.sh
3 files changed, 20 insertions(+), 7 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/75/775/5
diff --git a/tests/t_server_null.sh b/tests/t_server_null.sh
index 7627edf..8fe1660 100755
--- a/tests/t_server_null.sh
+++ b/tests/t_server_null.sh
@@ -67,4 +67,10 @@
# pre and post ifconfig output does not match.
wait
-exit $retval
+. ./t_server_null_default.rc
+
+if [ -e $SERVER_KILL_FAIL_FILE ]; then
+ exit 1
+else
+ exit $retval
+fi
diff --git a/tests/t_server_null_default.rc b/tests/t_server_null_default.rc
index 825bb52..cbf4877 100755
--- a/tests/t_server_null_default.rc
+++ b/tests/t_server_null_default.rc
@@ -20,6 +20,10 @@
SERVER_KEY="${sample_keys}/server.key"
TA="${sample_keys}/ta.key"
+# Used to detect if graceful kill of any server instance failed during the test
+# run
+SERVER_KILL_FAIL_FILE=".t_server_null_server.kill_failed"
+
# Test server configurations
MAX_CLIENTS="10"
CLIENT_MATCH="Test-Client"
diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh
index 10bb44b..4654ccb 100755
--- a/tests/t_server_null_server.sh
+++ b/tests/t_server_null_server.sh
@@ -36,6 +36,9 @@
# Load local configuration, if any
test -r ./t_server_null.rc && . ./t_server_null.rc
+# Remove server kill failure marker file, if any
+rm -f $SERVER_KILL_FAIL_FILE
+
# Launch test servers
for SUF in $TEST_SERVER_LIST
do
@@ -87,11 +90,8 @@
continue
fi
- if [ -z "${RUN_SUDO}" ]; then
- $KILL_EXEC "${SERVER_PID}"
- else
- $RUN_SUDO $KILL_EXEC "${SERVER_PID}"
- fi
+ # Attempt to kill the OpenVPN server gracefully with SIGTERM
+ $RUN_SUDO $KILL_EXEC "${SERVER_PID}"
count=0
maxcount=75
@@ -102,7 +102,10 @@
sleep 0.2
done
+ # If server is still up send a SIGKILL
if [ $count -ge $maxcount ]; then
- echo "WARNING: could not kill server with pid ${SERVER_PID}!"
+ $RUN_SUDO $KILL_EXEC -9 "${SERVER_PID}"
+ echo "ERROR: had to send SIGKILL to server with pid ${SERVER_PID}!"
+ touch $SERVER_KILL_FAIL_FILE
fi
done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/775?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic0f98cd3b87a7b86e032e63167ac9036f7c08fcb
Gerrit-Change-Number: 775
Gerrit-PatchSet: 5
Gerrit-Owner: mattock <[email protected]>
Gerrit-Reviewer: cron2 <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Attention: mattock <[email protected]>
Gerrit-MessageType: newpatchset
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel