Run MaxCtrl test suite in the regression test suite

The MaxCtrl test suite is now a part of the regression test suite. The
cluster tests are expected to fail as that is yet to be implemented.

Also fixed the return value of TestConnections::ssh_maxscale.
This commit is contained in:
Markus Mäkelä
2017-10-11 08:52:56 +03:00
parent 6e4cb3b293
commit 9617b55905
5 changed files with 231 additions and 1 deletions

View File

@ -0,0 +1,70 @@
#!/bin/bash
# Check branch name
ref=$(maxscale --version-full 2>&1|grep -o ' - .*'|sed 's/ - //')
if [ -z "$ref" ]
then
echo "Error: No commit ID in --version-full output"
exit 1
fi
if [ ! -d MaxScale ]
then
git clone https://www.github.com/mariadb-corporation/MaxScale.git
fi
cd MaxScale
git checkout $ref
cd maxctrl
cat <<EOF > start_maxscale.sh
#!/bin/sh
sudo systemctl start maxscale
EOF
cat <<EOF >start_double_maxscale.sh
#!/bin/sh
exit 1
EOF
cat <<EOF >stop_maxscale.sh
#!/bin/sh
sudo systemctl stop maxscale
sudo rm -rf /var/lib/maxscale/*
sudo rm -rf /var/cache/maxscale/*
sudo rm -rf /var/run/maxscale/*
if [ -f /tmp/maxadmin.sock ]
then
sudo rm /tmp/maxadmin.sock
fi
EOF
cat <<EOF >stop_double_maxscale.sh
#!/bin/sh
sudo systemctl stop maxscale
sudo rm -rf /var/lib/maxscale/*
sudo rm -rf /var/cache/maxscale/*
sudo rm -rf /var/run/maxscale/*
if [ -f /tmp/maxadmin.sock ]
then
sudo rm /tmp/maxadmin.sock
fi
EOF
chmod +x *.sh
npm i
# Export the value for --basedir where maxscale binaries are located
export MAXSCALE_DIR=/usr
./stop_maxscale.sh
npm test