mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-28 04:03:21 -04:00
cache sync: check archive TAM
This commit is contained in:
parent
52483b26d0
commit
73eae8cc8b
2 changed files with 3 additions and 2 deletions
|
|
@ -726,7 +726,8 @@ class LocalCache(CacheStatsMixin):
|
|||
nonlocal processed_item_metadata_chunks
|
||||
csize, data = decrypted_repository.get(archive_id)
|
||||
chunk_idx.add(archive_id, 1, len(data), csize)
|
||||
archive = ArchiveItem(internal_dict=msgpack.unpackb(data))
|
||||
archive, verified = self.key.unpack_and_verify_archive(data, force_tam_not_required=True)
|
||||
archive = ArchiveItem(internal_dict=archive)
|
||||
if archive.version != 1:
|
||||
raise Exception('Unknown archive metadata version')
|
||||
sync = CacheSynchronizer(chunk_idx)
|
||||
|
|
|
|||
|
|
@ -1190,7 +1190,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
self.cmd('delete', '--cache-only', self.repository_location)
|
||||
create_json = json.loads(self.cmd('create', '--no-cache-sync', self.repository_location + '::test', 'input',
|
||||
'--json', '--error')) # ignore experimental warning
|
||||
info_json = json.loads(self.cmd('info', self.repository_location + '::test', '--json'))
|
||||
info_json = json.loads(self.cmd('info', self.repository_location + '::test', '--json', '--error')) # ign warn
|
||||
create_stats = create_json['cache']['stats']
|
||||
info_stats = info_json['cache']['stats']
|
||||
assert create_stats == info_stats
|
||||
|
|
|
|||
Loading…
Reference in a new issue