diff options
author | Andrew Bartlett <abartlet@samba.org> | 2016-08-26 15:53:19 +1200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2016-08-29 12:46:21 +0200 |
commit | db32a0e5ea8f652857e45480cc31ecb1ef884c1a (patch) | |
tree | 0f02c603574fe00318d0013c19134dd56531ca89 /testprogs | |
parent | 9d0c869e36ba2f43fd2ed4cd090b48102d499bc8 (diff) | |
download | samba-db32a0e5ea8f652857e45480cc31ecb1ef884c1a.tar.gz |
dbcheck: Abandon dbcheck if we get an error during a transaction
Otherwise, anything that the transaction has already done to the DB will be left in the DB
even despite the failure. For example, if a fix wrote to the DB, but then failed a post-write
check, then the fix will not be unrolled.
This is because we do not have nested transactions in TDB.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12178
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Aug 29 12:46:21 CEST 2016 on sn-devel-144
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/blackbox/dbcheck-oldrelease.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testprogs/blackbox/dbcheck-oldrelease.sh b/testprogs/blackbox/dbcheck-oldrelease.sh index 1efea67b56c..dd176cf6cb8 100755 --- a/testprogs/blackbox/dbcheck-oldrelease.sh +++ b/testprogs/blackbox/dbcheck-oldrelease.sh @@ -186,6 +186,15 @@ check_expected_before_values() { } # This should 'fail', because it returns the number of modified records +dbcheck_objectclass() { + if [ x$RELEASE = x"release-4-1-6-partial-object" ]; then + $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb --attrs=objectclass $@ + else + return 1 + fi +} + +# This should 'fail', because it returns the number of modified records dbcheck() { $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@ } @@ -363,6 +372,7 @@ if [ -d $release_dir ]; then testit "reindex" reindex testit "current_version_mod" do_current_version_mod testit "check_expected_before_values" check_expected_before_values + testit_expect_failure "dbcheck_objectclass" dbcheck_objectclass testit_expect_failure "dbcheck" dbcheck testit "check_expected_after_values" check_expected_after_values testit "check_forced_duplicate_values" check_forced_duplicate_values |