5 Usage: dbcheck.sh PREFIX RELEASE
14 .
`dirname $0`/subunit.sh
16 release_dir
=`dirname $0`/..
/..
/source4/selftest
/provisions
/$RELEASE
19 if test -x $BINDIR/tdbrestore
;
21 `dirname $0`/..
/..
/source4/selftest
/provisions
/undump.sh
$release_dir $PREFIX_ABS/$RELEASE $BINDIR/tdbrestore
23 `dirname $0`/..
/..
/source4/selftest
/provisions
/undump.sh
$release_dir $PREFIX_ABS/$RELEASE
28 $PYTHON $BINDIR/samba-tool dbcheck
--reindex -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
31 # This should 'fail', because it returns the number of modified records
33 $PYTHON $BINDIR/samba-tool dbcheck
--cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
35 # But having fixed it all up, this should pass
37 $PYTHON $BINDIR/samba-tool dbcheck
--cross-ncs -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
40 # This should 'fail', because it returns the number of modified records
42 $PYTHON $BINDIR/samba-tool dbcheck
--reset-well-known-acls --cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
44 # But having fixed it all up, this should pass
45 dbcheck_acl_reset_clean
() {
46 $PYTHON $BINDIR/samba-tool dbcheck
--reset-well-known-acls --cross-ncs -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
49 referenceprovision
() {
50 $PYTHON $BINDIR/samba-tool domain provision
--server-role="dc" --domain=SAMBA
--host-name=ares
--realm=${RELEASE}.samba.corp
--targetdir=$PREFIX_ABS/${RELEASE}_reference
--use-ntvfs --host-ip=127.0.0.1 --host-ip6=::1
54 if [ x
$RELEASE != x
"alpha13" ]; then
55 $PYTHON $BINDIR/samba-tool ldapcmp tdb
://$PREFIX_ABS/${RELEASE}_reference
/private
/sam.ldb tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
--two --skip-missing-dn --filter=dnsRecord
60 if [ x
$RELEASE != x
"alpha13" ]; then
61 $PYTHON $BINDIR/samba-tool ldapcmp tdb
://$PREFIX_ABS/${RELEASE}_reference
/private
/sam.ldb tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
--two --sd --skip-missing-dn
65 if [ -d $release_dir ]; then
66 testit
$RELEASE undump
67 testit
"reindex" reindex
68 testit_expect_failure
"dbcheck" dbcheck
69 testit
"dbcheck_clean" dbcheck_clean
70 testit_expect_failure
"dbcheck_acl_reset" dbcheck_acl_reset
71 testit
"dbcheck_acl_reset_clean" dbcheck_acl_reset_clean
72 testit
"referenceprovision" referenceprovision
73 testit
"ldapcmp" ldapcmp
74 testit
"ldapcmp_sd" ldapcmp_sd
76 subunit_start_test
$RELEASE
77 subunit_skip_test
$RELEASE <<EOF
81 subunit_start_test
"reindex"
82 subunit_skip_test
"reindex" <<EOF
85 subunit_start_test
"dbcheck"
86 subunit_skip_test
"dbcheck" <<EOF
89 subunit_start_test
"dbcheck_clean"
90 subunit_skip_test
"dbcheck_clean" <<EOF
93 subunit_start_test
"dbcheck_acl_reset"
94 subunit_skip_test
"dbcheck_acl_reset" <<EOF
97 subunit_start_test
"dbcheck_clean_acl_reset"
98 subunit_skip_test
"dbcheck_clean_acl_reset" <<EOF
101 subunit_start_test
"referenceprovision"
102 subunit_skip_test
"referenceprovision" <<EOF
105 subunit_start_test
"ldapcmp"
106 subunit_skip_test
"ldapcmp" <<EOF
109 subunit_start_test
"ldapcmp_sd"
110 subunit_skip_test
"ldapcmp_sd" <<EOF
115 if [ -d $PREFIX_ABS/${RELEASE} ]; then
116 rm -fr $PREFIX_ABS/${RELEASE}
119 if [ -d $PREFIX_ABS/${RELEASE}_reference
]; then
120 rm -fr $PREFIX_ABS/${RELEASE}_reference