From a46e64b0bbb1820163e0e23a9a624b41f718d456 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 6 Nov 2007 19:50:33 -0700 Subject: [PATCH] test_system.mutable: make sure we exercise FEC padding --- src/allmydata/test/test_system.py | 46 ++++++++++++++++++------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/src/allmydata/test/test_system.py b/src/allmydata/test/test_system.py index c0628cc7..a58b1389 100644 --- a/src/allmydata/test/test_system.py +++ b/src/allmydata/test/test_system.py @@ -249,7 +249,7 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase): #print "CREATING MUTABLE FILENODE" c = self.clients[0] n = MutableFileNode(c) - d1 = n.create("initial contents go here") + d1 = n.create("initial contents go here.") # 25 bytes % 3 != 0 def _done(res): log.msg("DONE: %s" % (res,)) #print "DONE", res @@ -286,24 +286,32 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase): stdout=out, stderr=err) output = out.getvalue() self.failUnlessEqual(rc, 0) - self.failUnless("Mutable slot found:\n" in output) - self.failUnless("share_type: SDMF\n" in output) - peerid = idlib.nodeid_b2a(self.clients[client_num].nodeid) - self.failUnless(" WE for nodeid: %s\n" % peerid in output) - self.failUnless(" num_extra_leases: 0\n" in output) - self.failUnless(" container_size: 381\n" in output) - self.failUnless(" data_length: 381\n" in output) - self.failUnless(" secrets are for nodeid: %s\n" % peerid in output) - self.failUnless(" SDMF contents:\n" in output) - self.failUnless(" seqnum: 1\n" in output) - self.failUnless(" required_shares: 3\n" in output) - self.failUnless(" total_shares: 10\n" in output) - self.failUnless(" segsize: 24\n" in output) - self.failUnless(" datalen: 24\n" in output) - # the exact share_hash_chain nodes depends upon the sharenum, and - # is more of a hassle to compute than I want to deal with now - self.failUnless(" share_hash_chain: " in output) - self.failUnless(" block_hash_tree: 1 nodes\n" in output) + try: + self.failUnless("Mutable slot found:\n" in output) + self.failUnless("share_type: SDMF\n" in output) + peerid = idlib.nodeid_b2a(self.clients[client_num].nodeid) + self.failUnless(" WE for nodeid: %s\n" % peerid in output) + self.failUnless(" num_extra_leases: 0\n" in output) + self.failUnless(" container_size: 382\n" in output) + self.failUnless(" data_length: 382\n" in output) + self.failUnless(" secrets are for nodeid: %s\n" % peerid + in output) + self.failUnless(" SDMF contents:\n" in output) + self.failUnless(" seqnum: 1\n" in output) + self.failUnless(" required_shares: 3\n" in output) + self.failUnless(" total_shares: 10\n" in output) + self.failUnless(" segsize: 27\n" in output) + self.failUnless(" datalen: 25\n" in output) + # the exact share_hash_chain nodes depends upon the sharenum, + # and is more of a hassle to compute than I want to deal with + # now + self.failUnless(" share_hash_chain: " in output) + self.failUnless(" block_hash_tree: 1 nodes\n" in output) + except unittest.FailTest: + print + print "dump-share output was:" + print output + raise d.addCallback(_test_debug) return d -- 2.45.2