Files
MaxScale/server/core/test/rest-api/after.sh
Markus Mäkelä 1067fd352c MXS-1220: Add creation and deletion of admin users
Admin users can now be created via the REST API. This allows remote
management of the administrative interface itself.
2017-05-24 15:05:11 +03:00

31 lines
670 B
Bash
Executable File

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