Files
MaxScale/maxscale-system-test/masking_mysqltest_driver.sh
Timofey Turenko 08616692a4 Fixed tests to be compatible with GCloud VMs
GCloud machines has more strict access rights settings. Derect calls of
'chmod' are needed to make all configuration files (e.g. 'fwf/rules') be
accessable by Maxscale.
2020-01-24 13:47:26 +02:00

29 lines
1.1 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
ssh -i $maxscale_000_keyfile -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${maxscale_000_whoami}@${maxscale_000_network} chmod a+r /home/${maxscale_000_whoami}/masking_rules.json
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'
# [Read Connection Listener Master] in cnf/maxscale.maxscale.cnf.template.$1
port=4008
$src_dir/mysqltest_driver.sh $1 $src_dir/masking/$1 $port $maxscale_user $maxscale_password