1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-10 14:15:43 +00:00

skip tests requiring the chunks index (archive)

Only LocalCache implements these.
This commit is contained in:
Thomas Waldmann 2023-09-30 23:37:52 +02:00
parent 4cd9bc8a6b
commit 25a7a1443a
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -54,6 +54,11 @@ def test_cache_chunks(archiver):
create_src_archive(archiver, "test")
chunks_path = os.path.join(archiver.cache_path, "chunks")
chunks_before_corruption = set(ChunkIndex(path=chunks_path).iteritems())
chunks_index = os.path.join(archiver.cache_path, "chunks")
if not os.path.exists(chunks_index):
pytest.skip("Only works with LocalCache.")
corrupt(chunks_path)
assert not archiver.FORK_DEFAULT # test does not support forking
@ -102,6 +107,8 @@ def test_chunks_archive(archiver):
cmd(archiver, "rinfo", "--json")
chunks_archive = os.path.join(archiver.cache_path, "chunks.archive.d")
if not os.path.exists(chunks_archive):
pytest.skip("Only LocalCache has a per-archive chunks index cache.")
assert len(os.listdir(chunks_archive)) == 4 # two archives, one chunks cache and one .integrity file each
corrupt(os.path.join(chunks_archive, target_id + ".compact"))