TAR creation is not deterministic, so we can't test repush consistently

This commit is contained in:
Joseph Schorr 2016-08-29 16:38:12 -04:00
parent 5c64646629
commit 1864196d8d

View file

@ -188,6 +188,7 @@ def _get_full_contents(image_data, additional_fields=False):
tar_file_info = tarfile.TarInfo(name=name)
tar_file_info.type = tarfile.REGTYPE
tar_file_info.size = len(contents)
tar_file_info.mtime = 1
tar_file = tarfile.open(fileobj=layer_data, mode='w|gz')
tar_file.addfile(tar_file_info, StringIO(contents))
@ -596,8 +597,8 @@ class V2RegistryPushMixin(V2RegistryMixin):
expected_code = 204
contents_chunk = layer_bytes[start_byte:end_byte]
self.conduct('PATCH', location, data=contents_chunk, expected_code=expected_code, auth='jwt',
headers={'Range': 'bytes=%s-%s' % (start_byte, end_byte)})
self.conduct('PATCH', location, data=contents_chunk, expected_code=expected_code,
auth='jwt', headers={'Range': 'bytes=%s-%s' % (start_byte, end_byte)})
if expected_code != 204:
return
@ -1149,9 +1150,6 @@ class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMix
(_, 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')
labels = self.conduct('GET', '/api/v1/repository/devtable/newrepo/manifest/' + digest + '/labels').json()
self.assertEquals(3, len(labels['labels']))