Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

bucket-logging: test for log record fields - #667

Merged
yuvalif merged 2 commits into
ceph:masterfrom
nbalacha:wip-nbalacha-71730
Jul 16, 2025
Merged

yuvalif merged 2 commits into
ceph:masterfrom
nbalacha:wip-nbalacha-71730

Conversation

@nbalacha

@nbalacha nbalacha commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

Tests that the AclRequired field is set correctly in the bucket logging record.

@nbalacha
nbalacha requested a review from yuvalif July 1, 2025 12:42
Comment thread s3tests_boto3/functional/test_s3.py Outdated
@pytest.mark.bucket_logging
@pytest.mark.fails_on_aws
def test_bucket_logging_acl_required():
_bucket_logging_acl_required()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you donr parameterize the test, you probably can just implement it here, and dont need a helper function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread s3tests_boto3/functional/test_s3.py Outdated
key = 'my-test-object'
_set_log_bucket_policy(client, log_bucket_name, [src_bucket_name], [prefix])

#client.put_bucket_acl(Bucket=src_bucket_name, ACL='public-read')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why not ACL at bucket level?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Read ACL at the bucket level allows the grantee to list the objects in the bucket. To actually download the object, the ACL is required to be set at the object level.

Comment thread s3tests_boto3/functional/test_s3.py Outdated
logger.info('bucket log record: %s', json.dumps(parsed_record, indent=4))
if bucket_name in record and event_type in record and object_key in record:
if field_name in parsed_record:
val = parsed_record[field_name]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should probably wrap that with try/except of KeyError in case that the field name does not exist

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@nbalacha
nbalacha force-pushed the wip-nbalacha-71730 branch from 73eb35e to bd5d087 Compare July 2, 2025 04:41
@nbalacha
nbalacha requested a review from yuvalif July 2, 2025 04:42
@nbalacha
nbalacha force-pushed the wip-nbalacha-71730 branch from 2c0043b to 28fd484 Compare July 3, 2025 10:13
@nbalacha
nbalacha requested a review from yuvalif July 3, 2025 10:34
nbalacha added 2 commits July 3, 2025 16:06
Tests that the AclRequired field is set correctly in the bucket logging record.

Signed-off-by: N Balachandran <[email protected]>
Fixes typo in function name.

Signed-off-by: N Balachandran <[email protected]>
@nbalacha

nbalacha commented Jul 16, 2025 •

Copy link
Copy Markdown
Contributor Author

@yuvalif
yuvalif merged commit 7bb51cd into ceph:master Jul 16, 2025
@nbalacha
nbalacha deleted the wip-nbalacha-71730 branch January 7, 2026 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants