From: Andrew Bartlett Date: Wed, 11 Apr 2018 00:51:49 +0000 (+1200) Subject: selftest: Make a transaction before @INDEXLIST etc is checked in dsdb_schema_attribut... X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=18d4a1cc3fa1fd9635bdfa702a62fc81e50f4be9 selftest: Make a transaction before @INDEXLIST etc is checked in dsdb_schema_attributes.py This helps us remove the write to the database from the (soon to be read locked) init code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13379 Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/tests/dsdb_schema_attributes.py b/python/samba/tests/dsdb_schema_attributes.py index 2bebbb569f2c..c3b956f3b999 100644 --- a/python/samba/tests/dsdb_schema_attributes.py +++ b/python/samba/tests/dsdb_schema_attributes.py @@ -193,6 +193,14 @@ systemOnly: FALSE samdb2 = samba.tests.connect_samdb(self.lp.samdb_url()) + # We now only update the @ATTRIBUTES when a transaction happens + # rather than making a read of the DB do writes. + # + # This avoids locking issues and is more expected + + samdb2.transaction_start() + samdb2.transaction_commit() + res = self.samdb.search(base="@ATTRIBUTES", scope=ldb.SCOPE_BASE, attrs=["@TEST_EXTRA"]) self.assertEquals(len(res), 1) @@ -220,6 +228,14 @@ systemOnly: FALSE samdb2 = samba.tests.connect_samdb(self.lp.samdb_url()) + # We now only update the @INDEXLIST when a transaction happens + # rather than making a read of the DB do writes. + # + # This avoids locking issues and is more expected + + samdb2.transaction_start() + samdb2.transaction_commit() + res = self.samdb.search(base="@INDEXLIST", scope=ldb.SCOPE_BASE, attrs=["@TEST_EXTRA"]) self.assertEquals(len(res), 1) diff --git a/selftest/knownfail.d/dsdb_schema_attributes b/selftest/knownfail.d/dsdb_schema_attributes deleted file mode 100644 index 4e9e7a05c94a..000000000000 --- a/selftest/knownfail.d/dsdb_schema_attributes +++ /dev/null @@ -1,2 +0,0 @@ -^samba.tests.dsdb_schema_attributes.samba.tests.dsdb_schema_attributes.SchemaAttributesTestCase.test_modify_at_attributes -^samba.tests.dsdb_schema_attributes.samba.tests.dsdb_schema_attributes.SchemaAttributesTestCase.test_modify_at_indexlist