Very often, it takes more than one ^C to terminate test-zbd-support
script. Just a single ^C does end the test that is currently being
executed, but then the script proceeds to the next test. This commit
adds a simple signal handler to exit the test loop after receiving
a Ctrl-C.
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fi
rc=0
+intr=0
+trap 'intr=1' SIGINT
+
for test_number in "${tests[@]}"; do
rm -f "${logfile}.${test_number}"
echo -n "Running test $(printf "%02d" $test_number) ... "
fi
echo -e "$cc_status"
echo "$status" >> "${logfile}.${test_number}"
+ [ $intr -ne 0 ] && exit 1
done
echo "$passed tests passed"