Skip to content

Commit

Permalink
add more code
Browse files Browse the repository at this point in the history
Signed-off-by: Mahesh Shetty <[email protected]>
  • Loading branch information
mashetty330 committed Apr 24, 2024
1 parent 2378f15 commit 016c561
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/functional/object/mcg/test_write_to_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand All @@ -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
)
Expand All @@ -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"
)

0 comments on commit 016c561

Please sign in to comment.