summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2015-03-12 17:05:24 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2015-03-12 17:05:24 +1100
commitb423b0a02a159c76232e38666c3ad28d7dd0b8f1 (patch)
treebd39db0c4e0edc1395133b6a70c3b0e0f4f3353a /test
parent7e189388516815c4be18ece4f855c2739a083429 (diff)
downloadmongo-b423b0a02a159c76232e38666c3ad28d7dd0b8f1.tar.gz
Add test case for configuring sweep options.
Diffstat (limited to 'test')
-rw-r--r--test/suite/test_sweep02.py79
1 files changed, 79 insertions, 0 deletions
diff --git a/test/suite/test_sweep02.py b/test/suite/test_sweep02.py
new file mode 100644
index 00000000000..91d8e1a718c
--- /dev/null
+++ b/test/suite/test_sweep02.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+#
+# Public Domain 2014-2015 MongoDB, Inc.
+# Public Domain 2008-2014 WiredTiger, Inc.
+#
+# This is free and unencumbered software released into the public domain.
+#
+# Anyone is free to copy, modify, publish, use, compile, sell, or
+# distribute this software, either in source code form or as a compiled
+# binary, for any purpose, commercial or non-commercial, and by any
+# means.
+#
+# In jurisdictions that recognize copyright laws, the author or authors
+# of this software dedicate any and all copyright interest in the
+# software to the public domain. We make this dedication for the benefit
+# of the public at large and to the detriment of our heirs and
+# successors. We intend this dedication to be an overt act of
+# relinquishment in perpetuity of all present and future rights to this
+# software under copyright law.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+# test_sweep02.py
+# Test configuring and reconfiguring sweep options.
+#
+
+import wiredtiger, wttest
+from wiredtiger import wiredtiger_open
+from wttest import unittest
+
+class test_sweep02(wttest.WiredTigerTestCase):
+ base_config = 'create,'
+ dir = 'WT_TEST'
+ tablebase = 'test_sweep02'
+ uri = 'table:' + tablebase
+
+ # Disable default setup/shutdown steps - connections are managed manually.
+ def setUpSessionOpen(self, conn):
+ return None
+
+ def setUpConnectionOpen(self, dir):
+ self.dir = dir
+ return None
+
+ def test_config01(self):
+ self.conn = wiredtiger_open(self.dir,
+ self.base_config + "file_close=()")
+
+ def test_config02(self):
+ self.conn = wiredtiger_open(self.dir,
+ self.base_config + "file_close=(interval=1)")
+
+ def test_config03(self):
+ self.conn = wiredtiger_open(self.dir,
+ self.base_config + "file_close=(idle_time=1)")
+
+ def test_config04(self):
+ self.conn = wiredtiger_open(self.dir,
+ self.base_config + "file_close=(interval=1,idle_time=1)")
+
+ def test_config05(self):
+ self.conn = wiredtiger_open(self.dir,
+ self.base_config + "file_close=(interval=3)")
+ self.conn.reconfigure("file_close=(idle_time=4)")
+ # TODO: Validate this once config cursors work
+
+ def test_config06(self):
+ self.conn = wiredtiger_open(self.dir, self.base_config)
+ self.conn.reconfigure("file_close=(idle_time=4,interval=100)")
+
+if __name__ == '__main__':
+ wttest.run()
+