Merge pull request #1938 from coreos-inc/v2-missing-parent-test

Add parent mis-ordered registry test
This commit is contained in:
josephschorr 2016-10-04 21:53:13 +03:00 committed by GitHub
commit 768459ef86

View file

@ -1320,6 +1320,38 @@ class V1RegistryTests(V1RegistryPullMixin, V1RegistryPushMixin, RegistryTestsMix
class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMixin,
RegistryTestCaseMixin, LiveServerTestCase):
""" Tests for V2 registry. """
def test_parent_misordered(self):
images = [
{
'id': 'latestid',
'contents': 'the latest image',
'parent': 'baseid',
},
{
'id': 'baseid',
'contents': 'The base image',
},
]
self.do_push('devtable', 'newrepo', 'devtable', 'password', images=images,
expect_failure=FailureCodes.INVALID_REQUEST)
def test_invalid_parent(self):
images = [
{
'id': 'baseid',
'contents': 'The base image',
},
{
'id': 'latestid',
'contents': 'the latest image',
'parent': 'unknownparent',
},
]
self.do_push('devtable', 'newrepo', 'devtable', 'password', images=images,
expect_failure=FailureCodes.INVALID_REQUEST)
def test_tags_pagination(self):
# Push 10 tags.
tag_names = ['tag-%s' % i for i in range(0, 10)]