]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
add container_size to mutable dump-share output
authorBrian Warner <warner@allmydata.com>
Wed, 7 Nov 2007 02:31:22 +0000 (19:31 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 7 Nov 2007 02:31:22 +0000 (19:31 -0700)
src/allmydata/scripts/debug.py
src/allmydata/test/test_system.py

index d899b10c064586bc3ec83d8a42c8cc46fbedf022..92ea94b86bb6a4f63bad970df07e76561eec88a7 100644 (file)
@@ -135,6 +135,7 @@ def dump_mutable_share(config, out, err):
     num_extra_leases = m._read_num_extra_leases(f)
     data_length = m._read_data_length(f)
     extra_lease_offset = m._read_extra_lease_offset(f)
+    container_size = extra_lease_offset - m.DATA_OFFSET
     leases = list(m._enumerate_leases(f))
     f.close()
 
@@ -143,9 +144,11 @@ def dump_mutable_share(config, out, err):
     print >>out, " write_enabler: %s" % idlib.b2a(WE)
     print >>out, " WE for nodeid: %s" % idlib.nodeid_b2a(nodeid)
     print >>out, " num_extra_leases: %d" % num_extra_leases
+    print >>out, " container_size: %d" % container_size
     print >>out, " data_length: %d" % data_length
     if leases:
         for (leasenum, (oid,et,rs,cs,anid)) in leases:
+            print >>out
             print >>out, " Lease #%d:" % leasenum
             print >>out, "  ownerid: %d" % oid
             when = format_expiration_time(et)
index 5c3be823096e2a242fea32bd67ec5209e1b06ede..384dc3ce8ade4ccfad6b6a1d9626d59b869009f4 100644 (file)
@@ -290,6 +290,7 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase):
             peerid = idlib.nodeid_b2a(self.clients[client_num].nodeid)
             self.failUnless(" WE for nodeid: %s\n" % peerid in output)
             self.failUnless(" num_extra_leases: 0\n" in output)
+            self.failUnless(" container_size: 381\n" in output)
             self.failUnless(" data_length: 381\n" in output)
             self.failUnless("  secrets are for nodeid: %s\n" % peerid in output)
         d.addCallback(_test_debug)