Merge pull request #616 from ceph/wip-alimasa-sns-cross-tenant

RGW | BucketNotification: fix test to expect authorization failure

Reviewed-by: yuvalif<ylifshit@redhat.com>
This commit is contained in:
Ali Masarwa 2025-02-07 09:19:48 +02:00 committed by GitHub
commit 7a1aa1b422
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,14 +85,16 @@ def test_cross_account_topic(sns, sns_alt):
name = get_new_topic_name()
arn = sns.create_topic(Name=name)['TopicArn']
# not visible to any alt user apis
with pytest.raises(sns.exceptions.NotFoundException):
# not authorized to any alt user apis
with pytest.raises(sns.exceptions.AuthorizationErrorException):
sns_alt.get_topic_attributes(TopicArn=arn)
with pytest.raises(sns.exceptions.NotFoundException):
with pytest.raises(sns.exceptions.AuthorizationErrorException):
sns_alt.set_topic_attributes(TopicArn=arn, AttributeName='Policy', AttributeValue='')
with pytest.raises(sns.exceptions.AuthorizationErrorException):
sns_alt.delete_topic(TopicArn=arn)
# delete returns success
sns_alt.delete_topic(TopicArn=arn)
sns.delete_topic(TopicArn=arn)
response = sns_alt.list_topics()
assert arn not in [p['TopicArn'] for p in response['Topics']]