Merge pull request #1786 from coreos-inc/fix-test
TAR creation is not deterministic, so we can't test repush consistently
This commit is contained in:
commit
74763259b4
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.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']))
|
||||
|
|
Reference in a new issue