From: Zooko O'Whielacronx Date: Sat, 22 Sep 2007 22:26:27 +0000 (-0700) Subject: fix test_vdrive (fixes #144) X-Git-Tag: allmydata-tahoe-0.6.0~15 X-Git-Url: https://git.rkrishnan.org/frontends/webapi.txt?a=commitdiff_plain;h=a18f7aa6d5771d9a8f0dfea371318721ef5da105;p=tahoe-lafs%2Ftahoe-lafs.git fix test_vdrive (fixes #144) It turns out that we actually have *two* files in our storage servers at the time that test_vdrive asserts things about the shares. I suppose that test_vdrive happens to pass on all other operating systems because the filesystem happens to return the right share as the first one in a "listdir()". The fix in this patch is slightly kludgey -- allow either share to pass -- but good enough. --- diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index b3e57ca1..092accaf 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -639,13 +639,19 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase): output = out.getvalue() self.failUnlessEqual(rc, 0) - # we only upload a single file, so we can assert some things about - # its size and shares - self.failUnless("size: %d\n" % len(self.data) in output) - self.failUnless("num_segments: 1\n" in output) - # segment_size is always a multiple of needed_shares - self.failUnless("segment_size: 114\n" in output) - self.failUnless("total_shares: 10\n" in output) + # We've uploaded only two files so we can assert some things + # about the size and shares. + self.failUnless("size: 112\n" in output or "size: 1500000\n" in output) + if "size: 112\n" in output: + self.failUnless("num_segments: 1\n" in output) + # segment_size is always a multiple of needed_shares + self.failUnless("segment_size: 114\n" in output) + self.failUnless("total_shares: 10\n" in output) + else: + self.failUnless("num_segments: 2\n" in output) + # segment_size is always a multiple of needed_shares + self.failUnless("segment_size: 1048578\n" in output) + self.failUnless("total_shares: 10\n" in output) # keys which are supposed to be present for key in ("size", "num_segments", "segment_size", "needed_shares", "total_shares",