Files
MaxScale/system-test/masking_user.sh
Johan Wikman e522bce80f MXS-3249 Fix mysqltest tests
To avouid failures caused by default MariaDB configuration files
containing entries incompatible with mysqltest, mysqltest is
invoked with the glah --no-defaults, which will cause it *not* to
read any configuration files.
2020-10-27 13:57:34 +02:00

70 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
script=`basename "$0"`
source=$src_dir/masking/$1/masking_rules.json
target=${maxscale_000_whoami}@${maxscale_000_network}:/home/${maxscale_000_whoami}/masking_rules.json
if [ ${maxscale_000_network} != "127.0.0.1" ] ; then
scp -i $maxscale_000_keyfile -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $source $target
else
cp $source /home/${maxscale_000_whoami}/masking_rules.json
fi
if [ $? -ne 0 ]
then
echo "error: Could not copy rules file to maxscale host."
exit 1
fi
echo $source copied to $target, restarting maxscale
ssh -i $maxscale_000_keyfile -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${maxscale_000_whoami}@${maxscale_000_network} 'sudo service maxscale restart'
test_dir=`pwd`
logdir=log_$1
[ -d $logdir ] && rm -r $logdir
mkdir $logdir || exit 1
# [Read Connection Listener Master] in cnf/maxscale.maxscale.cnf.template.$1
port=4008
dir="$src_dir/masking/$1"
user=skysql
test_name=masking_user
mysqltest --no-defaults \
--host=${maxscale_000_network} --port=$port \
--user=$maxscale_user --password=$maxscale_password \
--logdir=$logdir \
--test-file=$dir/t/$test_name.test \
--result-file=$dir/r/"$test_name"_"$user".result \
--silent
if [ $? -eq 0 ]
then
echo " OK"
else
echo " FAILED"
res=1
fi
user=maxskysql
test_name=masking_user
mysqltest --no-defaults \
--host=${maxscale_000_network} --port=$port \
--user=$maxscale_user --password=$maxscale_password \
--logdir=$logdir \
--test-file=$dir/t/$test_name.test \
--result-file=$dir/r/"$test_name"_"$user".result \
--silent
if [ $? -eq 0 ]
then
echo " OK"
else
echo " FAILED"
res=1
fi
echo $res