aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-08-30 15:30:49 +0200
committerTobias Brunner <tobias@strongswan.org>2016-08-30 16:16:42 +0200
commit379d94eb70440df7d4844732e7458b281b534ab1 (patch)
tree20c0c7772ceb940c75c69b498fb57fdef111a67a
parentbdd7c42fc0d9d5804b76df5bc2d88a3f1fc76f64 (diff)
downloadstrongswan-379d94eb70440df7d4844732e7458b281b534ab1.tar.bz2
strongswan-379d94eb70440df7d4844732e7458b281b534ab1.tar.xz
testing: Try to properly abort a test run after CTRL-C
The run is aborted after the current scenario. Depending on which command was interrupted it might be necessary to press CTRL-C multiple times (e.g. if a later command depends on the interrupted one). This should fix HTML files and get us some proper console output after the run.
-rwxr-xr-xtesting/do-tests15
1 files changed, 15 insertions, 0 deletions
diff --git a/testing/do-tests b/testing/do-tests
index 6548345e1..8330f95ad 100755
--- a/testing/do-tests
+++ b/testing/do-tests
@@ -182,6 +182,16 @@ echo "strongSwan : $SWANVERSION"
echo "Date : $TESTDATE"
echo
+##############################################################################
+# trap CTRL-C to properly terminate a long run
+#
+
+function abort_tests()
+{
+ echo -n "...aborting..." > /dev/tty
+ aborted=YES
+}
+trap abort_tests INT
##############################################################################
# enter specific test directory
@@ -879,6 +889,11 @@ do
ssh $SSHCONF $HOSTLOGIN 'if [ -f /var/run/charon.pid ]; then rm /var/run/charon.pid; echo " removed charon.pid on `hostname`"; fi'
done
+ if [ -n "$aborted" ]
+ then
+ break 2
+ fi
+
done
done