diff --git a/test/registry/protocol_v2.py b/test/registry/protocol_v2.py index 938b77b54..6f5fb0049 100644 --- a/test/registry/protocol_v2.py +++ b/test/registry/protocol_v2.py @@ -17,6 +17,7 @@ class V2ProtocolSteps(Enum): PUT_MANIFEST = 'put-manifest' MOUNT_BLOB = 'mount-blob' CATALOG = 'catalog' + LIST_TAGS = 'list-tags' class V2Protocol(RegistryProtocol): @@ -375,7 +376,8 @@ class V2Protocol(RegistryProtocol): params['n'] = page_size while True: - response = self.conduct(session, 'GET', url, headers=headers, params=params) + response = self.conduct(session, 'GET', url, headers=headers, params=params, + expected_status=(200, expected_failure, V2ProtocolSteps.LIST_TAGS)) data = response.json() assert len(data['tags']) <= page_size diff --git a/test/registry/registry_tests.py b/test/registry/registry_tests.py index 0accbde17..9a7e6a41e 100644 --- a/test/registry/registry_tests.py +++ b/test/registry/registry_tests.py @@ -779,6 +779,18 @@ def test_tags(username, namespace, repository, page_size, v2_protocol, liveserve assert set([r for r in results]) == set(expected_tags) +def test_tags_disabled_namespace(v2_protocol, basic_images, liveserver_session, app_reloader, + liveserver, registry_server_executor): + credentials = ('devtable', 'password') + + # Disable the buynlarge namespace. + registry_server_executor.on(liveserver).disable_namespace('buynlarge') + + # Try to retrieve the tags and ensure it fails. + v2_protocol.tags(liveserver_session, credentials=credentials, namespace='buynlarge', + repo_name='orgrepo', expected_failure=Failures.NAMESPACE_DISABLED) + + def test_pull_torrent(pusher, basic_images, liveserver_session, liveserver, registry_server_executor, app_reloader): """ Test: Retrieve a torrent for pulling the image via the Quay CLI. """