Make sure to encode all V1 metadata strings

Fixes #1239
This commit is contained in:
Joseph Schorr 2016-02-15 10:57:20 -05:00
parent 989c2722e5
commit 69262282fe
2 changed files with 34 additions and 1 deletions

View file

@ -749,6 +749,38 @@ class RegistryTestsMixin(object):
# Pull the repository.
self.do_pull('public', 'newrepo', 'public', 'password', images=images, munge_shas=True)
def test_push_same_ids_different_sha_with_unicode(self):
if self.push_version == 'v1':
# No SHAs to munge in V1.
return
images = [
{
'id': 'latestid',
'contents': 'The latest image',
'unicode': u'the Pawe\xc5\x82 Kami\xc5\x84ski image',
'parent': 'baseid',
},
{
'id': 'baseid',
'contents': 'The base image',
}
]
# Push a new repository.
self.do_push('public', 'newrepo', 'public', 'password', images=images)
# Pull the repository.
self.do_pull('public', 'newrepo', 'public', 'password', images=images)
# Push a the repository again, but with different SHAs.
self.do_push('public', 'newrepo', 'public', 'password', images=images, munge_shas=True)
# Pull the repository.
self.do_pull('public', 'newrepo', 'public', 'password', images=images, munge_shas=True)
def test_push_pull_logging(self):
# Push a new repository.
self.do_push('public', 'newrepo', 'public', 'password')