immutable: tests: verifier doesn't always catch corrupted share hashes
authorZooko O'Whielacronx <zooko@zooko.com>
Tue, 6 Jan 2009 20:04:49 +0000 (13:04 -0700)
committerZooko O'Whielacronx <zooko@zooko.com>
Tue, 6 Jan 2009 20:04:49 +0000 (13:04 -0700)
Maybe it already got one of the corrupted hashes from a different server and it doesn't double-check that the hash from every server is correct.  Or another problem.  But in any case I'm marking this as TODO because an even better (more picky) verifier is less urgent than repairer.

src/allmydata/test/test_immutable.py

index cae689a42ce100978760a5b29dfc59482a15eadc..34ee3a84a46eff79dc05866d1075edf18a8d1a03 100644 (file)
@@ -633,7 +633,6 @@ class Test(ShareManglingMixin, unittest.TestCase):
             _corrupt_offset_of_uri_extension,
             _corrupt_offset_of_uri_extension_to_force_short_read,
             _corrupt_share_data,
-            _corrupt_share_hashes,
             _corrupt_length_of_uri_extension,
             _corrupt_uri_extension,
             ], judge)
@@ -757,6 +756,26 @@ class Test(ShareManglingMixin, unittest.TestCase):
             ], judge)
     test_verify_server_invisible_corruption_block_hash_tree_TODO.todo = "Verifier doesn't yet properly detect this kind of corruption."
 
+    def test_verify_server_invisible_corruption_share_hash_tree_TODO(self):
+        def judge(checkresults):
+            self.failIf(checkresults.is_healthy(), (checkresults, checkresults.is_healthy(), checkresults.get_data()))
+            data = checkresults.get_data()
+            self.failUnless(data['count-shares-good'] == 9, data)
+            self.failUnless(data['count-shares-needed'] == 3, data)
+            self.failUnless(data['count-shares-expected'] == 10, data)
+            self.failUnless(data['count-good-share-hosts'] == 5, data)
+            self.failUnless(data['count-corrupt-shares'] == 1, (data,))
+            self.failUnless(len(data['list-corrupt-shares']) == 1, data)
+            self.failUnless(len(data['list-corrupt-shares']) == data['count-corrupt-shares'], data)
+            self.failUnless(len(data['list-incompatible-shares']) == data['count-incompatible-shares'], data)
+            self.failUnless(len(data['list-incompatible-shares']) == 0, data)
+            self.failUnless(len(data['servers-responding']) == 5, data)
+            self.failUnless(len(data['sharemap']) == 9, data)
+        return self._help_test_verify([
+            _corrupt_share_hashes,
+            ], judge)
+    test_verify_server_invisible_corruption_share_hash_tree_TODO.todo = "Verifier doesn't yet properly detect this kind of corruption."
+
     def test_repair(self):
         """ Repair replaces a share that got deleted. """
         # N == 10.  7 is the "efficiency leeway" -- we'll allow you to pass this test even if