]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Alter NoNetworkGrid to allow the creation of readonly servers for testing purposes.
authorKevan Carstensen <kevan@isnotajoke.com>
Sun, 18 Oct 2009 01:30:13 +0000 (18:30 -0700)
committerKevan Carstensen <kevan@isnotajoke.com>
Sun, 18 Oct 2009 01:30:13 +0000 (18:30 -0700)
src/allmydata/test/no_network.py

index 1487576f600dcb5f157c8e34eacf2447dfa739e5..801714e96320e1701214ac992dd0304cb132c034 100644 (file)
@@ -216,12 +216,13 @@ class NoNetworkGrid(service.MultiService):
             c.setServiceParent(self)
             self.clients.append(c)
 
-    def make_server(self, i):
+    def make_server(self, i, readonly=False):
         serverid = hashutil.tagged_hash("serverid", str(i))[:20]
         serverdir = os.path.join(self.basedir, "servers",
                                  idlib.shortnodeid_b2a(serverid))
         fileutil.make_dirs(serverdir)
-        ss = StorageServer(serverdir, serverid, stats_provider=SimpleStats())
+        ss = StorageServer(serverdir, serverid, stats_provider=SimpleStats(),
+                           readonly_storage=readonly)
         return ss
 
     def add_server(self, i, ss):