Files
MaxScale/maxscale-system-test/test_ctrl_c/test_ctrl_c.sh
Markus Mäkelä b3eb5ccc81 Fix run_ctrl_c.sh on newer systems
Systems that no longer support SysV init scripts and the service command
need to use systemctl.
2019-07-01 17:13:09 +03:00

29 lines
419 B
Bash
Executable File

#!/bin/bash
sudo systemctl stop maxscale || sudo service maxscale stop
hm=`pwd`
$hm/start_killer.sh &
if [ $? -ne 0 ] ; then
exit 1
fi
T="$(date +%s)"
sudo maxscale -d -U root
if [ $? -ne 0 ] ; then
exit 1
fi
T="$(($(date +%s)-T))"
echo "Time in seconds: ${T} (including 5 seconds before kill)"
if [ "$T" -lt 10 ] ; then
echo "PASSED"
exit 0
else
echo "FAILED"
exit 1
fi