From 1864196d8d7d27a6f7a565d8f778b681982704e4 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 29 Aug 2016 16:38:12 -0400 Subject: [PATCH] TAR creation is not deterministic, so we can't test repush consistently --- test/registry_tests.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/registry_tests.py b/test/registry_tests.py index 14d97b732..971476e13 100644 --- a/test/registry_tests.py +++ b/test/registry_tests.py @@ -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']))