Skip to content

Commit 9a2c915

Browse files
committed
test/rgw/notifications: also verify bucket notifications are updated correctly
Signed-off-by: Oguzhan Ozmen <[email protected]>
1 parent 053e704 commit 9a2c915

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test/rgw/bucket_notification/test_bn.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5571,6 +5571,7 @@ def test_topic_migration_to_an_account():
55715571
)
55725572
_, status = s3_notification_conf1.set_config()
55735573
assert_equal(status / 100, 2)
5574+
# verify subscriptions to the account topic
55745575
rgw_topic_entry = [
55755576
t
55765577
for t in list_topics(tenant=account_id)["topics"]
@@ -5581,6 +5582,11 @@ def test_topic_migration_to_an_account():
55815582
assert_equal(len(subscribed_buckets), 1)
55825583
assert_in(user1_bucket_name, subscribed_buckets)
55835584
assert_not_in(user2_bucket_name, subscribed_buckets)
5585+
# verify bucket notifications while 2 test buckets are in the mixed mode
5586+
notification_list = list_notifications(user1_bucket_name, assert_len=1)
5587+
assert_equal(notification_list["notifications"][0]["TopicArn"], account_topic_arn)
5588+
notification_list = list_notifications(user2_bucket_name, assert_len=1)
5589+
assert_equal(notification_list["notifications"][0]["TopicArn"], topic_arn)
55845590

55855591
# verify both topics are functional at the same time with no duplicate notifications
55865592
user1_bucket.new_key("user1obj1").set_contents_from_string("object content")
@@ -5614,6 +5620,11 @@ def test_topic_migration_to_an_account():
56145620
assert_equal(len(subscribed_buckets), 2)
56155621
assert_in(user1_bucket_name, subscribed_buckets)
56165622
assert_in(user2_bucket_name, subscribed_buckets)
5623+
# verify bucket notifications after 2 test buckets are updated to use the account topic
5624+
notification_list = list_notifications(user1_bucket_name, assert_len=1)
5625+
assert_equal(notification_list["notifications"][0]["TopicArn"], account_topic_arn)
5626+
notification_list = list_notifications(user2_bucket_name, assert_len=1)
5627+
assert_equal(notification_list["notifications"][0]["TopicArn"], account_topic_arn)
56175628

56185629
# finally, make sure that notifications are going thru via the new account topic
56195630
user1_bucket.new_key("user1obj1").set_contents_from_string("object content")

0 commit comments

Comments
 (0)