From 9b1035751a2ccddaa4a1d967ba6847e01454341f Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Thu, 27 Mar 2014 17:17:01 +0200 Subject: [PATCH] Made rwsplit test select_for_var_set.sql generic so that master server's id is filled in test.inc. --- server/modules/routing/readwritesplit/test/makefile | 2 +- server/modules/routing/readwritesplit/test/rwsplit.sh | 11 ++++++----- test.inc | 5 +++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/server/modules/routing/readwritesplit/test/makefile b/server/modules/routing/readwritesplit/test/makefile index daea0059b..5c72df1aa 100644 --- a/server/modules/routing/readwritesplit/test/makefile +++ b/server/modules/routing/readwritesplit/test/makefile @@ -30,7 +30,7 @@ runtests: @echo $(shell date) >> $(TESTLOG) @echo "Test MaxScale R/W Split" >> $(TESTLOG) @echo "-------------------------------" >> $(TESTLOG) - ./rwsplit.sh $(TESTLOG) $(THOST) $(TPORT_RW) $(TUSER) $(TPWD) + ./rwsplit.sh $(TESTLOG) $(THOST) $(TPORT_RW) $(TMASTER_ID) $(TUSER) $(TPWD) @echo "" >> $(TESTLOG) diff --git a/server/modules/routing/readwritesplit/test/rwsplit.sh b/server/modules/routing/readwritesplit/test/rwsplit.sh index a62e13345..15f41c50d 100755 --- a/server/modules/routing/readwritesplit/test/rwsplit.sh +++ b/server/modules/routing/readwritesplit/test/rwsplit.sh @@ -1,10 +1,11 @@ #!/bin/sh -NARGS=5 +NARGS=6 TLOG=$1 THOST=$2 TPORT=$3 -TUSER=$4 -TPWD=$5 +TMASTER_ID=$4 +TUSER=$5 +TPWD=$6 if [ $# != $NARGS ] ; then @@ -12,7 +13,7 @@ echo"" echo "Wrong number of arguments, gave "$#" but "$NARGS" is required" echo "" echo "Usage :" -echo " rwsplit.sh " +echo " rwsplit.sh " echo "" exit 1 fi @@ -40,7 +41,7 @@ fi # set a var via SELECT INTO @, get data from master, returning server-id: put master server-id value in TRETVAL TINPUT=select_for_var_set.sql -TRETVAL=2 +TRETVAL=$TMASTER_ID a=`$RUNCMD < ./$TINPUT` if [ "$a" != "$TRETVAL" ]; then diff --git a/test.inc b/test.inc index d14423907..241772b0b 100644 --- a/test.inc +++ b/test.inc @@ -28,3 +28,8 @@ TUSER := # TPWD := maxpwd # TPWD := +# +# master's server_id, for example: +# TMASTER_ID := 2 +# +TMASTER_ID := \ No newline at end of file