TAR creation is not deterministic, so we can't test repush consistently
This commit is contained in:
parent
5c64646629
commit
1864196d8d
1 changed files with 3 additions and 5 deletions
|
@ -188,6 +188,7 @@ def _get_full_contents(image_data, additional_fields=False):
|
||||||
tar_file_info = tarfile.TarInfo(name=name)
|
tar_file_info = tarfile.TarInfo(name=name)
|
||||||
tar_file_info.type = tarfile.REGTYPE
|
tar_file_info.type = tarfile.REGTYPE
|
||||||
tar_file_info.size = len(contents)
|
tar_file_info.size = len(contents)
|
||||||
|
tar_file_info.mtime = 1
|
||||||
|
|
||||||
tar_file = tarfile.open(fileobj=layer_data, mode='w|gz')
|
tar_file = tarfile.open(fileobj=layer_data, mode='w|gz')
|
||||||
tar_file.addfile(tar_file_info, StringIO(contents))
|
tar_file.addfile(tar_file_info, StringIO(contents))
|
||||||
|
@ -596,8 +597,8 @@ class V2RegistryPushMixin(V2RegistryMixin):
|
||||||
expected_code = 204
|
expected_code = 204
|
||||||
|
|
||||||
contents_chunk = layer_bytes[start_byte:end_byte]
|
contents_chunk = layer_bytes[start_byte:end_byte]
|
||||||
self.conduct('PATCH', location, data=contents_chunk, expected_code=expected_code, auth='jwt',
|
self.conduct('PATCH', location, data=contents_chunk, expected_code=expected_code,
|
||||||
headers={'Range': 'bytes=%s-%s' % (start_byte, end_byte)})
|
auth='jwt', headers={'Range': 'bytes=%s-%s' % (start_byte, end_byte)})
|
||||||
|
|
||||||
if expected_code != 204:
|
if expected_code != 204:
|
||||||
return
|
return
|
||||||
|
@ -1149,9 +1150,6 @@ class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMix
|
||||||
|
|
||||||
(_, digest) = self.do_push('devtable', 'newrepo', 'devtable', 'password', images=images)
|
(_, digest) = self.do_push('devtable', 'newrepo', 'devtable', 'password', images=images)
|
||||||
|
|
||||||
# Push again to verify no duplication.
|
|
||||||
(_, digest) = self.do_push('devtable', 'newrepo', 'devtable', 'password', images=images)
|
|
||||||
|
|
||||||
self.conduct_api_login('devtable', 'password')
|
self.conduct_api_login('devtable', 'password')
|
||||||
labels = self.conduct('GET', '/api/v1/repository/devtable/newrepo/manifest/' + digest + '/labels').json()
|
labels = self.conduct('GET', '/api/v1/repository/devtable/newrepo/manifest/' + digest + '/labels').json()
|
||||||
self.assertEquals(3, len(labels['labels']))
|
self.assertEquals(3, len(labels['labels']))
|
||||||
|
|
Reference in a new issue