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.
This commit is contained in:
Markus Mäkelä
2017-05-04 16:21:37 +03:00
parent 6b0fabf834
commit a3c683ab87
5 changed files with 78 additions and 15 deletions

View File

@ -0,0 +1,21 @@
#!/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