Change manifest delete to mark tag as dead and log

This commit is contained in:
Joseph Schorr 2015-12-10 15:15:24 -05:00
parent 5ff3ec631e
commit d963f7174a
3 changed files with 29 additions and 2 deletions

View file

@ -753,6 +753,24 @@ class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMix
RegistryTestCaseMixin, LiveServerTestCase):
""" Tests for V2 registry. """
def test_delete_manifest(self):
# Push a new repo with the latest tag.
(_, digest) = self.do_push('devtable', 'newrepo', 'devtable', 'password')
# Ensure the pull works.
self.do_pull('devtable', 'newrepo', 'devtable', 'password')
# Conduct auth for the write scope.
self.do_auth('devtable', 'password', 'devtable', 'newrepo', scopes=['push'])
# Delete the digest.
self.conduct('DELETE', '/v2/devtable/newrepo/manifests/' + digest, auth='jwt',
expected_code=202)
# Ensure the tag no longer exists.
self.do_pull('devtable', 'newrepo', 'devtable', 'password',
expected_manifest_code=404)
def test_push_only_push_scope(self):
images = [{
'id': 'onlyimagehere',