add container_size to mutable dump-share output

This commit is contained in:
Brian Warner 2007-11-06 19:31:22 -07:00
parent 8be9ef5149
commit fdbe692810
2 changed files with 4 additions and 0 deletions

View 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)

View 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)