From a046141708835a66402ec0d98498370696c6da5b Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 4 Oct 2016 19:26:12 +0300 Subject: [PATCH] Add parent mis-ordered registry test --- test/registry_tests.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/registry_tests.py b/test/registry_tests.py index 0b58fff2d..dcca9c45f 100644 --- a/test/registry_tests.py +++ b/test/registry_tests.py @@ -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)]