Files
MaxScale/maxscale-system-test/run_session_hang.sh
Markus Mäkelä b776ed7821 Don't assume source and binary directories are the same
Some of the scripts assumed that other scripts would be located in the
same directory where the current script was executed.

Also fixed the SSL connection creation which depended on an obsolete
environment variable causing all out-of-source SSL tests to fail.
2018-05-15 10:14:38 +03:00

59 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
###
## @file run_session_hang.sh
## run a set of queries in the loop (see setmix.sql) using Perl client
rp=`realpath $0`
export src_dir=`dirname $rp`
export test_dir=`pwd`
export test_name=`basename $rp`
$test_dir/non_native_setup $test_name
if [ $? -ne 0 ]
then
echo "configuring maxscale failed"
exit 1
fi
export ssl_options="--ssl-cert=$src_dir/ssl-cert/client-cert.pem --ssl-key=$src_dir/ssl-cert/client-key.pem"
echo "drop table if exists t1; create table t1(id integer primary key); " | mysql -u$node_user -p$node_password -h$maxscale_IP -P 4006 $ssl_options test
if [ $? -ne 0 ]
then
echo "Failed to create table test.t1"
exit 1
fi
res=0
$src_dir/session_hang/run_setmix.sh &
perl $src_dir/session_hang/simpletest.pl
if [ $? -ne 0 ]
then
res=1
fi
sleep 15
echo "show databases;" | mysql -u$node_user -p$node_password -h$maxscale_IP -P 4006 $ssl_options
if [ $? -ne 0 ]
then
res=1
fi
echo "Waiting for jobs"
wait
if [ $res -eq 1 ]
then
echo "Test FAILED"
else
echo "Test PASSED"
fi
$src_dir/copy_logs.sh run_session_hang
exit $res