Markus Mäkelä a3c683ab87 MXS-1220: Simplify test creation
The tests now automatically start MaxScale before each test block and stop
it and perform cleanup after the test. This is done by simply calling the
`before.sh` and `after.sh` scripts before each test block.
2017-05-09 15:32:42 +03:00

22 lines
429 B
Bash
Executable File

#!/bin/bash
#
# This script is run before each test block. It starts MaxScale and waits for it
# to become responsive.
#
maxscaledir=$MAXSCALE_DIR
test -z "$MAXSCALE_DIR" && exit 1
# Start MaxScale
$maxscaledir/bin/maxscale -df $maxscaledir/maxscale.cnf >& $maxscaledir/maxscale.output &
pid=$!
# Wait for MaxScale to start
for ((i=0;i<60;i++))
do
$maxscaledir/bin/maxadmin help >& /dev/null && break
sleep 0.1
done