2 # Blackbox test for tdbbackup of given ldb or tdb database
3 # Copyright (C) 2018 Andrew Bartlett <abartlet@samba.org>
6 echo "Usage: $0 LDBFILE"
15 date -u +'time: %Y-%m-%d %H:%M:%S.%6NZ' |
sed 's/\..*NZ$/.000000Z/'
21 printf 'failure: %s [\n' "$1"
32 printf 'test: %s\n' "$1"
33 output
=$
($cmdline 2>&1)
35 if [ x
$status = x0
]; then
37 printf 'success: %s\n' "$name"
39 echo "$output" | subunit_fail_test
"$name"
44 $BINDIR/tdbdump
$LDBFILE |
sort >orig_dump
46 testit
"normal tdbbackup on tdb file" $BINDIR/tdbbackup
$LDBFILE -s .bak \
47 || failed
=$
((failed
+ 1))
48 $BINDIR/tdbdump
$LDBFILE.bak |
sort >bak_dump
49 testit
"cmp between tdbdumps of original and backup" cmp orig_dump bak_dump \
50 || failed
=$
((failed
+ 1))
54 testit
"readonly tdbbackup on tdb file" $BINDIR/tdbbackup
$LDBFILE -s .bak
-r \
55 || failed
=$
((failed
+ 1))
56 $BINDIR/tdbdump
$LDBFILE.bak |
sort >bak_dump
57 testit
"cmp between tdbdumps of original and back dbs" cmp orig_dump bak_dump \
58 || failed
=$
((failed
+ 1))