mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
ctdb-tests: Remove -q option to try_command_on_node
This option is always passed to onnode by default. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
parent
6de10acec3
commit
780391c0ba
@ -38,7 +38,7 @@ try_command_on_node 0 "$CTDB listnodes"
|
||||
num_nodes=$(echo "$out" | wc -l)
|
||||
|
||||
echo "Running ctdb_bench on all $num_nodes nodes."
|
||||
try_command_on_node -v -pq all $CTDB_TEST_WRAPPER $VALGRIND ctdb_bench -n $num_nodes
|
||||
try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND ctdb_bench -n $num_nodes
|
||||
|
||||
# Get the last line of output.
|
||||
while read line ; do
|
||||
|
@ -38,7 +38,7 @@ try_command_on_node 0 "$CTDB listnodes"
|
||||
num_nodes=$(echo "$out" | wc -l)
|
||||
|
||||
echo "Running ctdb_fetch on all $num_nodes nodes."
|
||||
try_command_on_node -v -pq all $CTDB_TEST_WRAPPER $VALGRIND ctdb_fetch -n $num_nodes
|
||||
try_command_on_node -v -p all $CTDB_TEST_WRAPPER $VALGRIND ctdb_fetch -n $num_nodes
|
||||
|
||||
pat='^(Fetch: [[:digit:]]+(\.[[:digit:]]+)? msgs/sec[[:space:]]?|msg_count=[[:digit:]]+ on node [[:digit:]]|Fetching final record|DATA:|Test data|Waiting for cluster[[:space:]]?|.*: Reqid wrap!|Sleeping for [[:digit:]]+ seconds|)+$'
|
||||
sanity_check_output 1 "$pat" "$out"
|
||||
|
@ -40,4 +40,4 @@ fi
|
||||
t="$CTDB_TEST_WRAPPER $VALGRIND ctdb_transaction --timelimit=${CTDB_TEST_TIMELIMIT}"
|
||||
|
||||
echo "Running ctdb_transaction on all $num_nodes nodes."
|
||||
try_command_on_node -v -pq all "$t & $t"
|
||||
try_command_on_node -v -p all "$t & $t"
|
||||
|
@ -62,5 +62,5 @@ echo "Starting recovery loop"
|
||||
recovery_loop_start
|
||||
|
||||
echo "Running ctdb_transaction on all $num_nodes nodes."
|
||||
try_command_on_node -v -pq all "$t & $t"
|
||||
try_command_on_node -v -p all "$t & $t"
|
||||
|
||||
|
@ -53,12 +53,12 @@ num_nodes=$(echo "$out" | wc -l)
|
||||
|
||||
# create a temporary persistent database to test with
|
||||
echo create persistent test database persistent_test.tdb
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb attach persistent_test.tdb persistent
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb attach persistent_test.tdb persistent
|
||||
|
||||
|
||||
# set RecoverPDBBySeqNum=0
|
||||
echo "setting RecoverPDBBySeqNum to 0"
|
||||
try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0
|
||||
try_command_on_node all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0
|
||||
|
||||
|
||||
|
||||
@ -70,21 +70,21 @@ try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0
|
||||
echo
|
||||
echo test that RecoverPDBBySeqNum==0 and no __db_sequence_number__ blends the database during recovery
|
||||
echo wipe the test database
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
|
||||
# add one record to node 0 key==ABC data==ABC
|
||||
TDB=`try_command_on_node -v -q 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(ABC) data(ABC) on node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
#
|
||||
# add one record to node 1 key==DEF data==DEF
|
||||
TDB=`try_command_on_node -v -q 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(DEF) data(DEF) on node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
|
||||
# force a recovery
|
||||
echo force a recovery
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
# check that we now have both records on node 0
|
||||
num_records=$(try_command_on_node -v -pq 0 $CTDB_TEST_WRAPPER ctdb cattdb persistent_test.tdb | grep key | egrep "ABC|DEF" | wc -l)
|
||||
@ -104,31 +104,31 @@ echo "OK. databases were blended"
|
||||
echo
|
||||
echo test that RecoverPDBBySeqNum==0 and __db_sequence_number__ blends the database during recovery
|
||||
echo wipe the test database
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
|
||||
echo "add __db_sequence_number__==5 record to all nodes"
|
||||
try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb nodestatus all | grep pnn | sed -e"s/^pnn://" -e "s/ .*//" | while read PNN; do
|
||||
TDB=`try_command_on_node -v -q $PNN $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
try_command_on_node -q $PNN $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000500000000000000
|
||||
TDB=`try_command_on_node -v $PNN $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
try_command_on_node $PNN $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000500000000000000
|
||||
done
|
||||
|
||||
# add one record to node 0 key==ABC data==ABC
|
||||
TDB=`try_command_on_node -v -q 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(ABC) data(ABC) on node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
echo "add __db_sequence_number__==7 record to node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000700000000000000
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000700000000000000
|
||||
|
||||
# add one record to node 1 key==DEF data==DEF
|
||||
TDB=`try_command_on_node -v -q 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(DEF) data(DEF) on node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
echo "add __db_sequence_number__==8 record to node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000800000000000000
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000800000000000000
|
||||
|
||||
# force a recovery
|
||||
echo force a recovery
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
# check that we now have both records on node 0
|
||||
num_records=$(try_command_on_node -v -pq 0 $CTDB_TEST_WRAPPER ctdb cattdb persistent_test.tdb | grep key | egrep "ABC|DEF" | wc -l)
|
||||
@ -143,7 +143,7 @@ echo "OK. databases were blended"
|
||||
# set RecoverPDBBySeqNum=1
|
||||
echo
|
||||
echo "setting RecoverPDBBySeqNum to 1"
|
||||
try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 1
|
||||
try_command_on_node all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 1
|
||||
|
||||
|
||||
|
||||
@ -155,21 +155,21 @@ try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 1
|
||||
echo
|
||||
echo test that RecoverPDBBySeqNum==1 and no __db_sequence_number__ blends the database during recovery
|
||||
echo wipe the test database
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
|
||||
# add one record to node 0 key==ABC data==ABC
|
||||
TDB=`try_command_on_node -v -q 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(ABC) data(ABC) on node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
|
||||
# add one record to node 1 key==DEF data==DEF
|
||||
TDB=`try_command_on_node -v -q 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(DEF) data(DEF) on node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
|
||||
# force a recovery
|
||||
echo force a recovery
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
# check that we now have both records on node 0
|
||||
num_records=$(try_command_on_node -v -pq 0 $CTDB_TEST_WRAPPER ctdb cattdb persistent_test.tdb | grep key | egrep "ABC|DEF" | wc -l)
|
||||
@ -189,32 +189,32 @@ echo "OK. databases were blended"
|
||||
echo
|
||||
echo test that RecoverPDBBySeqNum==1 and __db_sequence_number__ does not blend the database during recovery
|
||||
echo wipe the test database
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
|
||||
echo "add __db_sequence_number__==5 record to all nodes"
|
||||
try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb nodestatus all | grep pnn | sed -e"s/^pnn://" -e "s/ .*//" | while read PNN; do
|
||||
TDB=`try_command_on_node -v -q $PNN $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
try_command_on_node -q $PNN $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000500000000000000
|
||||
TDB=`try_command_on_node -v $PNN $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
try_command_on_node $PNN $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000500000000000000
|
||||
done
|
||||
|
||||
|
||||
# add one record to node 0 key==ABC data==ABC
|
||||
TDB=`try_command_on_node -v -q 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(ABC) data(ABC) on node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
echo "add __db_sequence_number__==7 record to node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000700000000000000
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000700000000000000
|
||||
|
||||
# add one record to node 1 key==DEF data==DEF
|
||||
TDB=`try_command_on_node -v -q 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(DEF) data(DEF) on node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
echo "add __db_sequence_number__==8 record to node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000800000000000000
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x5f5f64625f73657175656e63655f6e756d6265725f5f00 0x0700000000000000000000000000000000000000000000000800000000000000
|
||||
|
||||
# force a recovery
|
||||
echo force a recovery
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
# check that we now have both records on node 0
|
||||
num_records=$(try_command_on_node -v -pq 0 $CTDB_TEST_WRAPPER ctdb cattdb persistent_test.tdb | grep key | egrep "ABC|DEF" | wc -l)
|
||||
@ -229,4 +229,4 @@ echo "OK. databases were not blended"
|
||||
|
||||
# set RecoverPDBBySeqNum=1
|
||||
echo "setting RecoverPDBBySeqNum back to 0"
|
||||
try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0
|
||||
try_command_on_node all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0
|
||||
|
@ -37,26 +37,26 @@ num_nodes=$(echo "$out" | wc -l)
|
||||
|
||||
# create a temporary persistent database to test with
|
||||
echo create persistent test database persistent_test.tdb
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb attach persistent_test.tdb persistent
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb attach persistent_test.tdb persistent
|
||||
|
||||
|
||||
# 3,
|
||||
# add one record to node 0 key==ABC data==ABC
|
||||
TDB=`try_command_on_node -v -q 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(ABC) data(ABC) on node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x414243 0x070000000000000000000000000000000000000000000000414243
|
||||
#
|
||||
# add one record to node 1 key==DEF data==DEF
|
||||
TDB=`try_command_on_node -v -q 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
TDB=`try_command_on_node -v 1 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"`
|
||||
echo "store key(DEF) data(DEF) on node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb tstore $TDB 0x444546 0x070000000000000000000000000000000000000000000000444546
|
||||
|
||||
|
||||
# 4,
|
||||
echo wipe the persistent test database
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb
|
||||
echo force a recovery
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
# check that the database is wiped
|
||||
num_records=$(try_command_on_node -v -pq 1 $CTDB_TEST_WRAPPER ctdb cattdb persistent_test.tdb | grep key | wc -l)
|
||||
|
@ -41,14 +41,14 @@ TDB=persistent_test.tdb
|
||||
|
||||
# create a temporary persistent database to test with
|
||||
echo create persistent test database $TDB
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb attach $TDB persistent
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb attach $TDB persistent
|
||||
|
||||
|
||||
# 3,
|
||||
echo wipe the persistent test database
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb $TDB
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb $TDB
|
||||
echo force a recovery
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
# check that the database is wiped
|
||||
num_records=$(try_command_on_node -v -pq 1 $CTDB_TEST_WRAPPER ctdb cattdb $TDB | grep key | wc -l)
|
||||
@ -60,9 +60,9 @@ echo "OK. database was wiped"
|
||||
|
||||
# 4,
|
||||
echo Create a new record in the persistent database using UPDATE_RECORD
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb_update_record_persistent --database=$TDB --record=Update_Record_Persistent --value=FirstValue
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb_update_record_persistent --database=$TDB --record=Update_Record_Persistent --value=FirstValue
|
||||
|
||||
try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'FirstValue' | wc -l"
|
||||
try_command_on_node 0 "ctdb cattdb $TDB | grep 'FirstValue' | wc -l"
|
||||
[ $out != 1 ] && {
|
||||
echo "BAD: we did find the record after the create/update"
|
||||
exit 1
|
||||
@ -70,15 +70,15 @@ try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'FirstValue' | wc -l"
|
||||
|
||||
# 5,
|
||||
echo Modify an existing record in the persistent database using UPDATE_RECORD
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb_update_record_persistent --database=$TDB --record=Update_Record_Persistent --value=SecondValue
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb_update_record_persistent --database=$TDB --record=Update_Record_Persistent --value=SecondValue
|
||||
|
||||
try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'FirstValue' | wc -l"
|
||||
try_command_on_node 0 "ctdb cattdb $TDB | grep 'FirstValue' | wc -l"
|
||||
[ $out != 0 ] && {
|
||||
echo "BAD: we still found the old record after the modify/update"
|
||||
exit 1
|
||||
}
|
||||
|
||||
try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'SecondValue' | wc -l"
|
||||
try_command_on_node 0 "ctdb cattdb $TDB | grep 'SecondValue' | wc -l"
|
||||
[ $out != 1 ] && {
|
||||
echo "BAD: could not find the record after the modify/update"
|
||||
exit 1
|
||||
@ -86,4 +86,4 @@ try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'SecondValue' | wc -l"
|
||||
|
||||
|
||||
echo wipe the persistent test databases and clean up
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb $TDB
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb $TDB
|
||||
|
@ -45,19 +45,19 @@ fi
|
||||
|
||||
echo "Wait until the ips are reallocated"
|
||||
sleep 30
|
||||
try_command_on_node -q 0 "$CTDB ipreallocate"
|
||||
try_command_on_node 0 "$CTDB ipreallocate"
|
||||
|
||||
num=`try_command_on_node -v 1 "$CTDB ip" | grep -v Public | egrep " 1$" | wc -l`
|
||||
echo "Number of addresses on node 1 : $num"
|
||||
|
||||
|
||||
echo "Turning on NoIPTakeover on node 1"
|
||||
try_command_on_node -q 1 "$CTDB setvar NoIPTakeover 1"
|
||||
try_command_on_node -q 1 "$CTDB ipreallocate"
|
||||
try_command_on_node 1 "$CTDB setvar NoIPTakeover 1"
|
||||
try_command_on_node 1 "$CTDB ipreallocate"
|
||||
|
||||
echo Disable node 1
|
||||
try_command_on_node -q 1 "$CTDB disable"
|
||||
try_command_on_node -q 1 "$CTDB ipreallocate"
|
||||
try_command_on_node 1 "$CTDB disable"
|
||||
try_command_on_node 1 "$CTDB ipreallocate"
|
||||
num=`try_command_on_node -v 1 "$CTDB ip" | grep -v Public | egrep " 1$" | wc -l`
|
||||
echo "Number of addresses on node 1 : $num"
|
||||
[ "$num" != "0" ] && {
|
||||
@ -67,10 +67,10 @@ echo "Number of addresses on node 1 : $num"
|
||||
|
||||
|
||||
echo "Enable node 1 again"
|
||||
try_command_on_node -q 1 "$CTDB enable"
|
||||
try_command_on_node 1 "$CTDB enable"
|
||||
sleep 30
|
||||
try_command_on_node -q 1 "$CTDB ipreallocate"
|
||||
try_command_on_node -q 1 "$CTDB ipreallocate"
|
||||
try_command_on_node 1 "$CTDB ipreallocate"
|
||||
try_command_on_node 1 "$CTDB ipreallocate"
|
||||
num=`try_command_on_node -v 1 "$CTDB ip" | grep -v Public | egrep " 1$" | wc -l`
|
||||
echo "Number of addresses on node 1 : $num"
|
||||
[ "$num" != "0" ] && {
|
||||
|
@ -56,17 +56,17 @@ num_nodes=$(echo "$out" | wc -l)
|
||||
|
||||
# create a temporary database to test with
|
||||
echo create test database test.tdb
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb attach test.tdb
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb attach test.tdb
|
||||
|
||||
|
||||
# create some records
|
||||
try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
try_command_on_node all $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
|
||||
#
|
||||
# 3
|
||||
# try readonly requests
|
||||
echo Try some readonly fetches, these should all be upgraded to full fetchlocks
|
||||
try_command_on_node -q 0,1,2 $CTDB_TEST_WRAPPER "ctdb_fetch_readonly_once </dev/null"
|
||||
try_command_on_node 0,1,2 $CTDB_TEST_WRAPPER "ctdb_fetch_readonly_once </dev/null"
|
||||
|
||||
# no delegations should have been created
|
||||
numreadonly=`try_command_on_node -v all $CTDB_TEST_WRAPPER ctdb cattdb test.tdb | grep READONLY | wc -l`
|
||||
@ -82,7 +82,7 @@ numreadonly=`try_command_on_node -v all $CTDB_TEST_WRAPPER ctdb cattdb test.tdb
|
||||
|
||||
echo Activating ReadOnly record support for test.tdb ...
|
||||
# activate readonly support
|
||||
try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setdbreadonly test.tdb
|
||||
try_command_on_node all $CTDB_TEST_WRAPPER ctdb setdbreadonly test.tdb
|
||||
numreadonly=`try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep READONLY | wc -l`
|
||||
[ "$numreadonly" != "1" ] && {
|
||||
echo BAD: could not activate readonly support for the test database
|
||||
@ -97,7 +97,7 @@ numreadonly=`try_command_on_node -v 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep RE
|
||||
|
||||
echo Create some readonly delegations ...
|
||||
# fetch record to node 0 and make it dmaster
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
|
||||
# fetch readonly to node 1
|
||||
try_command_on_node -v 0 $CTDB_TEST_WRAPPER "ctdb_fetch_readonly_once </dev/null"
|
||||
@ -117,7 +117,7 @@ numreadonly=`try_command_on_node -v all $CTDB_TEST_WRAPPER ctdb cattdb test.tdb
|
||||
|
||||
echo verify that a fetchlock will revoke the delegations ...
|
||||
# fetch record to node 0 and make it dmaster
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
|
||||
numreadonly=`try_command_on_node -v all $CTDB_TEST_WRAPPER ctdb cattdb test.tdb | grep RO_HAVE | wc -l`
|
||||
[ "$numreadonly" != "0" ] && {
|
||||
@ -132,7 +132,7 @@ numreadonly=`try_command_on_node -v all $CTDB_TEST_WRAPPER ctdb cattdb test.tdb
|
||||
|
||||
echo Create some readonly delegations ...
|
||||
# fetch record to node 0 and make it dmaster
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb_update_record
|
||||
|
||||
# fetch readonly to node 1
|
||||
try_command_on_node -v 0 $CTDB_TEST_WRAPPER "ctdb_fetch_readonly_once </dev/null"
|
||||
@ -151,7 +151,7 @@ numreadonly=`try_command_on_node -v all $CTDB_TEST_WRAPPER ctdb cattdb test.tdb
|
||||
#
|
||||
|
||||
echo verify that a recovery will revoke the delegations ...
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
numreadonly=`try_command_on_node -v all $CTDB_TEST_WRAPPER ctdb cattdb test.tdb | grep RO_HAVE | wc -l`
|
||||
[ "$numreadonly" != "0" ] && {
|
||||
|
@ -41,34 +41,34 @@ do_test()
|
||||
{
|
||||
# Wipe Test database
|
||||
echo "wipe test database"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb $TESTDB
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb $TESTDB
|
||||
|
||||
# Add a record key=test1 data=value1
|
||||
# and update values
|
||||
for value in value1 value2 value3 value4 value5 ; do
|
||||
echo "store key(test1) data($value)"
|
||||
try_command_on_node -q 0 "(echo -ne $value > /tmp/test_data)"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb pstore $TESTDB test1 /tmp/test_data
|
||||
try_command_on_node 0 "(echo -ne $value > /tmp/test_data)"
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb pstore $TESTDB test1 /tmp/test_data
|
||||
done
|
||||
|
||||
# Delete record
|
||||
echo "delete key(test1)"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb pdelete $TESTDB test1
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb pdelete $TESTDB test1
|
||||
|
||||
# Stop a node
|
||||
echo "stop node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb stop
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb stop
|
||||
|
||||
wait_until_node_has_status 1 stopped
|
||||
|
||||
# Add a record key=test1 data=value2
|
||||
echo "store key(test1) data(newvalue1)"
|
||||
try_command_on_node -q 0 "(echo -ne newvalue1 > /tmp/test_data)"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb pstore $TESTDB test1 /tmp/test_data
|
||||
try_command_on_node 0 "(echo -ne newvalue1 > /tmp/test_data)"
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb pstore $TESTDB test1 /tmp/test_data
|
||||
|
||||
# Continue node
|
||||
echo "contine node 1"
|
||||
try_command_on_node -q 1 $CTDB_TEST_WRAPPER ctdb continue
|
||||
try_command_on_node 1 $CTDB_TEST_WRAPPER ctdb continue
|
||||
|
||||
wait_until_node_has_status 1 notstopped
|
||||
|
||||
@ -83,10 +83,10 @@ status=0
|
||||
|
||||
# Create a temporary persistent database to test with
|
||||
echo "create persistent test database $TESTDB"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb attach $TESTDB persistent
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb attach $TESTDB persistent
|
||||
|
||||
echo "set RecoverPDBBySeqNum to 0"
|
||||
try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0
|
||||
try_command_on_node all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 0
|
||||
|
||||
do_test
|
||||
if try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb pfetch $TESTDB test1 ; then
|
||||
@ -98,7 +98,7 @@ fi
|
||||
|
||||
# Set RecoverPDBBySeqNum = 1
|
||||
echo "set RecoverPDBBySeqNum to 1"
|
||||
try_command_on_node -q all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 1
|
||||
try_command_on_node all $CTDB_TEST_WRAPPER ctdb setvar RecoverPDBBySeqNum 1
|
||||
|
||||
do_test
|
||||
if try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb pfetch $TESTDB test1 ; then
|
||||
|
@ -53,7 +53,7 @@ status=0
|
||||
|
||||
# Make sure node 0 is not the recovery master
|
||||
echo "find out which node is recmaster"
|
||||
try_command_on_node -q any $CTDB_TEST_WRAPPER ctdb recmaster
|
||||
try_command_on_node any $CTDB_TEST_WRAPPER ctdb recmaster
|
||||
recmaster="$out"
|
||||
if [ "$recmaster" = "0" ]; then
|
||||
echo "node 0 is recmaster, disable recmasterrole on node 0"
|
||||
@ -65,13 +65,13 @@ if [ "$recmaster" = "0" ]; then
|
||||
# test, so for now use "ctdb stop" and "ctdb continue".
|
||||
#
|
||||
echo "stop node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb stop
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb stop
|
||||
wait_until_node_has_status 0 stopped
|
||||
echo "continue node 0"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb continue
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb continue
|
||||
wait_until_node_has_status 0 notstopped
|
||||
|
||||
try_command_on_node -q any $CTDB_TEST_WRAPPER ctdb recmaster
|
||||
try_command_on_node any $CTDB_TEST_WRAPPER ctdb recmaster
|
||||
recmaster="$out"
|
||||
if [ "$recmaster" = "0" ]; then
|
||||
echo "failed to move recmaster to different node"
|
||||
@ -83,39 +83,39 @@ echo "Recmaster:$recmaster"
|
||||
|
||||
# Create a temporary non-persistent database to test with
|
||||
echo "create test database $TESTDB"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb attach $TESTDB
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb attach $TESTDB
|
||||
|
||||
# Wipe Test database
|
||||
echo "wipe test database"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb wipedb $TESTDB
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb wipedb $TESTDB
|
||||
|
||||
# Add a record key=test1 data=value1
|
||||
echo "store key(test1) data(value1)"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb writekey $TESTDB test1 value1
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb writekey $TESTDB test1 value1
|
||||
|
||||
# Fetch a record key=test1
|
||||
echo "read key(test1)"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb readkey $TESTDB test1
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb readkey $TESTDB test1
|
||||
echo "$out"
|
||||
|
||||
# Do a recovery
|
||||
echo "force recovery"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
wait_until_node_has_status $recmaster recovered
|
||||
|
||||
# Add a record key=test1 data=value2
|
||||
echo "store key(test1) data(value2)"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb writekey $TESTDB test1 value2
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb writekey $TESTDB test1 value2
|
||||
|
||||
# Fetch a record key=test1
|
||||
echo "read key(test1)"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb readkey $TESTDB test1
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb readkey $TESTDB test1
|
||||
echo "$out"
|
||||
|
||||
# Do a recovery
|
||||
echo "force recovery"
|
||||
try_command_on_node -q $recmaster $CTDB_TEST_WRAPPER ctdb recover
|
||||
try_command_on_node $recmaster $CTDB_TEST_WRAPPER ctdb recover
|
||||
|
||||
wait_until_node_has_status $recmaster recovered
|
||||
|
||||
|
@ -41,10 +41,10 @@ num_records=1000
|
||||
TESTDB="traverse_test.tdb"
|
||||
|
||||
echo "create test database $TESTDB"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb attach $TESTDB
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb attach $TESTDB
|
||||
|
||||
echo "wipe test database $TESTDB"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb $TESTDB
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb wipedb $TESTDB
|
||||
|
||||
echo "Add $num_records records to database"
|
||||
i=0
|
||||
@ -53,13 +53,13 @@ while [ $i -lt $num_records ]; do
|
||||
value="value-$i"
|
||||
|
||||
n=$[ $i % $num_nodes ]
|
||||
try_command_on_node -q $n $CTDB_TEST_WRAPPER ctdb writekey $TESTDB $key $value
|
||||
try_command_on_node $n $CTDB_TEST_WRAPPER ctdb writekey $TESTDB $key $value
|
||||
|
||||
i=$[ $i + 1 ]
|
||||
done
|
||||
|
||||
echo "Start a traverse and collect records"
|
||||
try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb catdb $TESTDB
|
||||
try_command_on_node 0 $CTDB_TEST_WRAPPER ctdb catdb $TESTDB
|
||||
|
||||
num_read=$(echo "$out" | tail -n 1 | cut -d\ -f2)
|
||||
if [ $num_read -eq $num_records ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user