summaryrefslogtreecommitdiff
path: root/test/suite/test_readonly01.py
diff options
context:
space:
mode:
authorSusan LoVerso <sue@mongodb.com>2016-02-11 15:31:42 -0500
committerSusan LoVerso <sue@mongodb.com>2016-02-11 15:31:42 -0500
commit1d081b431605026d3c8e45f5269ad4ba17b4e86e (patch)
treeab91f8d4759c17ccf92d3d9031ccc73f6c06224b /test/suite/test_readonly01.py
parentaff55747f1a92397fe316819613411e38b1a4b9a (diff)
downloadmongo-1d081b431605026d3c8e45f5269ad4ba17b4e86e.tar.gz
WT-2349 Chmod all database files. Look for expected messages.
Diffstat (limited to 'test/suite/test_readonly01.py')
-rw-r--r--test/suite/test_readonly01.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/suite/test_readonly01.py b/test/suite/test_readonly01.py
index f37c90876a0..858c30e7457 100644
--- a/test/suite/test_readonly01.py
+++ b/test/suite/test_readonly01.py
@@ -97,11 +97,14 @@ class test_readonly01(wttest.WiredTigerTestCase, suite_subprocess):
#
self.close_conn()
if self.dirchmod:
+ for f in os.listdir(self.home):
+ if os.path.isfile(f):
+ os.chmod(f, 0444)
os.chmod(self.home, 0555)
self.conn = self.setUpConnectionOpen(self.home)
self.session = self.setUpSessionOpen(self.conn)
- def test_readonly(self):
+ def readonly(self):
# Here's the strategy:
# - Create a table.
# - Insert data into table.
@@ -132,7 +135,17 @@ class test_readonly01(wttest.WiredTigerTestCase, suite_subprocess):
# If we changed the directory to readonly, change it back so that
# the cleanup functions can remove it and set up for the next test.
if self.dirchmod:
+ for f in os.listdir(self.home):
+ if os.path.isfile(f):
+ os.chmod(f, 0666)
os.chmod(self.home, 0777)
+ def test_readonly(self):
+ if self.dirchmod:
+ with self.expectedStderrPattern('Permission'):
+ self.readonly()
+ else:
+ self.readonly()
+
if __name__ == '__main__':
wttest.run()