From 09654db603334e7fe422c702f05c7675d00870aa Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Mon, 4 Apr 2022 13:29:28 +1000 Subject: Import wiredtiger: 024e03702869d87286c1698a3c3b28378d00d18b from branch mongodb-master ref: 930ccee6ff..024e037028 for: 6.0.0-rc0 WT-8988 Extend test_excl.py to cover more test cases and add tiered storage --- src/third_party/wiredtiger/import.data | 2 +- src/third_party/wiredtiger/test/suite/test_excl.py | 39 ++++++++++++++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index ea87ab9a76b..aa23cc31006 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "930ccee6ffc8f9f1f2ff77e74d1b47be150c2409" + "commit": "024e03702869d87286c1698a3c3b28378d00d18b" } diff --git a/src/third_party/wiredtiger/test/suite/test_excl.py b/src/third_party/wiredtiger/test/suite/test_excl.py index 9e656955026..73f7a9472b2 100644 --- a/src/third_party/wiredtiger/test/suite/test_excl.py +++ b/src/third_party/wiredtiger/test/suite/test_excl.py @@ -26,23 +26,40 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. +from helper_tiered import TieredConfigMixin, tiered_storage_sources import wiredtiger, wttest from wtscenario import make_scenarios # Test session.create with the exclusive configuration. -class test_create_excl(wttest.WiredTigerTestCase): - scenarios = make_scenarios([ - ('file', dict(type='file:')), - ('table', dict(type='table:')) - ]) - - # Create the object with "exclusive", then assert that creation with - # "exclusive" fails. +class test_create_excl(TieredConfigMixin, wttest.WiredTigerTestCase): + types = [ + ('file', dict(type = 'file:')), + ('table', dict(type = 'table:')), + ] + + scenarios = make_scenarios(tiered_storage_sources, types) + def test_create_excl(self): - uri = self.type + 'create_excl' - self.session.create(uri, "exclusive") + if self.is_tiered_scenario() and self.type == 'file:': + self.skipTest('Tiered storage does not support file URIs.') + + uri = self.type + "create_excl" + + # Create the object with the exclusive setting. + self.session.create(uri, "exclusive=true") + + # Exclusive re-create should error. self.assertRaises(wiredtiger.WiredTigerError, - lambda: self.session.create(uri, "exclusive")) + lambda: self.session.create(uri, "exclusive=true")) + + # Non-exclusive re-create is allowed. + self.session.create(uri, "exclusive=false") + + # Exclusive create on a table that does not exist should succeed. + self.session.create(uri + "_non_existent", "exclusive=true") + + # Non-exclusive create is allowed. + self.session.create(uri + "_non_existent1", "exclusive=false") if __name__ == '__main__': wttest.run() -- cgit v1.2.1