diff options
author | Martin Schwenke <martin@meltin.net> | 2012-04-23 14:40:28 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-04-27 15:40:43 +1000 |
commit | edaead3cd5e0beacf05a6b60ec3de43c92fe8c68 (patch) | |
tree | a86f4da3dbdde0e9f7f91aa0e42e554c259f1e40 | |
parent | 6757ad62f4cda14066789989fb002cee7c009cde (diff) | |
download | samba-edaead3cd5e0beacf05a6b60ec3de43c92fe8c68.tar.gz samba-edaead3cd5e0beacf05a6b60ec3de43c92fe8c68.tar.xz samba-edaead3cd5e0beacf05a6b60ec3de43c92fe8c68.zip |
tests/simple: Replace "tdbdump" with "ctdb cattdb"
tdbdump may not be installed and would be an unnecessary dependency.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit fbabc05569d91bf033f474d89f51b49490943332)
-rwxr-xr-x | ctdb/tests/simple/72_update_record_persistent.sh | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/ctdb/tests/simple/72_update_record_persistent.sh b/ctdb/tests/simple/72_update_record_persistent.sh index 5039492537..254ce195c5 100755 --- a/ctdb/tests/simple/72_update_record_persistent.sh +++ b/ctdb/tests/simple/72_update_record_persistent.sh @@ -37,53 +37,53 @@ cluster_is_healthy try_command_on_node 0 "$CTDB listnodes" num_nodes=$(echo "$out" | wc -l) +TDB=persistent_test.tdb + # 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 +echo create persistent test database $TDB +try_command_on_node -q 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 persistent_test.tdb +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb $TDB echo force a recovery try_command_on_node -q 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) +num_records=$(try_command_on_node -v -pq 1 $CTDB_TEST_WRAPPER ctdb cattdb $TDB | grep key | wc -l) [ $num_records != "0" ] && { echo "BAD: we did not end up with an empty database" exit 1 } echo "OK. database was wiped" -TDB=`try_command_on_node -v -q 0 $CTDB_TEST_WRAPPER ctdb getdbmap | grep persistent_test.tdb | sed -e "s/.*path://" -e "s/ .*//"` - # 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=persistent_test.tdb --record=Update_Record_Persistent --value=FirstValue +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb_update_record_persistent --database=$TDB --record=Update_Record_Persistent --value=FirstValue -num_records=`tdbdump $TDB | grep "FirstValue" | wc -l` -[ $num_records != 1 ] && { +try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'FirstValue' | wc -l" +[ $out != 1 ] && { echo "BAD: we did find the record after the create/update" exit 1 } # 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=persistent_test.tdb --record=Update_Record_Persistent --value=SecondValue +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb_update_record_persistent --database=$TDB --record=Update_Record_Persistent --value=SecondValue -num_records=`tdbdump $TDB | grep "FirstValue" | wc -l` -[ $num_records != 0 ] && { +try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'FirstValue' | wc -l" +[ $out != 0 ] && { echo "BAD: we still found the old record after the modify/update" exit 1 } -num_records=`tdbdump $TDB | grep "SecondValue" | wc -l` -[ $num_records != 1 ] && { +try_command_on_node -q 0 "ctdb cattdb $TDB | grep 'SecondValue' | wc -l" +[ $out != 1 ] && { echo "BAD: could not find the record after the modify/update" exit 1 } echo wipe the persistent test databases and clean up -try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb persistent_test.tdb +try_command_on_node -q 0 $CTDB_TEST_WRAPPER ctdb wipedb $TDB |