Merge "s3api compat tests: stop asserting DisplayName in Owner"

This commit is contained in:
Zuul
2025年08月22日 15:51:48 +00:00
committed by Gerrit Code Review

View File

@@ -266,6 +266,12 @@ class BaseS3TestCase(BaseS3Mixin, unittest.TestCase):
else:
self.clear_account(client)
def check_owner(self, owner):
# as of July 2025, S3 may or may not send DisplayName
# https://docs.aws.amazon.com/AmazonS3/latest/API/API_Owner.html
owner.pop('DisplayName', None)
self.assertEqual(['ID'], list(owner.keys()))
class BaseS3TestCaseWithBucket(BaseS3Mixin, unittest.TestCase):
@classmethod

View File

@@ -21,14 +21,12 @@ from test.s3api import BaseS3TestCase, ConfigError, \
class TestGetServiceSigV4(BaseS3TestCase):
def _do_test_empty_service(self, client):
access_key = client._request_signer._credentials.access_key
resp = client.list_buckets()
self.assertEqual(200, resp['ResponseMetadata']['HTTPStatusCode'])
self.assertEqual([], resp['Buckets'])
self.assertIn('x-amz-request-id',
resp['ResponseMetadata']['HTTPHeaders'])
self.assertIn('DisplayName', resp['Owner'])
self.assertEqual(access_key, resp['Owner']['DisplayName'])
self.check_owner(resp['Owner'])
self.assertIn('ID', resp['Owner'])
def test_empty_service(self):
@@ -59,10 +57,7 @@ class TestGetServiceSigV4(BaseS3TestCase):
for bucket in resp['Buckets']))
self.assertIn('x-amz-request-id',
resp['ResponseMetadata']['HTTPHeaders'])
self.assertIn('DisplayName', resp['Owner'])
access_key = client._request_signer._credentials.access_key
self.assertEqual(access_key, resp['Owner']['DisplayName'])
self.assertIn('ID', resp['Owner'])
self.check_owner(resp['Owner'])
def test_service_with_buckets(self):
client = self.get_s3_client(1)

View File

@@ -670,9 +670,9 @@ class TestObjectVersioning(BaseS3TestCase):
objs = resp.get('Contents', [])
for obj in objs:
owner = obj.pop('Owner')
self._sanitize_obj_listing(obj)
# one difference seems to be the Owner key
self.assertEqual({'DisplayName', 'ID'}, set(owner.keys()))
self.check_owner(owner)
self._sanitize_obj_listing(obj)
self.assertEqual(expected, objs)
resp = self.client.list_objects_v2(Bucket=self.bucket_name)
objs = resp.get('Contents', [])
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.