(self, name)
| 1267 | # an all platforms, and after that a test that will work only on |
| 1268 | # platforms/filesystems that prove to support sparse files. |
| 1269 | def _test_sparse_file(self, name): |
| 1270 | self.tar.extract(name, TEMPDIR, filter='data') |
| 1271 | filename = os.path.join(TEMPDIR, name) |
| 1272 | with open(filename, "rb") as fobj: |
| 1273 | data = fobj.read() |
| 1274 | self.assertEqual(sha256sum(data), sha256_sparse, |
| 1275 | "wrong sha256sum for %s" % name) |
| 1276 | |
| 1277 | if self._fs_supports_holes(): |
| 1278 | s = os.stat(filename) |
| 1279 | self.assertLess(s.st_blocks * 512, s.st_size) |
| 1280 | |
| 1281 | def test_sparse_file_old(self): |
| 1282 | self._test_sparse_file("gnu/sparse") |
no test coverage detected