]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Use db_ctdb_cattdb_count_records()
authorMartin Schwenke <martin@meltin.net>
Fri, 2 Aug 2019 06:18:32 +0000 (16:18 +1000)
committerAmitay Isaacs <amitay@samba.org>
Tue, 17 Sep 2019 04:35:26 +0000 (04:35 +0000)
Avoid reinventing the wheel.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/simple/69_recovery_resurrect_deleted.sh

index e5615cddb86a38d4961906fe07992b9843eb2bd2..51d806a5d47236cdfa22bcf638761d031ec953c0 100755 (executable)
@@ -45,8 +45,9 @@ database_has_zero_records ()
 {
        local n
        for n in $notfirst ; do
-               try_command_on_node $n $CTDB cattdb "$testdb"
-               if grep -q '^key(' "$outfile" ; then
+               local num_records
+               num_records=$(db_ctdb_cattdb_count_records "$n" "$testdb")
+               if [ "$num_records" != 0 ] ; then
                        return 1
                fi
        done