]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw/notifications: also verify bucket notifications are updated correctly 59441/head
authorOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 28 Aug 2024 19:56:36 +0000 (15:56 -0400)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 28 Aug 2024 20:09:33 +0000 (16:09 -0400)
Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
src/test/rgw/bucket_notification/test_bn.py

index 203f16a5c31ee3a29a882d4d33a5d0f132218a6a..642ab6955a416707321e24027a1bed880a156095 100644 (file)
@@ -5571,6 +5571,7 @@ def test_topic_migration_to_an_account():
         )
         _, status = s3_notification_conf1.set_config()
         assert_equal(status / 100, 2)
+        # verify subscriptions to the account topic
         rgw_topic_entry = [
             t
             for t in list_topics(tenant=account_id)["topics"]
@@ -5581,6 +5582,11 @@ def test_topic_migration_to_an_account():
         assert_equal(len(subscribed_buckets), 1)
         assert_in(user1_bucket_name, subscribed_buckets)
         assert_not_in(user2_bucket_name, subscribed_buckets)
+        # verify bucket notifications while 2 test buckets are in the mixed mode
+        notification_list = list_notifications(user1_bucket_name, assert_len=1)
+        assert_equal(notification_list["notifications"][0]["TopicArn"], account_topic_arn)
+        notification_list = list_notifications(user2_bucket_name, assert_len=1)
+        assert_equal(notification_list["notifications"][0]["TopicArn"], topic_arn)
 
         # verify both topics are functional at the same time with no duplicate notifications
         user1_bucket.new_key("user1obj1").set_contents_from_string("object content")
@@ -5614,6 +5620,11 @@ def test_topic_migration_to_an_account():
         assert_equal(len(subscribed_buckets), 2)
         assert_in(user1_bucket_name, subscribed_buckets)
         assert_in(user2_bucket_name, subscribed_buckets)
+        # verify bucket notifications after 2 test buckets are updated to use the account topic
+        notification_list = list_notifications(user1_bucket_name, assert_len=1)
+        assert_equal(notification_list["notifications"][0]["TopicArn"], account_topic_arn)
+        notification_list = list_notifications(user2_bucket_name, assert_len=1)
+        assert_equal(notification_list["notifications"][0]["TopicArn"], account_topic_arn)
 
         # finally, make sure that notifications are going thru via the new account topic
         user1_bucket.new_key("user1obj1").set_contents_from_string("object content")