Merge pull request #2778 from coreos-inc/gc-long-chain-test

Add a long-chain test for GC
This commit is contained in:
josephschorr 2017-07-13 00:23:03 +03:00 committed by GitHub
commit d00c7d299c

View file

@ -620,3 +620,14 @@ def test_purge_repo(app):
with patch('app.tuf_metadata_api') as mock_tuf:
model.repository.purge_repository("ns", "repo")
assert mock_tuf.delete_metadata.called_with("ns", "repo")
def test_super_long_image_chain_gc(app, default_tag_policy):
""" Test that a super long chain of images all gets properly GCed. """
with assert_gc_integrity():
images = ['i%s' % i for i in range(0, 100)]
repository = create_repository(latest=images)
delete_tag(repository, 'latest')
# Ensure the repository is now empty.
assert_deleted(repository, *images)