Add a schema 2 push pull verification test

This commit is contained in:
Joseph Schorr 2018-11-21 21:02:13 +02:00
parent 6207bb5e6f
commit 49ea2d1fa1

View file

@ -1629,3 +1629,23 @@ def test_squashed_image_manifest_list(v22_protocol, basic_images, liveserver_ses
'%s/layer.tar' % expected_image_id] '%s/layer.tar' % expected_image_id]
assert tar.getnames() == expected_names assert tar.getnames() == expected_names
def test_verify_schema2(v22_protocol, basic_images, liveserver_session, liveserver,
app_reloader, data_model):
""" Test: Ensure that pushing of schema 2 manifests results in a pull of a schema2 manifest. """
credentials = ('devtable', 'password')
if data_model != 'oci_model':
return
credentials = ('devtable', 'password')
# Push a new repository.
v22_protocol.push(liveserver_session, 'devtable', 'newrepo', 'latest', basic_images,
credentials=credentials)
# Pull the repository to verify.
result = v22_protocol.pull(liveserver_session, 'devtable', 'newrepo', 'latest', basic_images,
credentials=credentials)
manifest = result.manifests['latest']
assert manifest.schema_version == 2