diff --git a/data/model/test/test_gc.py b/data/model/test/test_gc.py index 975de1660..e3070e4fb 100644 --- a/data/model/test/test_gc.py +++ b/data/model/test/test_gc.py @@ -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)