def shares_available(self):
"""Return a dict that maps verinfo to tuples of
- (num_distinct_shares, k) tuples."""
+ (num_distinct_shares, k, N) tuples."""
versionmap = self.make_versionmap()
all_shares = {}
for verinfo, shares in versionmap.items():
s.add(shnum)
(seqnum, root_hash, IV, segsize, datalength, k, N, prefix,
offsets_tuple) = verinfo
- all_shares[verinfo] = (len(s), k)
+ all_shares[verinfo] = (len(s), k, N)
return all_shares
def highest_seqnum(self):
self.failIfEqual(best, None)
self.failUnlessEqual(sm.recoverable_versions(), set([best]))
self.failUnlessEqual(len(sm.shares_available()), 1)
- self.failUnlessEqual(sm.shares_available()[best], (num_shares, 3))
+ self.failUnlessEqual(sm.shares_available()[best], (num_shares, 3, 10))
shnum, peerids = sm.make_sharemap().items()[0]
peerid = list(peerids)[0]
self.failUnlessEqual(sm.version_on_peer(peerid, shnum), best)
best = sm.best_recoverable_version()
self.failUnlessEqual(best, None)
self.failUnlessEqual(len(sm.shares_available()), 1)
- self.failUnlessEqual(sm.shares_available().values()[0], (2,3) )
+ self.failUnlessEqual(sm.shares_available().values()[0], (2,3,10) )
return sm
def test_not_quite_enough_shares(self):