Merge pull request #3290 from quay/joseph.schorr/QUAY-1124/implement-new-data-model
Implement the new OCI-based registry data model
This commit is contained in:
commit
6b86b87a16
23 changed files with 1847 additions and 209 deletions
|
@ -23,6 +23,20 @@ def basic_images():
|
|||
]
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def different_images():
|
||||
""" Returns different basic images for push and pull testing. """
|
||||
# Note: order is from base layer down to leaf.
|
||||
parent_bytes = layer_bytes_for_contents('different parent contents')
|
||||
image_bytes = layer_bytes_for_contents('some different contents')
|
||||
return [
|
||||
Image(id='anotherparentid', bytes=parent_bytes, parent_id=None),
|
||||
Image(id='anothersomeid', bytes=image_bytes, parent_id='anotherparentid'),
|
||||
]
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def sized_images():
|
||||
""" Returns basic images (with sizes) for push and pull testing. """
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# pylint: disable=W0401, W0621, W0613, W0614, R0913
|
||||
import os
|
||||
import hashlib
|
||||
import tarfile
|
||||
|
||||
|
@ -51,7 +52,30 @@ def test_multi_layer_images_push_pull(pusher, puller, multi_layer_images, livese
|
|||
credentials=credentials)
|
||||
|
||||
|
||||
def test_overwrite_tag(pusher, puller, basic_images, different_images, liveserver_session,
|
||||
app_reloader):
|
||||
""" Test: Basic push and pull of an image to a new repository, followed by a push to the same
|
||||
tag with different images. """
|
||||
credentials = ('devtable', 'password')
|
||||
|
||||
# Push a new repository.
|
||||
pusher.push(liveserver_session, 'devtable', 'newrepo', 'latest', basic_images,
|
||||
credentials=credentials)
|
||||
|
||||
# Pull the repository to verify.
|
||||
puller.pull(liveserver_session, 'devtable', 'newrepo', 'latest', basic_images,
|
||||
credentials=credentials)
|
||||
|
||||
# Push a new repository.
|
||||
pusher.push(liveserver_session, 'devtable', 'newrepo', 'latest', different_images,
|
||||
credentials=credentials)
|
||||
|
||||
# Pull the repository to verify.
|
||||
puller.pull(liveserver_session, 'devtable', 'newrepo', 'latest', different_images,
|
||||
credentials=credentials)
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.getenv('OCI_DATA_MODEL') == 'true', reason="no backfill in new model")
|
||||
def test_no_tag_manifests(pusher, puller, basic_images, liveserver_session, app_reloader,
|
||||
liveserver, registry_server_executor):
|
||||
""" Test: Basic pull without manifests. """
|
||||
|
|
|
@ -2909,7 +2909,7 @@ class TestListAndDeleteTag(ApiTestCase):
|
|||
for i in xrange(1, 9):
|
||||
tag_name = "tag" + str(i)
|
||||
remaining_tags.add(tag_name)
|
||||
registry_model.retarget_tag(repo_ref, tag_name, latest_tag.legacy_image)
|
||||
assert registry_model.retarget_tag(repo_ref, tag_name, latest_tag.legacy_image)
|
||||
|
||||
# Make sure we can iterate over all of them.
|
||||
json = self.getJsonResponse(ListRepositoryTags, params=dict(
|
||||
|
|
Reference in a new issue