mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 17:28:53 +00:00
servermap.shares_available: report N too, not just k
This commit is contained in:
parent
45405d85c4
commit
a0de01e971
@ -186,7 +186,7 @@ class ServerMap:
|
||||
|
||||
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():
|
||||
@ -195,7 +195,7 @@ class ServerMap:
|
||||
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):
|
||||
|
@ -646,7 +646,7 @@ class Servermap(unittest.TestCase):
|
||||
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)
|
||||
@ -770,7 +770,7 @@ class Servermap(unittest.TestCase):
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user