s3:net: introduce a talloc stackframe for net idmap delete
[Samba/gbeck.git] / testprogs / blackbox / upgradeprovision-alpha13.sh
blob1747c7b4e966df0efc4aa77283df4968cd65cf2b
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: dbcheck.sh PREFIX
6 EOF
7 exit 1;
8 fi
10 PREFIX_ABS="$1"
11 shift 1
13 . `dirname $0`/subunit.sh
15 alpha13_dir=`dirname $0`/../../source4/selftest/provisions/alpha13
17 alpha13() {
18 if test -x $BINDIR/tdbrestore;
19 then
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
22 else
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
41 remove_dns_user() {
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
46 reindex() {
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
51 dbcheck() {
52 $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/alpha13_upgrade/private/sam.ldb $@
55 dbcheck_clean() {
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
60 dbcheck_full() {
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 $@
68 upgradeprovision() {
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
94 else
95 subunit_start_test "alpha13"
96 subunit_skip_test "alpha13" <<EOF
97 no test provision
98 EOF
100 subunit_start_test "remove_dns_user"
101 subunit_skip_test "remove_dns_user" <<EOF
102 no test provision
105 subunit_start_test "upgradeprovision"
106 subunit_skip_test "upgradeprovision" <<EOF
107 no test provision
109 subunit_start_test "upgradeprovision_full"
110 subunit_skip_test "upgradeprovision_full" <<EOF
111 no test provision
113 subunit_start_test "reindex"
114 subunit_skip_test "reindex" <<EOF
115 no test provision
117 subunit_start_test "dbcheck"
118 subunit_skip_test "dbcheck" <<EOF
119 no test provision
121 subunit_start_test "dbcheck_clean"
122 subunit_skip_test "dbcheck_clean" <<EOF
123 no test provision
125 subunit_start_test "dbcheck_full"
126 subunit_skip_test "dbcheck_full" <<EOF
127 no test provision
129 subunit_start_test "dbcheck_full_clean"
130 subunit_skip_test "dbcheck_full_clean" <<EOF
131 no test provision
135 exit $failed