mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-22 12:28:05 +00:00
Ensure that errors from Alice-and-Bob tests are reported correctly if setup fails.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
fadd2049bb
commit
b5b301707b
@ -126,6 +126,9 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin):
|
|||||||
def setup_alice_and_bob(self, alice_clock=reactor, bob_clock=reactor):
|
def setup_alice_and_bob(self, alice_clock=reactor, bob_clock=reactor):
|
||||||
self.set_up_grid(num_clients=2)
|
self.set_up_grid(num_clients=2)
|
||||||
|
|
||||||
|
self.alice_magicfolder = None
|
||||||
|
self.bob_magicfolder = None
|
||||||
|
|
||||||
alice_magic_dir = abspath_expanduser_unicode(u"Alice-magic", base=self.basedir)
|
alice_magic_dir = abspath_expanduser_unicode(u"Alice-magic", base=self.basedir)
|
||||||
self.mkdir_nonascii(alice_magic_dir)
|
self.mkdir_nonascii(alice_magic_dir)
|
||||||
bob_magic_dir = abspath_expanduser_unicode(u"Bob-magic", base=self.basedir)
|
bob_magic_dir = abspath_expanduser_unicode(u"Bob-magic", base=self.basedir)
|
||||||
@ -168,12 +171,6 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin):
|
|||||||
bob_magic_dir, bob_clock)
|
bob_magic_dir, bob_clock)
|
||||||
return result
|
return result
|
||||||
d.addCallback(get_Bob_magicfolder)
|
d.addCallback(get_Bob_magicfolder)
|
||||||
|
|
||||||
def prepare_result(result):
|
|
||||||
# XXX improve this
|
|
||||||
return (self.alice_collective_dircap, self.alice_upload_dircap, self.alice_magicfolder,
|
|
||||||
self.bob_collective_dircap, self.bob_upload_dircap, self.bob_magicfolder)
|
|
||||||
d.addCallback(prepare_result)
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
||||||
|
@ -339,13 +339,6 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
|
|||||||
alice_clock = task.Clock()
|
alice_clock = task.Clock()
|
||||||
bob_clock = task.Clock()
|
bob_clock = task.Clock()
|
||||||
d = self.setup_alice_and_bob(alice_clock, bob_clock)
|
d = self.setup_alice_and_bob(alice_clock, bob_clock)
|
||||||
def get_results(result):
|
|
||||||
# XXX are these used?
|
|
||||||
(self.alice_collective_dircap, self.alice_upload_dircap, self.alice_magicfolder,
|
|
||||||
self.bob_collective_dircap, self.bob_upload_dircap, self.bob_magicfolder) = result
|
|
||||||
#print "Alice magicfolderdb is at %r" % (self.alice_magicfolder._client.basedir)
|
|
||||||
#print "Bob magicfolderdb is at %r" % (self.bob_magicfolder._client.basedir)
|
|
||||||
d.addCallback(get_results)
|
|
||||||
|
|
||||||
def _check_uploader_count(ign, name, expected):
|
def _check_uploader_count(ign, name, expected):
|
||||||
self.failUnlessReallyEqual(self._get_count('uploader.'+name, client=self.alice_magicfolder._client),
|
self.failUnlessReallyEqual(self._get_count('uploader.'+name, client=self.alice_magicfolder._client),
|
||||||
@ -425,9 +418,10 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
|
|||||||
d.addCallback(_check_downloader_count, 'objects_downloaded', 3)
|
d.addCallback(_check_downloader_count, 'objects_downloaded', 3)
|
||||||
|
|
||||||
def _cleanup(ign, magicfolder, clock):
|
def _cleanup(ign, magicfolder, clock):
|
||||||
d2 = magicfolder.finish()
|
if magicfolder is not None:
|
||||||
clock.advance(0)
|
d2 = magicfolder.finish()
|
||||||
return d2
|
clock.advance(0)
|
||||||
|
return d2
|
||||||
|
|
||||||
def cleanup_Alice_and_Bob(result):
|
def cleanup_Alice_and_Bob(result):
|
||||||
print "cleanup alice bob test\n"
|
print "cleanup alice bob test\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user