Added $(ROOT_PATH)/test.inc where test parameters can be added. For example, MaxScale port numbers, usernames, passwords. The file can be included in every */test/makefile so that all test directories can use same parameters if necessary.
Moved checking test results to rwsplit.sh so that tests can use easily different criterias to evaluate test success.
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
#!/bin/sh
|
||||
NARGS=6
|
||||
NARGS=5
|
||||
TLOG=$1
|
||||
TINPUT=$2
|
||||
THOST=$3
|
||||
TPORT=$4
|
||||
TUSER=$5
|
||||
TPWD=$6
|
||||
THOST=$2
|
||||
TPORT=$3
|
||||
TUSER=$4
|
||||
TPWD=$5
|
||||
|
||||
if [ $# != $NARGS ] ;
|
||||
then
|
||||
@ -13,7 +12,7 @@ echo""
|
||||
echo "Wrong number of arguments, gave "$#" but "$NARGS" is required"
|
||||
echo ""
|
||||
echo "Usage :"
|
||||
echo " rwsplit.sh <log filename> <test input> <host> <port> <user> <password>"
|
||||
echo " rwsplit.sh <log filename> <host> <port> <user> <password>"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
@ -21,10 +20,29 @@ fi
|
||||
|
||||
RUNCMD=mysql\ --host=$THOST\ -P$TPORT\ -u$TUSER\ -p$TPWD\ --unbuffered=true\ --disable-reconnect\ --silent
|
||||
|
||||
TINPUT=test_transaction_routing1.sql
|
||||
TRETVAL=2
|
||||
a=`$RUNCMD < ./$TINPUT`
|
||||
if [ "$a" != "2" ]; then
|
||||
echo "$TINPUT FAILED">>$TLOG;
|
||||
if [ "$a" != "$TRETVAL" ]; then
|
||||
echo "$TINPUT FAILED, return value $a when $TRETVAL was expected">>$TLOG;
|
||||
else
|
||||
echo "$TINPUT PASSED">>$TLOG ;
|
||||
fi
|
||||
|
||||
TINPUT=test_transaction_routing2.sql
|
||||
TRETVAL=foo
|
||||
a=`$RUNCMD < ./$TINPUT`
|
||||
if [ "$a" != "$TRETVAL" ]; then
|
||||
echo "$TINPUT FAILED, return value $a when $TRETVAL was expected">>$TLOG;
|
||||
else
|
||||
echo "$TINPUT PASSED">>$TLOG ;
|
||||
fi
|
||||
|
||||
TINPUT=test_transaction_routing3.sql
|
||||
TRETVAL=bar
|
||||
a=`$RUNCMD < ./$TINPUT`
|
||||
if [ "$a" != "$TRETVAL" ]; then
|
||||
echo "$TINPUT FAILED, return value $a when $TRETVAL was expected">>$TLOG;
|
||||
else
|
||||
echo "$TINPUT PASSED">>$TLOG ;
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user