winbindd: as DC we should try to get the target_domain from @SOMETHING part of the...
[Samba.git] / testprogs / blackbox / dbcheck-oldrelease.sh
blobecab0030d68a7abead3ec28a18b9834afdb6035e
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: dbcheck.sh PREFIX RELEASE
6 EOF
7 exit 1;
8 fi
10 PREFIX_ABS="$1"
11 RELEASE="$2"
12 shift 2
14 . `dirname $0`/subunit.sh
16 release_dir=`dirname $0`/../../source4/selftest/provisions/$RELEASE
18 ldbmodify="ldbmodify"
19 if [ -x "$BINDIR/ldbmodify" ]; then
20 ldbmodify="$BINDIR/ldbmodify"
23 ldbdel="ldbdel"
24 if [ -x "$BINDIR/ldbdel" ]; then
25 ldbdel="$BINDIR/ldbdel"
28 ldbsearch="ldbsearch"
29 if [ -x "$BINDIR/ldbsearch" ]; then
30 ldbsearch="$BINDIR/ldbsearch"
33 undump() {
34 if test -x $BINDIR/tdbrestore;
35 then
36 `dirname $0`/../../source4/selftest/provisions/undump.sh $release_dir $PREFIX_ABS/$RELEASE $BINDIR/tdbrestore
37 else
38 `dirname $0`/../../source4/selftest/provisions/undump.sh $release_dir $PREFIX_ABS/$RELEASE
42 add_userparameters0() {
43 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
44 $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb <<EOF
45 dn: cn=localdc,cn=domain controllers,dc=release-4-1-0rc3,dc=samba,dc=corp
46 changetype: modify
47 replace: userParameters
48 userParameters:: IAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAC
49 AAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUAAQABoACAAB
50 AEMAdAB4AEMAZgBnAFAAcgBlAHMAZQBuAHQANTUxZTBiYjAYAAgAAQBDAHQAeABDAGYAZw
51 BGAGwAYQBnAHMAMQAwMGUwMDAxMBYACAABAEMAdAB4AEMAYQBsAGwAYgBhAGMAawAwMDAw
52 MDAwMBIACAABAEMAdAB4AFMAaABhAGQAbwB3ADAxMDAwMDAwKAAIAAEAQwB0AHgATQBhAH
53 gAQwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwLgAIAAEAQwB0AHgATQBh
54 AHgARABpAHMAYwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwHAAIAAEAQw
55 B0AHgATQBhAHgASQBkAGwAZQBUAGkAbQBlADAwMDAwMDAwIgAIAAEAQwB0AHgASwBlAHkA
56 YgBvAGEAcgBkAEwAYQB5AG8AdQB0ADAwMDAwMDAwKgACAAEAQwB0AHgATQBpAG4ARQBuAG
57 MAcgB5AHAAdABpAG8AbgBMAGUAdgBlAGwAMDAgAAIAAQBDAHQAeABXAG8AcgBrAEQAaQBy
58 AGUAYwB0AG8AcgB5ADAwIAACAAEAQwB0AHgATgBXAEwAbwBnAG8AbgBTAGUAcgB2AGUAcg
59 AwMBgAJAABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByADVjNWM3MzYxNzQ3NTcyNmU2NTVj
60 NzAyZTYyNjk2NDZmNmUwMCIABgABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByAEQAcgBpAH
61 YAZQA1MDNhMDAgADoAAQBDAHQAeABXAEYAUAByAG8AZgBpAGwAZQBQAGEAdABoADVjNWM3
62 MzYxNzQ3NTcyNmU2NTVjNzA3MjZmNjY2OTZjNjU3NDczNjU1YzcwMmU2MjY5NjQ2ZjZlMD
63 AiAAIAAQBDAHQAeABJAG4AaQB0AGkAYQBsAFAAcgBvAGcAcgBhAG0AMDAiAAIAAQBDAHQA
64 eABDAGEAbABsAGIAYQBjAGsATgB1AG0AYgBlAHIAMDA=
66 EOF
69 add_userparameters1() {
70 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
71 $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb <<EOF
72 dn: cn=administrator,cn=users,dc=release-4-1-0rc3,dc=samba,dc=corp
73 changetype: modify
74 replace: userParameters
75 userParameters: IAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAC
76 AAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUAAQABoACAAB
77 AEMAdAB4AEMAZgBnAFAAcgBlAHMAZQBuAHQANTUxZTBiYjAYAAgAAQBDAHQAeABDAGYAZw
78 BGAGwAYQBnAHMAMQAwMGUwMDAxMBYACAABAEMAdAB4AEMAYQBsAGwAYgBhAGMAawAwMDAw
79 MDAwMBIACAABAEMAdAB4AFMAaABhAGQAbwB3ADAxMDAwMDAwKAAIAAEAQwB0AHgATQBhAH
80 gAQwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwLgAIAAEAQwB0AHgATQBh
81 AHgARABpAHMAYwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwHAAIAAEAQw
82 B0AHgATQBhAHgASQBkAGwAZQBUAGkAbQBlADAwMDAwMDAwIgAIAAEAQwB0AHgASwBlAHkA
83 YgBvAGEAcgBkAEwAYQB5AG8AdQB0ADAwMDAwMDAwKgACAAEAQwB0AHgATQBpAG4ARQBuAG
84 MAcgB5AHAAdABpAG8AbgBMAGUAdgBlAGwAMDAgAAIAAQBDAHQAeABXAG8AcgBrAEQAaQBy
85 AGUAYwB0AG8AcgB5ADAwIAACAAEAQwB0AHgATgBXAEwAbwBnAG8AbgBTAGUAcgB2AGUAcg
86 AwMBgAJAABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByADVjNWM3MzYxNzQ3NTcyNmU2NTVj
87 NzAyZTYyNjk2NDZmNmUwMCIABgABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByAEQAcgBpAH
88 YAZQA1MDNhMDAgADoAAQBDAHQAeABXAEYAUAByAG8AZgBpAGwAZQBQAGEAdABoADVjNWM3
89 MzYxNzQ3NTcyNmU2NTVjNzA3MjZmNjY2OTZjNjU3NDczNjU1YzcwMmU2MjY5NjQ2ZjZlMD
90 AiAAIAAQBDAHQAeABJAG4AaQB0AGkAYQBsAFAAcgBvAGcAcgBhAG0AMDAiAAIAAQBDAHQA
91 eABDAGEAbABsAGIAYQBjAGsATgB1AG0AYgBlAHIAMDA=
93 EOF
96 add_userparameters2() {
97 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
98 $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb <<EOF
99 dn: cn=krbtgt,cn=users,dc=release-4-1-0rc3,dc=samba,dc=corp
100 changetype: modify
101 replace: userParameters
102 userParameters:: Q3R4Q2ZnUHJlc2VudCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI
103 CAgUAsaCAFDdHhDZmdQcmVzZW5045S15pSx5oiw44GiIAIBQ3R4V0ZQcm9maWxlUGF0aOOAsBgCAU
104 N0eFdGSG9tZURpcuOAsCICAUN0eFdGSG9tZURpckRyaXZl44CwEggBQ3R4U2hhZG9344Sw44Cw44C
105 w44CwLggBQ3R4TWF4RGlzY29ubmVjdGlvblRpbWXjgaXjjLnjkLDjgLAoCAFDdHhNYXhDb25uZWN0
106 aW9uVGltZeOAtOOct+aIseOAsBwIAUN0eE1heElkbGVUaW1l44Gj45yy46Sw44CwIAIBQ3R4V29ya
107 0RpcmVjdG9yeeOAsBgIAUN0eENmZ0ZsYWdzMeOAsOOBpuOYsuOAuCICAUN0eEluaXRpYWxQcm9ncm
108 Ft44Cw
114 add_userparameters3() {
115 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
116 $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb <<EOF
117 dn: cn=guest,cn=users,dc=release-4-1-0rc3,dc=samba,dc=corp
118 changetype: modify
119 replace: userParameters
120 userParameters:: QwAAAHQAAAB4AAAAQwAAAGYAAABnAAAAUAAAAHIAAABlAAAAcwAAAGUAAABuA
121 AAAdAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAA
122 AgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACA
123 AAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAUAAAAAsAAAAaAAAACAAAAAEAAABDAAAAdAAA
124 AHgAAABDAAAAZgAAAGcAAABQAAAAcgAAAGUAAABzAAAAZQAAAG4AAAB0AAAANQA1ADEAZQAwAGIAY
125 gAwACAAAAACAAAAAQAAAEMAAAB0AAAAeAAAAFcAAABGAAAAUAAAAHIAAABvAAAAZgAAAGkAAABsAA
126 AAZQAAAFAAAABhAAAAdAAAAGgAAAAwADAAGAAAAAIAAAABAAAAQwAAAHQAAAB4AAAAVwAAAEYAAAB
127 IAAAAbwAAAG0AAABlAAAARAAAAGkAAAByAAAAMAAwACIAAAACAAAAAQAAAEMAAAB0AAAAeAAAAFcA
128 AABGAAAASAAAAG8AAABtAAAAZQAAAEQAAABpAAAAcgAAAEQAAAByAAAAaQAAAHYAAABlAAAAMAAwA
129 BIAAAAIAAAAAQAAAEMAAAB0AAAAeAAAAFMAAABoAAAAYQAAAGQAAABvAAAAdwAAADAAMQAwADAAMA
130 AwADAAMAAuAAAACAAAAAEAAABDAAAAdAAAAHgAAABNAAAAYQAAAHgAAABEAAAAaQAAAHMAAABjAAA
131 AbwAAAG4AAABuAAAAZQAAAGMAAAB0AAAAaQAAAG8AAABuAAAAVAAAAGkAAABtAAAAZQAAAGUAMAA5
132 ADMAMAA0ADAAMAAoAAAACAAAAAEAAABDAAAAdAAAAHgAAABNAAAAYQAAAHgAAABDAAAAbwAAAG4AA
133 ABuAAAAZQAAAGMAAAB0AAAAaQAAAG8AAABuAAAAVAAAAGkAAABtAAAAZQAAADQAMAA3ADcAMQBiAD
134 AAMAAcAAAACAAAAAEAAABDAAAAdAAAAHgAAABNAAAAYQAAAHgAAABJAAAAZAAAAGwAAABlAAAAVAA
135 AAGkAAABtAAAAZQAAAGMAMAAyADcAMAA5ADAAMAAgAAAAAgAAAAEAAABDAAAAdAAAAHgAAABXAAAA
136 bwAAAHIAAABrAAAARAAAAGkAAAByAAAAZQAAAGMAAAB0AAAAbwAAAHIAAAB5AAAAMAAwABgAAAAIA
137 AAAAQAAAEMAAAB0AAAAeAAAAEMAAABmAAAAZwAAAEYAAABsAAAAYQAAAGcAAABzAAAAMQAAADAAMA
138 BmADAAMgA2ADgAMAAiAAAAAgAAAAEAAABDAAAAdAAAAHgAAABJAAAAbgAAAGkAAAB0AAAAaQAAAGE
139 AAABsAAAAUAAAAHIAAABvAAAAZwAAAHIAAABhAAAAbQAAADAAMAA=
145 reindex() {
146 $PYTHON $BINDIR/samba-tool dbcheck --reindex -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
149 do_current_version_mod() {
150 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
151 # Confirm (in combination with the ldbsearch below) that
152 # changing the attribute with current Samba fixes it, and that
153 # a fixed attriute isn't unfixed by dbcheck.
154 tmpldif=$release_dir/sudoers2-mod.ldif
155 $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $tmpldif
157 return 0
160 check_expected_before_values() {
161 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
162 tmpldif=$PREFIX_ABS/$RELEASE/expected-replpropertymetadata-before-dbcheck.ldif.tmp
163 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=ops_run_anything -s one -b OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --sorted --show-binary > $tmpldif
164 diff $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck.ldif
165 if [ "$?" != "0" ]; then
166 return 1
169 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=ops_run_anything2 -s one -b OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --sorted --show-binary | grep -v originating_change_time| grep -v whenChanged > $tmpldif
171 # Here we remove originating_change_time and whenChanged as
172 # these are time-dependent, caused by the ldbmodify above.
174 diff $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck2.ldif
175 if [ "$?" != "0" ]; then
176 return 1
179 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=ops_run_anything3 -s one -b OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --sorted --show-binary > $tmpldif
180 diff $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck3.ldif
181 if [ "$?" != "0" ]; then
182 return 1
184 elif [ x$RELEASE = x"release-4-5-0-pre1" ]; then
185 tmpldif=$PREFIX_ABS/$RELEASE/rootdse-version.initial.txt.tmp
186 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb -s base -b '' | grep highestCommittedUSN > $tmpldif
187 diff $tmpldif $release_dir/rootdse-version.initial.txt
188 if [ "$?" != "0" ]; then
189 return 1
192 return 0
195 # This should 'fail', because it returns the number of modified records
196 dbcheck_objectclass() {
197 if [ x$RELEASE = x"release-4-1-6-partial-object" ]; then
198 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb --attrs=objectclass $@
199 else
200 return 1
204 # This should 'fail', because it returns the number of modified records
205 dbcheck() {
206 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
209 check_expected_after_values() {
210 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
211 tmpldif=$PREFIX_ABS/$RELEASE/expected-replpropertymetadata-after-dbcheck.ldif.tmp
212 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=ops_run_anything -s one -b OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --sorted --show-binary > $tmpldif
213 diff $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck.ldif
214 if [ "$?" != "0" ]; then
215 return 1
217 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=ops_run_anything2 -s one -b OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --sorted --show-binary | grep -v originating_change_time| grep -v whenChanged > $tmpldif
218 diff $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck2.ldif
219 if [ "$?" != "0" ]; then
220 return 1
222 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=ops_run_anything3 -s one -b OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --sorted --show-binary > $tmpldif
223 diff $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck3.ldif
224 if [ "$?" != "0" ]; then
225 return 1
227 # Check DomainDNS partition for replica locations
228 tmpldif=$PREFIX_ABS/$RELEASE/expected-replica-locations-after-dbcheck.ldif.tmp
229 $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=49a69498-9a85-48af-9be4-aa0b3e0054f9 -s one -b CN=Partitions,CN=Configuration,DC=release-4-1-0rc3,DC=samba,DC=corp msDS-NC-Replica-Locations > $tmpldif
230 diff $tmpldif $release_dir/expected-replica-locations-after-dbcheck.ldif
231 if [ "$?" != "0" ]; then
232 return 1
234 # Check ForestDNS partition for replica locations
235 $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=7d2a15af-c0d4-487c-847e-e036292bcc65 -s one -b CN=Partitions,CN=Configuration,DC=release-4-1-0rc3,DC=samba,DC=corp msDS-NC-Replica-Locations > $tmpldif
236 diff $tmpldif $release_dir/expected-replica-locations-after-dbcheck2.ldif
237 if [ "$?" != "0" ]; then
238 return 1
240 elif [ x$RELEASE = x"release-4-5-0-pre1" ]; then
241 echo $RELEASE checking after values
242 tmpldif=$PREFIX_ABS/$RELEASE/expected-links-after-dbcheck.ldif.tmp
243 $BINDIR/ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb --show-recycled --show-deleted --show-deactivated-link --reveal member memberOf lastKnownParent objectCategory lastKnownParent wellKnownObjects legacyExchangeDN sAMAccountType uSNChanged --sorted > $tmpldif
244 diff $tmpldif $release_dir/expected-links-after-dbcheck.ldif
245 if [ "$?" != "0" ]; then
246 return 1
249 # If in the future dbcheck has to make a change recorded in replPropertyMetadata,
250 # this test will fail and can be removed.
251 tmpversion=$PREFIX_ABS/$RELEASE/rootdse-version.final.txt.tmp
252 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb -s base -b '' | grep highestCommittedUSN > $tmpversion
253 diff $tmpversion $release_dir/rootdse-version.final.txt
254 if [ "$?" != "0" ]; then
255 return 1
258 return 0
261 check_forced_duplicate_values() {
262 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
263 ldif=$release_dir/forced-duplicate-value-for-dbcheck.ldif
264 TZ=UTC $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb.d/DC%3DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb $ldif
265 if [ "$?" != "0" ]; then
266 return 1
268 else
269 return 0
273 # This should 'fail', because it returns the number of modified records
274 dbcheck_after_dup() {
275 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
276 $PYTHON $BINDIR/samba-tool dbcheck --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=administrator,cn=users,DC=release-4-1-0rc3,DC=samba,DC=corp $@
277 else
278 return 1
282 check_expected_after_dup_values() {
283 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
284 tmpldif=$PREFIX_ABS/$RELEASE/expected-otherphone-after-dbcheck.ldif.tmp
285 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=administrator -s base -b cn=administrator,cn=users,DC=release-4-1-0rc3,DC=samba,DC=corp otherHomePhone --sorted --show-binary | grep -v \# | sort > $tmpldif
286 diff $tmpldif $release_dir/expected-otherphone-after-dbcheck.ldif
287 if [ "$?" != "0" ]; then
288 return 1
291 return 0
294 # But having fixed it all up, this should pass
295 dbcheck_clean() {
296 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
299 # This should 'fail', because it returns the number of modified records.
300 # We don't need to run this against 4.1 releases
301 dbcheck_acl_reset() {
302 if [ x$RELEASE = x"release-4-0-0" -o x$RELEASE = x"alpha13" ]; then
303 $PYTHON $BINDIR/samba-tool dbcheck --reset-well-known-acls --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
304 else
305 return 1
308 # But having fixed it all up, this should pass.
309 # We don't need to run this against 4.1.0rc3
310 dbcheck_acl_reset_clean() {
311 if [ x$RELEASE != x"release-4-1-0rc3" ]; then
312 $PYTHON $BINDIR/samba-tool dbcheck --reset-well-known-acls --cross-ncs -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
316 # This should 'fail', because it returns the number of modified records
317 dbcheck2() {
318 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
319 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
320 else
321 exit 1
324 # But having fixed it all up, this should pass
325 dbcheck_clean2() {
326 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
327 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
331 rm_deleted_objects() {
332 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
333 TZ=UTC $ldbdel -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb.d/DC%3DRELEASE-4-1-0RC3,DC%3DSAMBA,DC%3DCORP.ldb 'CN=Deleted Objects,DC=RELEASE-4-1-0RC3,DC=SAMBA,DC=CORP'
334 if [ "$?" != "0" ]; then
335 return 1
337 else
338 return 0
341 # This should 'fail', because it returns the number of modified records
342 dbcheck3() {
343 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
344 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
345 else
346 exit 1
349 # But having fixed it all up, this should pass
350 dbcheck_clean3() {
351 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
352 $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
356 check_expected_after_deleted_objects() {
357 if [ x$RELEASE = x"release-4-1-0rc3" ]; then
358 tmpldif=$PREFIX_ABS/$RELEASE/expected-deleted_objects-after-dbcheck.ldif.tmp
359 TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb cn=deleted\ objects -s base -b cn=deleted\ objects,DC=release-4-1-0rc3,DC=samba,DC=corp objectClass description isDeleted isCriticalSystemObject objectGUID showInAdvancedViewOnly systemFlags --sorted --show-binary --show-deleted | grep -v \# | sort > $tmpldif
360 diff $tmpldif $release_dir/expected-deleted_objects-after-dbcheck.ldif
361 if [ "$?" != "0" ]; then
362 return 1
365 return 0
368 referenceprovision() {
369 if [ x$RELEASE == x"release-4-0-0" ]; then
370 $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 --function-level=2003
374 ldapcmp() {
375 if [ x$RELEASE == x"release-4-0-0" ]; then
376 $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
380 ldapcmp_sd() {
381 if [ x$RELEASE == x"release-4-0-0" ]; then
382 $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
386 if [ -d $release_dir ]; then
387 testit $RELEASE undump
388 testit "reindex" reindex
389 testit "current_version_mod" do_current_version_mod
390 testit "check_expected_before_values" check_expected_before_values
391 testit_expect_failure "dbcheck_objectclass" dbcheck_objectclass
392 testit_expect_failure "dbcheck" dbcheck
393 testit "check_expected_after_values" check_expected_after_values
394 testit "check_forced_duplicate_values" check_forced_duplicate_values
395 testit_expect_failure "dbcheck_after_dup" dbcheck_after_dup
396 testit "check_expected_after_dup_values" check_expected_after_dup_values
397 testit "dbcheck_clean" dbcheck_clean
398 testit_expect_failure "dbcheck_acl_reset" dbcheck_acl_reset
399 testit "dbcheck_acl_reset_clean" dbcheck_acl_reset_clean
400 testit "add_userparameters0" add_userparameters1
401 testit "add_userparameters1" add_userparameters1
402 testit "add_userparameters2" add_userparameters2
403 testit "add_userparameters3" add_userparameters3
404 testit_expect_failure "dbcheck2" dbcheck2
405 testit "dbcheck_clean2" dbcheck_clean2
406 testit "rm_deleted_objects" rm_deleted_objects
407 testit_expect_failure "dbcheck3" dbcheck3
408 testit "dbcheck_clean3" dbcheck_clean3
409 testit "check_expected_after_deleted_objects" check_expected_after_deleted_objects
410 testit "referenceprovision" referenceprovision
411 testit "ldapcmp" ldapcmp
412 testit "ldapcmp_sd" ldapcmp_sd
413 else
414 subunit_start_test $RELEASE
415 subunit_skip_test $RELEASE <<EOF
416 no test provision
419 subunit_start_test "reindex"
420 subunit_skip_test "reindex" <<EOF
421 no test provision
423 subunit_start_test check_expected_before_values
424 subunit_skip_test check_expected_before_values<<EOF
425 no test provision
427 subunit_start_test "dbcheck"
428 subunit_skip_test "dbcheck" <<EOF
429 no test provision
431 subunit_start_test "dbcheck_clean"
432 subunit_skip_test "dbcheck_clean" <<EOF
433 no test provision
435 subunit_start_test check_expected_after_values
436 subunit_skip_test check_expected_after_values<<EOF
437 no test provision
439 subunit_start_test "dbcheck_acl_reset"
440 subunit_skip_test "dbcheck_acl_reset" <<EOF
441 no test provision
443 subunit_start_test "dbcheck_clean_acl_reset"
444 subunit_skip_test "dbcheck_clean_acl_reset" <<EOF
445 no test provision
447 subunit_start_test add_userparameters0
448 subunit_skip_test add_userparameters0<<EOF
449 no test provision
452 subunit_start_test add_userparameters1
453 subunit_skip_test add_userparameters1<<EOF
454 no test provision
457 subunit_start_test add_userparameters2
458 subunit_skip_test add_userparameters2<<EOF
459 no test provision
462 subunit_start_test add_userparameters3
463 subunit_skip_test add_userparameters3<<EOF
464 no test provision
467 subunit_start_test check_expected_before_values
468 subunit_skip_test check_expected_before_values<<EOF
469 no test provision
472 subunit_start_test "dbcheck2"
473 subunit_skip_test "dbcheck2" <<EOF
474 no test provision
477 subunit_start_test "referenceprovision"
478 subunit_skip_test "referenceprovision" <<EOF
479 no test provision
481 subunit_start_test "ldapcmp"
482 subunit_skip_test "ldapcmp" <<EOF
483 no test provision
485 subunit_start_test "ldapcmp_sd"
486 subunit_skip_test "ldapcmp_sd" <<EOF
487 no test provision
491 if [ -d $PREFIX_ABS/${RELEASE} ]; then
492 rm -fr $PREFIX_ABS/${RELEASE}
495 if [ -d $PREFIX_ABS/${RELEASE}_reference ]; then
496 rm -fr $PREFIX_ABS/${RELEASE}_reference
499 exit $failed