def test_10_good_sanity_check(self):
d = defer.succeed(None)
for mutable in [False, True]:
- d.addCallback(lambda ign: self._set_up(mutable, "test_10_good_sanity_check"))
+ d.addCallback(lambda ign, mutable=mutable: self._set_up(mutable, "test_10_good_sanity_check"))
d.addCallback(lambda ign: self._download_and_check())
return d
def test_10_good_copied_share(self):
d = defer.succeed(None)
for mutable in [False, True]:
- d.addCallback(lambda ign: self._set_up(mutable, "test_10_good_copied_share"))
+ d.addCallback(lambda ign, mutable=mutable: self._set_up(mutable, "test_10_good_copied_share"))
d.addCallback(lambda ign: self._copy_all_shares_from(self.servers[2:3], self.servers[0]))
d.addCallback(lambda ign: self._download_and_check())
return d
def test_3_good_7_noshares(self):
d = defer.succeed(None)
for mutable in [False, True]:
- d.addCallback(lambda ign: self._set_up(mutable, "test_3_good_7_noshares"))
+ d.addCallback(lambda ign, mutable=mutable: self._set_up(mutable, "test_3_good_7_noshares"))
d.addCallback(lambda ign: self._delete_all_shares_from(self.servers[3:]))
d.addCallback(lambda ign: self._download_and_check())
return d
def test_2_good_8_broken_fail(self):
d = defer.succeed(None)
for mutable in [False, True]:
- d.addCallback(lambda ign: self._set_up(mutable, "test_2_good_8_broken_fail"))
+ d.addCallback(lambda ign, mutable=mutable: self._set_up(mutable, "test_2_good_8_broken_fail"))
d.addCallback(lambda ign: self._break(self.servers[2:]))
d.addCallback(lambda ign: self._should_fail_download())
return d
def test_2_good_8_noshares_fail(self):
d = defer.succeed(None)
for mutable in [False, True]:
- d.addCallback(lambda ign: self._set_up(mutable, "test_2_good_8_noshares_fail"))
+ d.addCallback(lambda ign, mutable=mutable: self._set_up(mutable, "test_2_good_8_noshares_fail"))
d.addCallback(lambda ign: self._delete_all_shares_from(self.servers[2:]))
d.addCallback(lambda ign: self._should_fail_download())
return d
def test_2_good_8_broken_copied_share(self):
d = defer.succeed(None)
for mutable in [False, True]:
- d.addCallback(lambda ign: self._set_up(mutable, "test_2_good_8_broken_copied_share"))
+ d.addCallback(lambda ign, mutable=mutable: self._set_up(mutable, "test_2_good_8_broken_copied_share"))
d.addCallback(lambda ign: self._copy_all_shares_from(self.servers[2:3], self.servers[0]))
d.addCallback(lambda ign: self._break(self.servers[2:]))
d.addCallback(lambda ign: self._download_and_check())
def test_2_good_8_broken_duplicate_share_fail(self):
d = defer.succeed(None)
for mutable in [False, True]:
- d.addCallback(lambda ign: self._set_up(mutable, "test_2_good_8_broken_duplicate_share_fail"))
+ d.addCallback(lambda ign, mutable=mutable: self._set_up(mutable, "test_2_good_8_broken_duplicate_share_fail"))
d.addCallback(lambda ign: self._copy_all_shares_from(self.servers[1:2], self.servers[0]))
d.addCallback(lambda ign: self._break(self.servers[2:]))
d.addCallback(lambda ign: self._should_fail_download())
reader = MDMFSlotReadProxy(None, None, shnum, data)
# We need to get the offsets for the next part.
d = reader.get_verinfo()
- def _do_corruption(verinfo, data, shnum):
+ def _do_corruption(verinfo, data, shnum, shares):
(seqnum,
root_hash,
IV,
else:
f = flip_bit
shares[shnum] = f(data, real_offset)
- d.addCallback(_do_corruption, data, shnum)
+ d.addCallback(_do_corruption, data, shnum, shares)
ds.append(d)
dl = defer.DeferredList(ds)
dl.addCallback(lambda ignored: res)
self.nodemaker.default_encoding_parameters['n'] = 1
d = defer.succeed(None)
for v in (SDMF_VERSION, MDMF_VERSION):
- d.addCallback(lambda ignored:
+ d.addCallback(lambda ignored, v=v:
self.nodemaker.create_mutable_file(version=v))
def _created(n):
self.failUnless(isinstance(n, MutableFileNode))