]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tdb: Return failure as exit status from test_tdbbackup.sh
authorChristof Schmitt <cs@samba.org>
Fri, 12 Apr 2024 22:22:06 +0000 (15:22 -0700)
committerChristof Schmitt <cs@samba.org>
Tue, 16 Apr 2024 17:32:34 +0000 (17:32 +0000)
When this test is called from wscript, only the exit code is checked.
Track failures and return as non-zero exit code.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/tdb/test/test_tdbbackup.sh

index 8552ea1029b1abac7cb1ea3023b15595812de0f2..7bc025ca42b0ada35d62069aa42712226d03e290 100755 (executable)
@@ -8,6 +8,7 @@ if [ $# -lt 1 ]; then
 fi
 
 LDBFILE=$1
+failed=0
 
 timestamp()
 {
@@ -42,16 +43,22 @@ testit()
 
 $BINDIR/tdbdump $LDBFILE | sort >orig_dump
 
-testit "normal tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak
+testit "normal tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak  \
+       || failed=$((failed + 1))
 $BINDIR/tdbdump $LDBFILE.bak | sort >bak_dump
-testit "cmp between tdbdumps of original and backup" cmp orig_dump bak_dump
+testit "cmp between tdbdumps of original and backup" cmp orig_dump bak_dump \
+       || failed=$((failed + 1))
 rm $LDBFILE.bak
 rm bak_dump
 
-testit "readonly tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak -r
+testit "readonly tdbbackup on tdb file" $BINDIR/tdbbackup $LDBFILE -s .bak -r \
+       || failed=$((failed + 1))
 $BINDIR/tdbdump $LDBFILE.bak | sort >bak_dump
-testit "cmp between tdbdumps of original and back dbs" cmp orig_dump bak_dump
+testit "cmp between tdbdumps of original and back dbs" cmp orig_dump bak_dump \
+       || failed=$((failed + 1))
 rm $LDBFILE.bak
 rm bak_dump
 
 rm orig_dump
+
+exit $failed