test_chgdpass: use drs bind to test password change on RPC
[samba.git] / testprogs / blackbox / dbcheck-alpha13.sh
1 #!/bin/sh
2
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: dbcheck.sh PREFIX
6 EOF
7 exit 1;
8 fi
9
10 PREFIX_ABS="$1"
11 shift 1
12
13 . `dirname $0`/subunit.sh
14
15 alpha13_dir=`dirname $0`/../../source4/selftest/provisions/alpha13
16
17 alpha13() {
18        if test -x $BINDIR/tdbrestore;
19        then
20         `dirname $0`/../../source4/selftest/provisions/undump.sh $alpha13_dir $PREFIX_ABS/alpha13 $BINDIR/tdbrestore
21        else 
22         `dirname $0`/../../source4/selftest/provisions/undump.sh $alpha13_dir $PREFIX_ABS/alpha13
23        fi
24 }
25
26 reindex() {
27        $BINDIR/samba-tool dbcheck --reindex -H tdb://$PREFIX_ABS/alpha13/private/sam.ldb $@
28 }
29
30 # This should 'fail', because it returns the number of modified records
31 dbcheck() {
32        $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/alpha13/private/sam.ldb $@
33 }
34 # But having fixed it all up, this should pass
35 dbcheck_clean() {
36        $BINDIR/samba-tool dbcheck --cross-ncs -H tdb://$PREFIX_ABS/alpha13/private/sam.ldb $@
37 }
38
39 if [ -d $alpha13_dir ]; then
40     testit "alpha13" alpha13
41     testit "reindex" reindex
42     testit_expect_failure "dbcheck" dbcheck
43     testit "dbcheck_clean" dbcheck_clean
44 else
45     subunit_start_test "alpha13"
46     subunit_skip_test "alpha13" <<EOF 
47 no test provision 
48 EOF
49
50     subunit_start_test "reindex"
51     subunit_skip_test "reindex" <<EOF 
52 no test provision 
53 EOF
54     subunit_start_test "dbcheck"
55     subunit_skip_test "dbcheck" <<EOF 
56 no test provision 
57 EOF
58     subunit_start_test "dbcheck_clean"
59     subunit_skip_test "dbcheck_clean" <<EOF 
60 no test provision 
61 EOF
62 fi
63
64 exit $failed