(self, name)
| 1250 | # an all platforms, and after that a test that will work only on |
| 1251 | # platforms/filesystems that prove to support sparse files. |
| 1252 | def _test_sparse_file(self, name): |
| 1253 | self.tar.extract(name, TEMPDIR, filter='data') |
| 1254 | filename = os.path.join(TEMPDIR, name) |
| 1255 | with open(filename, "rb") as fobj: |
| 1256 | data = fobj.read() |
| 1257 | self.assertEqual(sha256sum(data), sha256_sparse, |
| 1258 | "wrong sha256sum for %s" % name) |
| 1259 | |
| 1260 | if self._fs_supports_holes(): |
| 1261 | s = os.stat(filename) |
| 1262 | self.assertLess(s.st_blocks * 512, s.st_size) |
| 1263 | |
| 1264 | def test_sparse_file_old(self): |
| 1265 | self._test_sparse_file("gnu/sparse") |
no test coverage detected