summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2015-12-22 19:48:38 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-03-08 01:58:28 +0100
commit5fb98a3534a806331307a425d9469164e27d7ee7 (patch)
treedbd0edad6cb79d826214396e65be27dd2d5d9e73 /testprogs
parentac83f729bc80d02f042a337d9a06dfc4ef0632ac (diff)
downloadsamba-5fb98a3534a806331307a425d9469164e27d7ee7.tar.gz
dbcheck: Fix incorrect/duplicate attrid in replPropertMetaData
If custom schema is used in a replicated DC environment, these are created as soon as an attribute is modified on more than one DC. We have to remove these. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/dbcheck-oldrelease.sh46
1 files changed, 42 insertions, 4 deletions
diff --git a/testprogs/blackbox/dbcheck-oldrelease.sh b/testprogs/blackbox/dbcheck-oldrelease.sh
index 22942dd2b10..e43dcd8a5e5 100755
--- a/testprogs/blackbox/dbcheck-oldrelease.sh
+++ b/testprogs/blackbox/dbcheck-oldrelease.sh
@@ -141,14 +141,41 @@ reindex() {
$PYTHON $BINDIR/samba-tool dbcheck --reindex -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
}
+do_current_version_mod() {
+ if [ x$RELEASE = x"release-4-1-0rc3" ]; then
+ # Confirm (in combination with the ldbsearch below) that
+ # changing the attribute with current Samba fixes it, and that
+ # a fixed attriute isn't unfixed by dbcheck.
+ tmpldif=$release_dir/sudoers2-mod.ldif
+ $ldbmodify -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $tmpldif
+ fi
+ return 0
+}
+
check_expected_before_values() {
if [ x$RELEASE = x"release-4-1-0rc3" ]; then
tmpldif=$PREFIX_ABS/$RELEASE/expected-replpropertymetadata-before-dbcheck.ldif.tmp
- TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb -s base -b CN=ops_run_anything,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --show-binary > $tmpldif
+ 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
diff $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck.ldif
if [ "$?" != "0" ]; then
return 1
fi
+
+ 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
+
+ # Here we remove originating_change_time and whenChanged as
+ # these are time-dependent, caused by the ldbmodify above.
+
+ diff $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck2.ldif
+ if [ "$?" != "0" ]; then
+ return 1
+ fi
+
+ 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
+ diff $tmpldif $release_dir/expected-replpropertymetadata-before-dbcheck3.ldif
+ if [ "$?" != "0" ]; then
+ return 1
+ fi
fi
return 0
}
@@ -160,9 +187,19 @@ dbcheck() {
check_expected_after_values() {
if [ x$RELEASE = x"release-4-1-0rc3" ]; then
- tmpldif=$PREFIX_ABS/$RELEASE/expected-replpropertymetadata-after-dbcheck.ldif.tmp
- TZ=UTC $ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb -s base -b CN=ops_run_anything,OU=SUDOers,DC=release-4-1-0rc3,DC=samba,DC=corp \* replpropertymetadata --show-binary > $tmpldif
- diff -u $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck.ldif
+ tmpldif=$PREFIX_ABS/$RELEASE/expected-replpropertymetadata-before-dbcheck.ldif.tmp
+ 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
+ diff $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck.ldif
+ if [ "$?" != "0" ]; then
+ return 1
+ fi
+ 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
+ diff $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck2.ldif
+ if [ "$?" != "0" ]; then
+ return 1
+ fi
+ 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
+ diff $tmpldif $release_dir/expected-replpropertymetadata-after-dbcheck3.ldif
if [ "$?" != "0" ]; then
return 1
fi
@@ -228,6 +265,7 @@ ldapcmp_sd() {
if [ -d $release_dir ]; then
testit $RELEASE undump
testit "reindex" reindex
+ testit "current_version_mod" do_current_version_mod
testit "check_expected_before_values" check_expected_before_values
testit_expect_failure "dbcheck" dbcheck
testit "check_expected_after_values" check_expected_after_values