]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_storage: add coverage for readonly_storage
authorBrian Warner <warner@allmydata.com>
Tue, 17 Jun 2008 00:52:13 +0000 (17:52 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 17 Jun 2008 00:52:13 +0000 (17:52 -0700)
src/allmydata/test/test_storage.py

index 89a9d51bfe8290794a89fd87a50e76beeb3c358c..e6218435f1fab5e55dd3d69d2b8dce14f9e4a5e5 100644 (file)
@@ -489,6 +489,16 @@ class Server(unittest.TestCase):
         leases = list(ss.get_leases("si3"))
         self.failUnlessEqual(len(leases), 2)
 
+    def test_readonly(self):
+        workdir = self.workdir("test_readonly")
+        ss = StorageServer(workdir, readonly_storage=True)
+        ss.setServiceParent(self.sparent)
+
+        canary = FakeCanary()
+        already,writers = self.allocate(ss, "vid", [0,1,2], 75)
+        self.failUnlessEqual(already, set())
+        self.failUnlessEqual(writers, {})
+
 
 
 class MutableServer(unittest.TestCase):