From 016c561d68ad17ce2e0da2295999acb494103eb2 Mon Sep 17 00:00:00 2001 From: Mahesh Shetty Date: Wed, 24 Apr 2024 15:13:53 +0530 Subject: [PATCH] add more code Signed-off-by: Mahesh Shetty --- .../object/mcg/test_write_to_bucket.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/functional/object/mcg/test_write_to_bucket.py b/tests/functional/object/mcg/test_write_to_bucket.py index 6b121584cccc..35e468154bc6 100644 --- a/tests/functional/object/mcg/test_write_to_bucket.py +++ b/tests/functional/object/mcg/test_write_to_bucket.py @@ -462,6 +462,7 @@ def test_content_encoding_with_write( @bugzilla("2259189") @bugzilla("2264480") + @pytest.mark.polarion_id("OCS-5773") def test_nb_db_activity_logs_on_io( self, bucket_factory, awscli_pod_session, mcg_obj ): @@ -477,9 +478,6 @@ def test_nb_db_activity_logs_on_io( full_objectpath = f"s3://{bucket.name}" logger.info("successfully created bucket") - objs_uploaded = awscli_pod_session.exec_cmd_on_pod( - f"ls -A1 {AWSCLI_TEST_OBJ_DIR}" - ).split(" ") sync_object_directory( awscli_pod_session, AWSCLI_TEST_OBJ_DIR, full_objectpath, mcg_obj ) @@ -488,12 +486,15 @@ def test_nb_db_activity_logs_on_io( rm_object_recursive(awscli_pod_session, bucket.name, mcg_obj) logger.info("deleted all the objects from the bucket") - nb_activitylogs = exec_nb_db_query("SELECT * FROM activitylogs;") - for obj in objs_uploaded: - assert ( - f"{obj} was uploaded" not in nb_activitylogs - ), "Object upload info is being logged in activitylogs table" + nb_activitylogs = exec_nb_db_query("SELECT data ->> 'event' FROM activitylogs;") + logger.info("successfully fetched noobaa db activitylogs data") + assert "obj.uploaded" not in str( + nb_activitylogs + ), "Object upload event is being logged in activitylogs table" + assert "obj.deleted" not in str( + nb_activitylogs + ), "Object deletion event is being logged in activitylogs table" logger.info( "No object upload/deletion info is being updated in the activitylogs table" )