5 Usage: dbcheck.sh PREFIX
13 .
`dirname $0`/subunit.sh
15 alpha13_dir
=`dirname $0`/..
/..
/source4/selftest
/provisions
/alpha13
18 if test -x $BINDIR/tdbrestore
;
20 `dirname $0`/..
/..
/source4/selftest
/provisions
/undump.sh
$alpha13_dir $PREFIX_ABS/alpha13_upgrade
$BINDIR/tdbrestore
21 `dirname $0`/..
/..
/source4/selftest
/provisions
/undump.sh
$alpha13_dir $PREFIX_ABS/alpha13_upgrade_full
$BINDIR/tdbrestore
23 `dirname $0`/..
/..
/source4/selftest
/provisions
/undump.sh
$alpha13_dir $PREFIX_ABS/alpha13_upgrade
24 `dirname $0`/..
/..
/source4/selftest
/provisions
/undump.sh
$alpha13_dir $PREFIX_ABS/alpha13_upgrade_full
26 cp -a $alpha13_dir/private
/*.keytab
$PREFIX_ABS/alpha13_upgrade
/private
/
27 cp -a $alpha13_dir/sysvol
$PREFIX_ABS/alpha13_upgrade
/
28 mkdir
$PREFIX_ABS/alpha13_upgrade
/etc
/
29 cat $alpha13_dir/etc
/smb.conf.template | \
30 sed "s|@@PREFIX@@|$PREFIX_ABS/alpha13_upgrade|g" \
31 > $PREFIX_ABS/alpha13_upgrade
/etc
/smb.conf
33 cp -a $alpha13_dir/private
/*.keytab
$PREFIX_ABS/alpha13_upgrade_full
/private
/
34 cp -a $alpha13_dir/sysvol
$PREFIX_ABS/alpha13_upgrade_full
/
35 mkdir
$PREFIX_ABS/alpha13_upgrade_full
/etc
/
36 cat $alpha13_dir/etc
/smb.conf.template | \
37 sed "s|@@PREFIX@@|$PREFIX_ABS/alpha13_upgrade_full|g" \
38 > $PREFIX_ABS/alpha13_upgrade_full
/etc
/smb.conf
42 # This is done, because otherwise the upgrdeprovision will not run without --full
43 $BINDIR/ldbdel
-H tdb
://$PREFIX_ABS/alpha13_upgrade
/private
/sam.ldb cn
=dns
,cn
=users
,dc=alpha13
,dc=samba
,dc=corp
47 $BINDIR/samba-tool dbcheck
--reindex -H tdb
://$PREFIX_ABS/alpha13_upgrade
/private
/sam.ldb $@
50 # This should 'fail', because it returns the number of modified records
52 $BINDIR/samba-tool dbcheck
--cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/alpha13_upgrade
/private
/sam.ldb $@
56 $BINDIR/samba-tool dbcheck
--cross-ncs -H tdb
://$PREFIX_ABS/alpha13_upgrade
/private
/sam.ldb $@
59 # This should 'fail', because it returns the number of modified records
61 $BINDIR/samba-tool dbcheck
--cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/alpha13_upgrade_full
/private
/sam.ldb $@
64 dbcheck_full_clean
() {
65 $BINDIR/samba-tool dbcheck
--cross-ncs -H tdb
://$PREFIX_ABS/alpha13_upgrade_full
/private
/sam.ldb $@
69 $PYTHON $BINDIR/samba_upgradeprovision
-s "$PREFIX_ABS/alpha13_upgrade/etc/smb.conf" --debugchange
72 upgradeprovision_full
() {
73 $PYTHON $BINDIR/samba_upgradeprovision
-s "$PREFIX_ABS/alpha13_upgrade_full/etc/smb.conf" --full --debugchange
76 if [ -d $PREFIX_ABS/alpha13_upgrade
]; then
77 rm -fr $PREFIX_ABS/alpha13_upgrade
80 if [ -d $PREFIX_ABS/alpha13_upgrade_full
]; then
81 rm -fr $PREFIX_ABS/alpha13_upgrade_full
84 if [ -d $alpha13_dir ]; then
85 testit
"alpha13" alpha13
86 testit
"remove_dns_user" remove_dns_user
87 testit
"upgradeprovision" upgradeprovision
88 testit
"upgradeprovision_full" upgradeprovision_full
89 testit
"reindex" reindex
90 testit_expect_failure
"dbcheck" dbcheck
91 testit
"dbcheck_clean" dbcheck_clean
92 testit_expect_failure
"dbcheck_full" dbcheck_full
93 testit
"dbcheck_full_clean" dbcheck_full_clean
95 subunit_start_test
"alpha13"
96 subunit_skip_test
"alpha13" <<EOF
100 subunit_start_test
"remove_dns_user"
101 subunit_skip_test
"remove_dns_user" <<EOF
105 subunit_start_test
"upgradeprovision"
106 subunit_skip_test
"upgradeprovision" <<EOF
109 subunit_start_test
"upgradeprovision_full"
110 subunit_skip_test
"upgradeprovision_full" <<EOF
113 subunit_start_test
"reindex"
114 subunit_skip_test
"reindex" <<EOF
117 subunit_start_test
"dbcheck"
118 subunit_skip_test
"dbcheck" <<EOF
121 subunit_start_test
"dbcheck_clean"
122 subunit_skip_test
"dbcheck_clean" <<EOF
125 subunit_start_test
"dbcheck_full"
126 subunit_skip_test
"dbcheck_full" <<EOF
129 subunit_start_test
"dbcheck_full_clean"
130 subunit_skip_test
"dbcheck_full_clean" <<EOF