Merge branch 'release-1.0GA' of https://github.com/mariadb-corporation/MaxScale into release-1.0GA
This commit is contained in:
@ -33,7 +33,7 @@ macro(set_variables)
|
|||||||
set(TEST_PORT_RW "4006" CACHE STRING "port of read/write split router module")
|
set(TEST_PORT_RW "4006" CACHE STRING "port of read/write split router module")
|
||||||
|
|
||||||
# port of read/write split router module with hints
|
# port of read/write split router module with hints
|
||||||
set(TEST_PORT_RW_HINT "4006" CACHE STRING "port of read/write split router module with hints")
|
set(TEST_PORT_RW_HINT "4009" CACHE STRING "port of read/write split router module with hints")
|
||||||
|
|
||||||
# master test server server_id
|
# master test server server_id
|
||||||
set(TEST_MASTER_ID "3000" CACHE STRING "master test server server_id")
|
set(TEST_MASTER_ID "3000" CACHE STRING "master test server server_id")
|
||||||
|
@ -503,7 +503,7 @@ hashtable_read_lock(HASHTABLE *table)
|
|||||||
;
|
;
|
||||||
spinlock_acquire(&table->spin);
|
spinlock_acquire(&table->spin);
|
||||||
}
|
}
|
||||||
table->n_readers++;
|
atomic_add(&table->n_readers, 1);
|
||||||
spinlock_release(&table->spin);
|
spinlock_release(&table->spin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
add_test(NAME SimpleHintTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit_hints.sh hints.log ${TEST_HOST} ${TEST_PORT_RW_HINT} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} simple_tests ${CMAKE_CURRENT_SOURCE_DIR})
|
add_test(NAME SimpleHintTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit_hints.sh ${CMAKE_CURRENT_BINARY_DIR}/hints.log ${TEST_HOST} ${TEST_PORT_RW_HINT} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} ${CMAKE_CURRENT_SOURCE_DIR}/simple_tests ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
add_test(NAME ComplexHintTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit_hints.sh hints.log ${TEST_HOST} ${TEST_PORT_RW_HINT} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} complex_tests ${CMAKE_CURRENT_SOURCE_DIR})
|
add_test(NAME ComplexHintTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit_hints.sh ${CMAKE_CURRENT_BINARY_DIR}/hints.log ${TEST_HOST} ${TEST_PORT_RW_HINT} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} ${CMAKE_CURRENT_SOURCE_DIR}/complex_tests ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
add_test(NAME StackHintTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit_hints.sh hints.log ${TEST_HOST} ${TEST_PORT_RW_HINT} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} stack_tests ${CMAKE_CURRENT_SOURCE_DIR})
|
add_test(NAME StackHintTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit_hints.sh ${CMAKE_CURRENT_BINARY_DIR}/hints.log ${TEST_HOST} ${TEST_PORT_RW_HINT} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} ${CMAKE_CURRENT_SOURCE_DIR}/stack_tests ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
@ -7,16 +7,16 @@ TMASTER_ID=$4
|
|||||||
TUSER=$5
|
TUSER=$5
|
||||||
TPWD=$6
|
TPWD=$6
|
||||||
TESTINPUT=$7
|
TESTINPUT=$7
|
||||||
|
TESTFILE=$PWD/$(basename -z $TESTINPUT)
|
||||||
if [ $# -lt $(( NARGS - 1 )) ] ;
|
if [ $# -lt $(( NARGS - 1 )) ] ;
|
||||||
then
|
then
|
||||||
echo""
|
echo""
|
||||||
echo "Wrong number of arguments, gave "$#" but "$(( NARGS - 1 ))" is required"
|
echo "Wrong number of arguments, gave "$#" but "$(( NARGS - 1 ))" is required"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Usage :"
|
echo "Usage :"
|
||||||
echo " rwsplit_hints.sh <log filename> <host> <port> <master id> <user> <password> <test file>"
|
echo " rwsplit_hints.sh <log filename> <host> <port> <master id> <user> <password> <test file>"
|
||||||
echo ""
|
echo ""
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $# -eq $NARGS ]
|
if [ $# -eq $NARGS ]
|
||||||
@ -26,20 +26,18 @@ else
|
|||||||
TDIR=.
|
TDIR=.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TESTINPUT=$TDIR/$TESTINPUT
|
|
||||||
|
|
||||||
RUNCMD=mysql\ --host=$THOST\ -P$TPORT\ -u$TUSER\ -p$TPWD\ --unbuffered=true\ --disable-reconnect\ --silent\ --comment
|
RUNCMD=mysql\ --host=$THOST\ -P$TPORT\ -u$TUSER\ -p$TPWD\ --unbuffered=true\ --disable-reconnect\ --silent\ --comment
|
||||||
i=0
|
i=0
|
||||||
|
|
||||||
while read -r LINE
|
while read -r LINE
|
||||||
do
|
do
|
||||||
TINPUT[$i]=`echo "$LINE"|awk '{split($0,a,":");print a[1]}'`
|
TINPUT[$i]=`echo "$LINE"|awk '{split($0,a,":");print a[1]}'`
|
||||||
TRETVAL[$i]=`echo "$LINE"|awk '{split($0,a,":");print a[2]}'`
|
TRETVAL[$i]=`echo "$LINE"|awk '{split($0,a,":");print a[2]}'`
|
||||||
echo "${TINPUT[i]}" >> $TESTINPUT.sql
|
echo "${TINPUT[i]}" >> $TESTFILE.sql
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
done < $TESTINPUT
|
done < $TESTINPUT
|
||||||
|
|
||||||
`$RUNCMD < $TESTINPUT.sql > $TESTINPUT.output`
|
`$RUNCMD < $TESTFILE.sql > $TESTFILE.output`
|
||||||
|
|
||||||
x=0
|
x=0
|
||||||
crash=1
|
crash=1
|
||||||
@ -47,32 +45,31 @@ all_passed=1
|
|||||||
|
|
||||||
while read -r TOUTPUT
|
while read -r TOUTPUT
|
||||||
do
|
do
|
||||||
crash=0
|
crash=0
|
||||||
if [ "$TOUTPUT" != "${TRETVAL[x]}" -a "${TRETVAL[x]}" != "" ]
|
if [ "$TOUTPUT" != "${TRETVAL[x]}" -a "${TRETVAL[x]}" != "" ]
|
||||||
then
|
then
|
||||||
all_passed=0
|
all_passed=0
|
||||||
echo "$TESTINPUT:$((x + 1)): ${TINPUT[x]} FAILED, return value $TOUTPUT when ${TRETVAL[x]} was expected">>$TLOG;
|
echo "$TESTINPUT:$((x + 1)): ${TINPUT[x]} FAILED, return value $TOUTPUT when ${TRETVAL[x]} was expected">>$TLOG;
|
||||||
fi
|
fi
|
||||||
x=$((x+1))
|
x=$((x+1))
|
||||||
done < $TESTINPUT.output
|
done < $TESTFILE.output
|
||||||
|
|
||||||
if [ $crash -eq 1 ]
|
if [ $crash -eq 1 ]
|
||||||
then
|
then
|
||||||
all_passed=0
|
all_passed=0
|
||||||
for ((v=0;v<$i;v++))
|
for ((v=0;v<$i;v++))
|
||||||
do
|
do
|
||||||
echo "${TINPUT[v]} FAILED, nothing was returned">>$TLOG;
|
echo "${TINPUT[v]} FAILED, nothing was returned">>$TLOG;
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $all_passed -eq 1 ]
|
if [ $all_passed -eq 1 ]
|
||||||
then
|
then
|
||||||
echo "Test set: PASSED">>$TLOG;
|
echo "Test set: PASSED">>$TLOG;
|
||||||
|
cat $TLOG
|
||||||
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Test set: FAILED">>$TLOG;
|
echo "Test set: FAILED">>$TLOG;
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $# -eq $NARGS ]
|
|
||||||
then
|
|
||||||
cat $TLOG
|
cat $TLOG
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user