mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 23:26:43 +00:00
All tests pass on Python 3 (albeit skipping some CLI-specific tests).
This commit is contained in:
parent
6f264a60e3
commit
ba6c4adba0
@ -1059,7 +1059,7 @@ def _corrupt_mutable_share_data(data, debug=False):
|
||||
assert prefix == MutableShareFile.MAGIC, "This function is designed to corrupt mutable shares of v1, and the magic number doesn't look right: %r vs %r" % (prefix, MutableShareFile.MAGIC)
|
||||
data_offset = MutableShareFile.DATA_OFFSET
|
||||
sharetype = data[data_offset:data_offset+1]
|
||||
assert sharetype == "\x00", "non-SDMF mutable shares not supported"
|
||||
assert sharetype == b"\x00", "non-SDMF mutable shares not supported"
|
||||
(version, ig_seqnum, ig_roothash, ig_IV, ig_k, ig_N, ig_segsize,
|
||||
ig_datalen, offsets) = unpack_header(data[data_offset:])
|
||||
assert version == 0, "this function only handles v0 SDMF files"
|
||||
|
@ -50,11 +50,11 @@ class MutableChecker(GridTestMixin, unittest.TestCase, ErrorMixin):
|
||||
d.addCallback(lambda ign: self.GET(self.fileurl+"?t=check&verify=true",
|
||||
method="POST"))
|
||||
def _got_results(out):
|
||||
self.failUnless("<span>Healthy : Healthy</span>" in out, out)
|
||||
self.failUnless("Recoverable Versions: 10*seq1-" in out, out)
|
||||
self.failIf("Not Healthy!" in out, out)
|
||||
self.failIf("Unhealthy" in out, out)
|
||||
self.failIf("Corrupt Shares" in out, out)
|
||||
self.failUnless(b"<span>Healthy : Healthy</span>" in out, out)
|
||||
self.failUnless(b"Recoverable Versions: 10*seq1-" in out, out)
|
||||
self.failIf(b"Not Healthy!" in out, out)
|
||||
self.failIf(b"Unhealthy" in out, out)
|
||||
self.failIf(b"Corrupt Shares" in out, out)
|
||||
d.addCallback(_got_results)
|
||||
d.addErrback(self.explain_web_error)
|
||||
return d
|
||||
@ -75,9 +75,9 @@ class MutableChecker(GridTestMixin, unittest.TestCase, ErrorMixin):
|
||||
d.addCallback(lambda ign: self.GET(self.fileurl+"?t=check&verify=true",
|
||||
method="POST"))
|
||||
def _got_results(out):
|
||||
self.failUnless("Not Healthy!" in out, out)
|
||||
self.failUnless("Unhealthy: best version has only 9 shares (encoding is 3-of-10)" in out, out)
|
||||
self.failUnless("Corrupt Shares:" in out, out)
|
||||
self.failUnless(b"Not Healthy!" in out, out)
|
||||
self.failUnless(b"Unhealthy: best version has only 9 shares (encoding is 3-of-10)" in out, out)
|
||||
self.failUnless(b"Corrupt Shares:" in out, out)
|
||||
d.addCallback(_got_results)
|
||||
|
||||
# now make sure the webapi repairer can fix it
|
||||
@ -85,13 +85,13 @@ class MutableChecker(GridTestMixin, unittest.TestCase, ErrorMixin):
|
||||
self.GET(self.fileurl+"?t=check&verify=true&repair=true",
|
||||
method="POST"))
|
||||
def _got_repair_results(out):
|
||||
self.failUnless("<div>Repair successful</div>" in out, out)
|
||||
self.failUnless(b"<div>Repair successful</div>" in out, out)
|
||||
d.addCallback(_got_repair_results)
|
||||
d.addCallback(lambda ign: self.GET(self.fileurl+"?t=check&verify=true",
|
||||
method="POST"))
|
||||
def _got_postrepair_results(out):
|
||||
self.failIf("Not Healthy!" in out, out)
|
||||
self.failUnless("Recoverable Versions: 10*seq" in out, out)
|
||||
self.failIf(b"Not Healthy!" in out, out)
|
||||
self.failUnless(b"Recoverable Versions: 10*seq" in out, out)
|
||||
d.addCallback(_got_postrepair_results)
|
||||
d.addErrback(self.explain_web_error)
|
||||
|
||||
@ -112,9 +112,9 @@ class MutableChecker(GridTestMixin, unittest.TestCase, ErrorMixin):
|
||||
d.addCallback(lambda ign: self.GET(self.fileurl+"?t=check&verify=false",
|
||||
method="POST"))
|
||||
def _got_results(out):
|
||||
self.failUnless("Not Healthy!" in out, out)
|
||||
self.failUnless("Unhealthy: best version has only 9 shares (encoding is 3-of-10)" in out, out)
|
||||
self.failIf("Corrupt Shares" in out, out)
|
||||
self.failUnless(b"Not Healthy!" in out, out)
|
||||
self.failUnless(b"Unhealthy: best version has only 9 shares (encoding is 3-of-10)" in out, out)
|
||||
self.failIf(b"Corrupt Shares" in out, out)
|
||||
d.addCallback(_got_results)
|
||||
|
||||
# now make sure the webapi repairer can fix it
|
||||
@ -122,13 +122,13 @@ class MutableChecker(GridTestMixin, unittest.TestCase, ErrorMixin):
|
||||
self.GET(self.fileurl+"?t=check&verify=false&repair=true",
|
||||
method="POST"))
|
||||
def _got_repair_results(out):
|
||||
self.failUnless("Repair successful" in out)
|
||||
self.failUnless(b"Repair successful" in out)
|
||||
d.addCallback(_got_repair_results)
|
||||
d.addCallback(lambda ign: self.GET(self.fileurl+"?t=check&verify=false",
|
||||
method="POST"))
|
||||
def _got_postrepair_results(out):
|
||||
self.failIf("Not Healthy!" in out, out)
|
||||
self.failUnless("Recoverable Versions: 10*seq" in out)
|
||||
self.failIf(b"Not Healthy!" in out, out)
|
||||
self.failUnless(b"Recoverable Versions: 10*seq" in out)
|
||||
d.addCallback(_got_postrepair_results)
|
||||
d.addErrback(self.explain_web_error)
|
||||
|
||||
@ -1202,11 +1202,11 @@ class Large(DeepCheckBase, unittest.TestCase):
|
||||
self.subdir_node = subdir_node
|
||||
kids = {}
|
||||
for i in range(1, COUNT):
|
||||
litcap = LiteralFileURI("%03d-data" % i).to_string()
|
||||
litcap = LiteralFileURI(b"%03d-data" % i).to_string()
|
||||
kids[u"%03d-small" % i] = (litcap, litcap)
|
||||
return subdir_node.set_children(kids)
|
||||
d.addCallback(_add_children)
|
||||
up = upload.Data(b"large enough for CHK" * 100, "")
|
||||
up = upload.Data(b"large enough for CHK" * 100, b"")
|
||||
d.addCallback(lambda ign: self.subdir_node.add_file(u"0000-large", up))
|
||||
|
||||
def _start_deepcheck(ignored):
|
||||
|
Loading…
Reference in New Issue
Block a user