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:
21
server/core/test/rest-api/before.sh
Executable file
21
server/core/test/rest-api/before.sh
Executable 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
|
||||
Reference in New Issue
Block a user