ctdb-tests: Improve signal handling trap
authorMartin Schwenke <martin@meltin.net>
Mon, 8 Oct 2018 02:39:30 +0000 (13:39 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 6 Nov 2018 06:16:16 +0000 (07:16 +0100)
Interrupting a test run currently moves on to the next test.  It
should exit.

Follow the practice of exiting with 128 + signal number.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/run_tests.sh

index dc9027df99687829820d47fb9889049510aa1598..48fd0624f75675156cc66c88652eab525cc72c03 100755 (executable)
@@ -284,7 +284,8 @@ do_cleanup ()
     fi
 }
 
-trap do_cleanup SIGINT SIGTERM
+trap "do_cleanup ; exit 130" SIGINT
+trap "do_cleanup ; exit 143" SIGTERM
 
 declare -a tests
 i=0