summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--obnamlib/fmt_6/repo_fmt_6.py11
-rw-r--r--test-gpghome/random_seedbin600 -> 600 bytes
2 files changed, 9 insertions, 2 deletions
diff --git a/obnamlib/fmt_6/repo_fmt_6.py b/obnamlib/fmt_6/repo_fmt_6.py
index 06a9d807..9a7f5782 100644
--- a/obnamlib/fmt_6/repo_fmt_6.py
+++ b/obnamlib/fmt_6/repo_fmt_6.py
@@ -756,8 +756,15 @@ class RepositoryFormat6(obnamlib.RepositoryInterface):
def validate_chunk_content(self, chunk_id):
if self._is_in_tree_chunk_id(chunk_id): # pragma: no cover
- # FIXME: Check whole-file md5 here
- return True
+ gen_id, filename = self._unpack_in_tree_chunk_id(chunk_id)
+ client_name, gen_number = gen_id
+ client = self._open_client(client_name)
+ data = client.get_file_data(gen_number, filename)
+ checksum = hashlib.md5(data).hexdigest()
+ expected = self.get_file_key(
+ gen_id, filename, obnamlib.REPO_FILE_MD5)
+ return checksum == expected
+
try:
content = self.get_chunk_content(chunk_id)
except obnamlib.RepositoryChunkDoesNotExist:
diff --git a/test-gpghome/random_seed b/test-gpghome/random_seed
index 6c3f20e0..19a89568 100644
--- a/test-gpghome/random_seed
+++ b/test-gpghome/random_seed
Binary files differ