5 Usage: dbcheck.sh PREFIX RELEASE
16 .
`dirname $0`/subunit.sh
17 .
`dirname $0`/common_test_fns.inc
19 release_dir
=`dirname $0`/..
/..
/source4/selftest
/provisions
/$RELEASE
22 if [ -x "$BINDIR/ldbmodify" ]; then
23 ldbmodify
="$BINDIR/ldbmodify"
27 if [ -x "$BINDIR/ldbdel" ]; then
28 ldbdel
="$BINDIR/ldbdel"
32 if [ -x "$BINDIR/ldbsearch" ]; then
33 ldbsearch
="$BINDIR/ldbsearch"
36 samba_tdbrestore
="tdbrestore"
37 if [ -x "$BINDIR/tdbrestore" ]; then
38 samba_tdbrestore
="$BINDIR/tdbrestore"
41 samba_undump
="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
42 if [ ! -x $samba_undump ] ||
[ ! -d $release_dir ]; then
43 subunit_start_test
$RELEASE
44 subunit_skip_test
$RELEASE <<EOF
48 subunit_start_test
"reindex"
49 subunit_skip_test
"reindex" <<EOF
52 subunit_start_test check_expected_before_values
53 subunit_skip_test check_expected_before_values
<<EOF
56 subunit_start_test
"dbcheck"
57 subunit_skip_test
"dbcheck" <<EOF
60 subunit_start_test
"dbcheck_clean"
61 subunit_skip_test
"dbcheck_clean" <<EOF
64 subunit_start_test check_expected_after_values
65 subunit_skip_test check_expected_after_values
<<EOF
68 subunit_start_test
"dbcheck_acl_reset"
69 subunit_skip_test
"dbcheck_acl_reset" <<EOF
72 subunit_start_test
"dbcheck_clean_acl_reset"
73 subunit_skip_test
"dbcheck_clean_acl_reset" <<EOF
76 subunit_start_test add_userparameters0
77 subunit_skip_test add_userparameters0
<<EOF
81 subunit_start_test add_userparameters1
82 subunit_skip_test add_userparameters1
<<EOF
86 subunit_start_test add_userparameters2
87 subunit_skip_test add_userparameters2
<<EOF
91 subunit_start_test add_userparameters3
92 subunit_skip_test add_userparameters3
<<EOF
96 subunit_start_test check_expected_before_values
97 subunit_skip_test check_expected_before_values
<<EOF
101 subunit_start_test
"dbcheck2"
102 subunit_skip_test
"dbcheck2" <<EOF
106 subunit_start_test
"referenceprovision"
107 subunit_skip_test
"referenceprovision" <<EOF
110 subunit_start_test
"ldapcmp"
111 subunit_skip_test
"ldapcmp" <<EOF
114 subunit_start_test
"ldapcmp_sd"
115 subunit_skip_test
"ldapcmp_sd" <<EOF
123 $samba_undump $release_dir $PREFIX_ABS/$RELEASE $samba_tdbrestore
126 add_userparameters0
() {
127 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
128 $ldbmodify -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
<<EOF
129 dn: cn=localdc,cn=domain controllers,dc=release-4-1-0rc3,dc=samba,dc=corp
131 replace: userParameters
132 userParameters:: IAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAC
133 AAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUAAQABoACAAB
134 AEMAdAB4AEMAZgBnAFAAcgBlAHMAZQBuAHQANTUxZTBiYjAYAAgAAQBDAHQAeABDAGYAZw
135 BGAGwAYQBnAHMAMQAwMGUwMDAxMBYACAABAEMAdAB4AEMAYQBsAGwAYgBhAGMAawAwMDAw
136 MDAwMBIACAABAEMAdAB4AFMAaABhAGQAbwB3ADAxMDAwMDAwKAAIAAEAQwB0AHgATQBhAH
137 gAQwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwLgAIAAEAQwB0AHgATQBh
138 AHgARABpAHMAYwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwHAAIAAEAQw
139 B0AHgATQBhAHgASQBkAGwAZQBUAGkAbQBlADAwMDAwMDAwIgAIAAEAQwB0AHgASwBlAHkA
140 YgBvAGEAcgBkAEwAYQB5AG8AdQB0ADAwMDAwMDAwKgACAAEAQwB0AHgATQBpAG4ARQBuAG
141 MAcgB5AHAAdABpAG8AbgBMAGUAdgBlAGwAMDAgAAIAAQBDAHQAeABXAG8AcgBrAEQAaQBy
142 AGUAYwB0AG8AcgB5ADAwIAACAAEAQwB0AHgATgBXAEwAbwBnAG8AbgBTAGUAcgB2AGUAcg
143 AwMBgAJAABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByADVjNWM3MzYxNzQ3NTcyNmU2NTVj
144 NzAyZTYyNjk2NDZmNmUwMCIABgABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByAEQAcgBpAH
145 YAZQA1MDNhMDAgADoAAQBDAHQAeABXAEYAUAByAG8AZgBpAGwAZQBQAGEAdABoADVjNWM3
146 MzYxNzQ3NTcyNmU2NTVjNzA3MjZmNjY2OTZjNjU3NDczNjU1YzcwMmU2MjY5NjQ2ZjZlMD
147 AiAAIAAQBDAHQAeABJAG4AaQB0AGkAYQBsAFAAcgBvAGcAcgBhAG0AMDAiAAIAAQBDAHQA
148 eABDAGEAbABsAGIAYQBjAGsATgB1AG0AYgBlAHIAMDA=
153 add_userparameters1
() {
154 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
155 $ldbmodify -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
<<EOF
156 dn: cn=administrator,cn=users,dc=release-4-1-0rc3,dc=samba,dc=corp
158 replace: userParameters
159 userParameters: IAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAC
160 AAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAUAAQABoACAAB
161 AEMAdAB4AEMAZgBnAFAAcgBlAHMAZQBuAHQANTUxZTBiYjAYAAgAAQBDAHQAeABDAGYAZw
162 BGAGwAYQBnAHMAMQAwMGUwMDAxMBYACAABAEMAdAB4AEMAYQBsAGwAYgBhAGMAawAwMDAw
163 MDAwMBIACAABAEMAdAB4AFMAaABhAGQAbwB3ADAxMDAwMDAwKAAIAAEAQwB0AHgATQBhAH
164 gAQwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwLgAIAAEAQwB0AHgATQBh
165 AHgARABpAHMAYwBvAG4AbgBlAGMAdABpAG8AbgBUAGkAbQBlADAwMDAwMDAwHAAIAAEAQw
166 B0AHgATQBhAHgASQBkAGwAZQBUAGkAbQBlADAwMDAwMDAwIgAIAAEAQwB0AHgASwBlAHkA
167 YgBvAGEAcgBkAEwAYQB5AG8AdQB0ADAwMDAwMDAwKgACAAEAQwB0AHgATQBpAG4ARQBuAG
168 MAcgB5AHAAdABpAG8AbgBMAGUAdgBlAGwAMDAgAAIAAQBDAHQAeABXAG8AcgBrAEQAaQBy
169 AGUAYwB0AG8AcgB5ADAwIAACAAEAQwB0AHgATgBXAEwAbwBnAG8AbgBTAGUAcgB2AGUAcg
170 AwMBgAJAABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByADVjNWM3MzYxNzQ3NTcyNmU2NTVj
171 NzAyZTYyNjk2NDZmNmUwMCIABgABAEMAdAB4AFcARgBIAG8AbQBlAEQAaQByAEQAcgBpAH
172 YAZQA1MDNhMDAgADoAAQBDAHQAeABXAEYAUAByAG8AZgBpAGwAZQBQAGEAdABoADVjNWM3
173 MzYxNzQ3NTcyNmU2NTVjNzA3MjZmNjY2OTZjNjU3NDczNjU1YzcwMmU2MjY5NjQ2ZjZlMD
174 AiAAIAAQBDAHQAeABJAG4AaQB0AGkAYQBsAFAAcgBvAGcAcgBhAG0AMDAiAAIAAQBDAHQA
175 eABDAGEAbABsAGIAYQBjAGsATgB1AG0AYgBlAHIAMDA=
180 add_userparameters2
() {
181 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
182 $ldbmodify -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
<<EOF
183 dn: cn=krbtgt,cn=users,dc=release-4-1-0rc3,dc=samba,dc=corp
185 replace: userParameters
186 userParameters:: Q3R4Q2ZnUHJlc2VudCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI
187 CAgUAsaCAFDdHhDZmdQcmVzZW5045S15pSx5oiw44GiIAIBQ3R4V0ZQcm9maWxlUGF0aOOAsBgCAU
188 N0eFdGSG9tZURpcuOAsCICAUN0eFdGSG9tZURpckRyaXZl44CwEggBQ3R4U2hhZG9344Sw44Cw44C
189 w44CwLggBQ3R4TWF4RGlzY29ubmVjdGlvblRpbWXjgaXjjLnjkLDjgLAoCAFDdHhNYXhDb25uZWN0
190 aW9uVGltZeOAtOOct+aIseOAsBwIAUN0eE1heElkbGVUaW1l44Gj45yy46Sw44CwIAIBQ3R4V29ya
191 0RpcmVjdG9yeeOAsBgIAUN0eENmZ0ZsYWdzMeOAsOOBpuOYsuOAuCICAUN0eEluaXRpYWxQcm9ncm
198 add_userparameters3
() {
199 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
200 $ldbmodify -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
<<EOF
201 dn: cn=guest,cn=users,dc=release-4-1-0rc3,dc=samba,dc=corp
203 replace: userParameters
204 userParameters:: QwAAAHQAAAB4AAAAQwAAAGYAAABnAAAAUAAAAHIAAABlAAAAcwAAAGUAAABuA
205 AAAdAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAA
206 AgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACA
207 AAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAUAAAAAsAAAAaAAAACAAAAAEAAABDAAAAdAAA
208 AHgAAABDAAAAZgAAAGcAAABQAAAAcgAAAGUAAABzAAAAZQAAAG4AAAB0AAAANQA1ADEAZQAwAGIAY
209 gAwACAAAAACAAAAAQAAAEMAAAB0AAAAeAAAAFcAAABGAAAAUAAAAHIAAABvAAAAZgAAAGkAAABsAA
210 AAZQAAAFAAAABhAAAAdAAAAGgAAAAwADAAGAAAAAIAAAABAAAAQwAAAHQAAAB4AAAAVwAAAEYAAAB
211 IAAAAbwAAAG0AAABlAAAARAAAAGkAAAByAAAAMAAwACIAAAACAAAAAQAAAEMAAAB0AAAAeAAAAFcA
212 AABGAAAASAAAAG8AAABtAAAAZQAAAEQAAABpAAAAcgAAAEQAAAByAAAAaQAAAHYAAABlAAAAMAAwA
213 BIAAAAIAAAAAQAAAEMAAAB0AAAAeAAAAFMAAABoAAAAYQAAAGQAAABvAAAAdwAAADAAMQAwADAAMA
214 AwADAAMAAuAAAACAAAAAEAAABDAAAAdAAAAHgAAABNAAAAYQAAAHgAAABEAAAAaQAAAHMAAABjAAA
215 AbwAAAG4AAABuAAAAZQAAAGMAAAB0AAAAaQAAAG8AAABuAAAAVAAAAGkAAABtAAAAZQAAAGUAMAA5
216 ADMAMAA0ADAAMAAoAAAACAAAAAEAAABDAAAAdAAAAHgAAABNAAAAYQAAAHgAAABDAAAAbwAAAG4AA
217 ABuAAAAZQAAAGMAAAB0AAAAaQAAAG8AAABuAAAAVAAAAGkAAABtAAAAZQAAADQAMAA3ADcAMQBiAD
218 AAMAAcAAAACAAAAAEAAABDAAAAdAAAAHgAAABNAAAAYQAAAHgAAABJAAAAZAAAAGwAAABlAAAAVAA
219 AAGkAAABtAAAAZQAAAGMAMAAyADcAMAA5ADAAMAAgAAAAAgAAAAEAAABDAAAAdAAAAHgAAABXAAAA
220 bwAAAHIAAABrAAAARAAAAGkAAAByAAAAZQAAAGMAAAB0AAAAbwAAAHIAAAB5AAAAMAAwABgAAAAIA
221 AAAAQAAAEMAAAB0AAAAeAAAAEMAAABmAAAAZwAAAEYAAABsAAAAYQAAAGcAAABzAAAAMQAAADAAMA
222 BmADAAMgA2ADgAMAAiAAAAAgAAAAEAAABDAAAAdAAAAHgAAABJAAAAbgAAAGkAAAB0AAAAaQAAAGE
223 AAABsAAAAUAAAAHIAAABvAAAAZwAAAHIAAABhAAAAbQAAADAAMAA=
229 check_expected_userparameters
() {
230 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
231 tmpldif
=$PREFIX_ABS/$RELEASE/expected-userParameters-after-dbcheck.ldif.tmp
232 TZ
=UTC
$ldbsearch -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb userParameters
=* -s sub
-b DC
=release-4-1-0rc3
,DC
=samba
,DC
=corp userParameters
--sorted |
grep -v \
# > $tmpldif
233 diff -u $tmpldif $release_dir/expected-userParameters-after-dbcheck.ldif
234 if [ "$?" != "0" ]; then
242 $PYTHON $BINDIR/samba-tool dbcheck
--reindex -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
245 do_current_version_mod
() {
246 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
247 # Confirm (in combination with the ldbsearch below) that
248 # changing the attribute with current Samba fixes it, and that
249 # a fixed attriute isn't unfixed by dbcheck.
250 tmpldif
=$release_dir/sudoers2-mod.ldif
251 $ldbmodify -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
$tmpldif
256 check_expected_before_values
() {
257 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
258 tmpldif
=$PREFIX_ABS/$RELEASE/expected-replpropertymetadata-before-dbcheck.ldif.tmp
259 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
260 diff -u $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck.ldif
261 if [ "$?" != "0" ]; then
265 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
267 # Here we remove originating_change_time and whenChanged as
268 # these are time-dependent, caused by the ldbmodify above.
270 diff -u $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck2.ldif
271 if [ "$?" != "0" ]; then
275 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
276 diff -u $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck3.ldif
277 if [ "$?" != "0" ]; then
280 elif [ x
$RELEASE = x
"release-4-5-0-pre1" ]; then
281 tmpldif
=$PREFIX_ABS/$RELEASE/rootdse-version.initial.txt.tmp
282 TZ
=UTC
$ldbsearch -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
-s base
-b '' |
grep highestCommittedUSN
> $tmpldif
283 diff -u $tmpldif $release_dir/rootdse-version.initial.txt
284 if [ "$?" != "0" ]; then
291 # This should 'fail', because it returns the number of modified records
292 dbcheck_objectclass
() {
293 if [ x
$RELEASE = x
"release-4-1-6-partial-object" ]; then
294 $PYTHON $BINDIR/samba-tool dbcheck
--selftest-check-expired-tombstones --cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
--attrs=objectclass $@
300 # This should 'fail', because it returns the number of wrong records, which it must if we did not skip the deleted objects
301 dbcheck_deleted_objects
() {
302 if [ x
$RELEASE = x
"alpha13" ]; then
303 basedn
=$
($ldbsearch -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
-s base
-b "" defaultNamingContext|
grep -i defaultNamingContext| cut
-d\
-f 2)
305 $PYTHON $BINDIR/samba-tool dbcheck
-H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
"cn=deleted objects,$basedn" --scope base $@
311 # This should 'fail', because it returns the number of modified records
313 $PYTHON $BINDIR/samba-tool dbcheck
--selftest-check-expired-tombstones --cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
316 check_expected_after_values
() {
317 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
318 tmpldif
=$PREFIX_ABS/$RELEASE/expected-replpropertymetadata-after-dbcheck.ldif.tmp
319 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
320 diff -u $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck.ldif
321 if [ "$?" != "0" ]; then
324 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
325 diff -u $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck2.ldif
326 if [ "$?" != "0" ]; then
329 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
330 diff -u $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck3.ldif
331 if [ "$?" != "0" ]; then
334 # Check DomainDNS partition for replica locations
335 tmpldif
=$PREFIX_ABS/$RELEASE/expected-replica-locations-after-dbcheck.ldif.tmp
336 $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
337 diff -u $tmpldif $release_dir/expected-replica-locations-after-dbcheck.ldif
338 if [ "$?" != "0" ]; then
341 # Check ForestDNS partition for replica locations
342 $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
343 diff -u $tmpldif $release_dir/expected-replica-locations-after-dbcheck2.ldif
344 if [ "$?" != "0" ]; then
347 elif [ x
$RELEASE = x
"release-4-5-0-pre1" ]; then
348 echo $RELEASE checking after values
349 tmpldif
=$PREFIX_ABS/$RELEASE/expected-links-after-dbcheck.ldif.tmp
350 $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
351 diff -u $tmpldif $release_dir/expected-links-after-dbcheck.ldif
352 if [ "$?" != "0" ]; then
356 # If in the future dbcheck has to make a change recorded in replPropertyMetadata,
357 # this test will fail and can be removed.
358 tmpversion
=$PREFIX_ABS/$RELEASE/rootdse-version.final.txt.tmp
359 TZ
=UTC
$ldbsearch -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
-s base
-b '' |
grep highestCommittedUSN
> $tmpversion
360 diff -u $tmpversion $release_dir/rootdse-version.final.txt
361 if [ "$?" != "0" ]; then
368 check_forced_duplicate_values
() {
369 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
370 ldif
=$release_dir/forced-duplicate-value-for-dbcheck.ldif
371 TZ
=UTC
$ldbmodify -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb.d
/DC
%3DRELEASE-4-1-0RC3
,DC
%3DSAMBA
,DC
%3DCORP.ldb
$ldif
372 if [ "$?" != "0" ]; then
380 # This should 'fail', because it returns the number of modified records
381 dbcheck_after_dup
() {
382 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
383 $PYTHON $BINDIR/samba-tool dbcheck
--selftest-check-expired-tombstones --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb cn
=administrator
,cn
=users
,DC
=release-4-1-0rc3
,DC
=samba
,DC
=corp $@
389 check_expected_after_dup_values
() {
390 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
391 tmpldif
=$PREFIX_ABS/$RELEASE/expected-otherphone-after-dbcheck.ldif.tmp
392 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
393 diff -u $tmpldif $release_dir/expected-otherphone-after-dbcheck.ldif
394 if [ "$?" != "0" ]; then
401 # But having fixed it all up, this should pass
403 $PYTHON $BINDIR/samba-tool dbcheck
--cross-ncs -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
406 # This should 'fail', because it returns the number of modified records.
407 # We don't need to run this against 4.1 releases
408 dbcheck_acl_reset
() {
409 if [ x
$RELEASE = x
"release-4-0-0" -o x
$RELEASE = x
"alpha13" ]; then
410 $PYTHON $BINDIR/samba-tool dbcheck
--reset-well-known-acls --cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
415 # But having fixed it all up, this should pass.
416 # We don't need to run this against 4.1.0rc3
417 dbcheck_acl_reset_clean
() {
418 if [ x
$RELEASE != x
"release-4-1-0rc3" ]; then
419 $PYTHON $BINDIR/samba-tool dbcheck
--reset-well-known-acls --cross-ncs -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
423 # This should 'fail', because it returns the number of modified records
425 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
426 $PYTHON $BINDIR/samba-tool dbcheck
--selftest-check-expired-tombstones --cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
431 # But having fixed it all up, this should pass
433 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
434 $PYTHON $BINDIR/samba-tool dbcheck
--selftest-check-expired-tombstones --cross-ncs -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
438 rm_deleted_objects
() {
439 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
440 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'
441 if [ "$?" != "0" ]; then
448 # This should 'fail', because it returns the number of modified records
450 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
451 $PYTHON $BINDIR/samba-tool dbcheck
--selftest-check-expired-tombstones --cross-ncs --fix --yes -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
456 # But having fixed it all up, this should pass
458 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
459 $PYTHON $BINDIR/samba-tool dbcheck
--selftest-check-expired-tombstones --cross-ncs -H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb $@
463 check_expected_after_deleted_objects
() {
464 if [ x
$RELEASE = x
"release-4-1-0rc3" ]; then
465 tmpldif
=$PREFIX_ABS/$RELEASE/expected-deleted_objects-after-dbcheck.ldif.tmp
466 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
467 diff -u $tmpldif $release_dir/expected-deleted_objects-after-dbcheck.ldif
468 if [ "$?" != "0" ]; then
475 referenceprovision
() {
476 if [ x
$RELEASE = x
"release-4-0-0" ]; then
477 $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 --base-schema=2008_R2_old
479 # on top of this, also apply 2008R2 changes we accidentally missed in the past
480 $PYTHON $BINDIR/samba-tool domain schemaupgrade
-H tdb
://$PREFIX_ABS/${RELEASE}/private
/sam.ldb
--ldf-file=samba-4.7
-missing-for-schema45.ldif
,fix-forest-rev.ldf
485 if [ x
$RELEASE = x
"release-4-0-0" ]; then
486 $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
,displayName
,msDS-SupportedEncryptionTypes
491 if [ x
$RELEASE = x
"release-4-0-0" ]; then
492 $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
496 remove_directory
$PREFIX_ABS/${RELEASE}_reference
498 testit
$RELEASE undump || failed
=`expr $failed + 1`
499 testit
"reindex" reindex || failed
=`expr $failed + 1`
500 testit
"current_version_mod" do_current_version_mod || failed
=`expr $failed + 1`
501 testit
"check_expected_before_values" check_expected_before_values || failed
=`expr $failed + 1`
502 testit_expect_failure
"dbcheck_deleted_objects" dbcheck_deleted_objects || failed
=`expr $failed + 1`
503 testit_expect_failure
"dbcheck_objectclass" dbcheck_objectclass || failed
=`expr $failed + 1`
504 testit_expect_failure
"dbcheck" dbcheck || failed
=`expr $failed + 1`
505 testit
"check_expected_after_values" check_expected_after_values || failed
=`expr $failed + 1`
506 testit
"check_forced_duplicate_values" check_forced_duplicate_values || failed
=`expr $failed + 1`
507 testit_expect_failure
"dbcheck_after_dup" dbcheck_after_dup || failed
=`expr $failed + 1`
508 testit
"check_expected_after_dup_values" check_expected_after_dup_values || failed
=`expr $failed + 1`
509 testit
"dbcheck_clean" dbcheck_clean || failed
=`expr $failed + 1`
510 testit_expect_failure
"dbcheck_acl_reset" dbcheck_acl_reset || failed
=`expr $failed + 1`
511 testit
"dbcheck_acl_reset_clean" dbcheck_acl_reset_clean || failed
=`expr $failed + 1`
512 testit
"add_userparameters0" add_userparameters1 || failed
=`expr $failed + 1`
513 testit
"add_userparameters1" add_userparameters1 || failed
=`expr $failed + 1`
514 testit
"add_userparameters2" add_userparameters2 || failed
=`expr $failed + 1`
515 testit
"add_userparameters3" add_userparameters3 || failed
=`expr $failed + 1`
516 testit_expect_failure
"dbcheck2" dbcheck2 || failed
=`expr $failed + 1`
517 testit
"dbcheck_clean2" dbcheck_clean2 || failed
=`expr $failed + 1`
518 testit
"check_expected_userparameters" check_expected_userparameters || failed
=`expr $failed + 1`
519 testit
"rm_deleted_objects" rm_deleted_objects || failed
=`expr $failed + 1`
520 # We must re-index again because rm_deleted_objects went behind
521 # the back of the main sam.ldb.
522 testit
"reindex2" reindex || failed
=`expr $failed + 1`
523 testit_expect_failure
"dbcheck3" dbcheck3 || failed
=`expr $failed + 1`
524 testit
"dbcheck_clean3" dbcheck_clean3 || failed
=`expr $failed + 1`
525 testit
"check_expected_after_deleted_objects" check_expected_after_deleted_objects || failed
=`expr $failed + 1`
526 testit
"referenceprovision" referenceprovision || failed
=`expr $failed + 1`
527 testit
"ldapcmp" ldapcmp || failed
=`expr $failed + 1`
528 testit
"ldapcmp_sd" ldapcmp_sd || failed
=`expr $failed + 1`
530 if [ -d $PREFIX_ABS/${RELEASE} ]; then
531 rm -fr $PREFIX_ABS/${RELEASE}
534 remove_directory
$PREFIX_ABS/${RELEASE}_reference