Move REST API test scripts into a common directory

Moved and renamed the starting and stopping scripts from the REST API
tests to a common directory. This way the MaxCtrl tests can use the same
scripts to start and stop MaxScale.

Also moved the test configuration file into the `test/` directory and
changed some of the default directory locations.
This commit is contained in:
Markus Mäkelä
2017-07-13 17:09:31 +03:00
parent 173a97ae70
commit 67b2654f50
6 changed files with 17 additions and 16 deletions

28
test/stop_maxscale.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
#
# This script is run after each test block. It kills the MaxScale process
# and cleans up the directories that contain generated files.
#
maxscaledir=$MAXSCALE_DIR
test -z "$MAXSCALE_DIR" && exit 1
for ((i=0;i<20;i++))
do
pkill '^maxscale$' || break
sleep 0.5
done
# If it wasn't dead before, now it is
pkill -9 '^maxscale$'
rm -r $maxscaledir/lib/maxscale
rm -r $maxscaledir/cache/maxscale
rm -r $maxscaledir/run/maxscale
rm /tmp/maxadmin.sock
mkdir -m 0755 -p $maxscaledir/lib/maxscale
mkdir -m 0755 -p $maxscaledir/cache/maxscale
mkdir -m 0755 -p $maxscaledir/run/maxscale