]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Confirm that we fix any errors on the Deleted Objects container itself
authorAndrew Bartlett <abartlet@samba.org>
Fri, 11 Dec 2020 02:37:04 +0000 (15:37 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 3 Feb 2021 04:19:36 +0000 (04:19 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14593

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
selftest/knownfail.d/dbcheck-deleted-objects [new file with mode: 0644]
testprogs/blackbox/dbcheck-oldrelease.sh

diff --git a/selftest/knownfail.d/dbcheck-deleted-objects b/selftest/knownfail.d/dbcheck-deleted-objects
new file mode 100644 (file)
index 0000000..9b32ddb
--- /dev/null
@@ -0,0 +1,2 @@
+^samba4.blackbox.dbcheck.alpha13.dbcheck_deleted_objects
+^samba4.blackbox.dbcheck.alpha13.quick.dbcheck_deleted_objects
index 9e9924654bed50842b132a26bc9e7f7c7dabe6f4..64c08c579812d441dc5862b89f2ac87c981f16de 100755 (executable)
@@ -297,6 +297,17 @@ dbcheck_objectclass() {
     fi
 }
 
+# This should 'fail', because it returns the number of wrong records, which it must if we did not skip the deleted objects
+dbcheck_deleted_objects() {
+    if [ x$RELEASE = x"alpha13" ]; then
+       basedn=$($ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb -s base -b "" defaultNamingContext| grep -i defaultNamingContext| cut -d\  -f 2)
+
+       $PYTHON $BINDIR/samba-tool dbcheck -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb "cn=deleted objects,$basedn" --scope base $@
+    else
+       return 1
+    fi
+}
+
 # This should 'fail', because it returns the number of modified records
 dbcheck() {
        $PYTHON $BINDIR/samba-tool dbcheck --selftest-check-expired-tombstones --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
@@ -488,6 +499,7 @@ testit $RELEASE undump || failed=`expr $failed + 1`
 testit "reindex" reindex || failed=`expr $failed + 1`
 testit "current_version_mod" do_current_version_mod || failed=`expr $failed + 1`
 testit "check_expected_before_values" check_expected_before_values || failed=`expr $failed + 1`
+testit_expect_failure "dbcheck_deleted_objects" dbcheck_deleted_objects || failed=`expr $failed + 1`
 testit_expect_failure "dbcheck_objectclass" dbcheck_objectclass || failed=`expr $failed + 1`
 testit_expect_failure "dbcheck" dbcheck || failed=`expr $failed + 1`
 testit "check_expected_after_values" check_expected_after_values || failed=`expr $failed + 1`