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.
This commit is contained in:
Markus Mäkelä
2018-05-11 00:10:24 +03:00
parent 16b777ad17
commit b776ed7821
17 changed files with 88 additions and 74 deletions

View File

@ -1,5 +1,8 @@
#!/bin/bash
rp=`realpath $0`
export src_dir=`dirname $rp`
user=skysql
password=skysql
@ -15,18 +18,20 @@ function run_test
local test_name=$1
echo $test_name
logdir=log_$test_name
mkdir -p $logdir
mysqltest --host=$maxscale_IP --port=$port \
--user=$user --password=$password \
--logdir=log \
--test-file=t/$test_name.test \
--result-file=r/$test_name.result \
--logdir=$logdir \
--test-file=$dir/t/$test_name.test \
--result-file=$dir/r/$test_name.result \
--silent
if [ $? -eq 0 ]
then
echo " OK"
rc=0
rc=0
else
echo " FAILED"
rc=1
@ -57,7 +62,9 @@ then
echo "warning: Expected test name to be $expected_name_basic, was $1."
fi
source=cache/$1/cache_rules.json
export dir="$src_dir/cache/$expected_name"
source=$src_dir/cache/$1/cache_rules.json
target=vagrant@$maxscale_IP:/home/$maxscale_access_user/cache_rules.json
if [ $maxscale_IP != "127.0.0.1" ] ; then
@ -78,11 +85,6 @@ test_dir=`pwd`
$test_dir/non_native_setup $1
cd cache/$expected_name
[ -d log ] && rm -r log
mkdir log || exit 1
echo
# We sleep slightly longer than the TTL to ensure that the TTL mechanism