Repomd compression behaves differently for S3
Author: @fao89 (fao89)
Redmine Issue: 6476, https://pulp.plan.io/issues/6476
on repomd we have:
primary.xml.gz
update_info.xml.gz
When testing xml.gz behaves like it is not compressed
On the other hand, it behaves as compressed on S3 testing
https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/tests/functional/api/test_publish.py#L51-L67
def read_xml_gz(content):
"""
Read xml and xml.gz.
Tests work normally but fails for S3 due '.gz'
Why is it only compressed for S3?
"""
with NamedTemporaryFile() as temp_file:
temp_file.write(content)
temp_file.seek(0)
try:
content_xml = gzip.open(temp_file.name).read()
except OSError:
# FIXME: fix this as in CI primary/update_info.xml has '.gz' but it is not gzipped
content_xml = temp_file.read()
return content_xml
From: @fao89 (fao89) Date: 2020-04-23T18:05:15Z
I tested with real S3 bucket and got the same behavior, with:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
MEDIA_ROOT = ''
primary.xml.gz is compressed, as we expect but for:
DEFAULT_FILE_STORAGE = 'pulpcore.app.models.storage.FileSystem'
MEDIA_ROOT = '/var/lib/pulp/'
primary.xml.gz does have the gz suffix, but it is not compressed
From: @dralley (dalley) Date: 2021-08-02T04:52:04Z
@fao89 This sounds like a test issue so I'm going to mark it as one - let me know if that is incorrect.
From: @dralley (dalley) Date: 2021-08-02T04:53:46Z
Also dropping from the sprint since I mis-interpreted this issue earlier.
@fao89 Do you know if this remains an issue?
no idea, but as we run s3 tests in our CI I guess it got fixed