瀏覽代碼

Fix broken test that relied on improper zlib assumptions

This test assumed that zlib would always produce the same output for a
given input, and that assumption has proven incorrect. It rested on
zlib never improving. The zlib shipped in Clear Linux has algorithm
improvements, which caused this test to break.

This patch instead decompresses the expected value and compares that.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Thiago Macieira 6 年之前
父節點
當前提交
575a348ce4
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/borg/testsuite/hashindex.py

+ 2 - 1
src/borg/testsuite/hashindex.py

@@ -321,7 +321,8 @@ class HashIndexDataTestCase(BaseTestCase):
         idx1[H(2)] = 2**31 - 1, 0, 0
         idx1[H(3)] = 4294962296, 0, 0  # 4294962296 is -5000 interpreted as an uint32_t
 
-        assert self._serialize_hashindex(idx1) == self.HASHINDEX
+        serialized = self._serialize_hashindex(idx1)
+        assert self._unpack(serialized) == self._unpack(self.HASHINDEX)
 
     def test_read_known_good(self):
         idx1 = self._deserialize_hashindex(self.HASHINDEX)