From a26cd28d7ac1a4e7db31db74e379c65b61ed04ad Mon Sep 17 00:00:00 2001 From: pdivyagowri Date: Mon, 3 Feb 2025 16:53:14 +0530 Subject: [PATCH] Added printing of log lines at OSD booting Signed-off-by: pdivyagowri --- tests/rados/test_bluestore_min_alloc_size.py | 32 ++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tests/rados/test_bluestore_min_alloc_size.py b/tests/rados/test_bluestore_min_alloc_size.py index 4d20901f7c1..9118ed35ea6 100644 --- a/tests/rados/test_bluestore_min_alloc_size.py +++ b/tests/rados/test_bluestore_min_alloc_size.py @@ -225,12 +225,38 @@ def remove_osd_check_metadata(target_osd, alloc_size): # Adding the removed OSD back and checking the cluster status + start_time, _ = test_host.exec_command( + cmd="sudo date '+%Y-%m-%d %H:%M:%S'" + ) + log.debug("Adding the removed OSD back and checking the cluster status") utils.add_osd(ceph_cluster, test_host.hostname, dev_path, target_osd) method_should_succeed( wait_for_device_rados, test_host, target_osd, action="add" ) time.sleep(30) + + end_time, _ = test_host.exec_command( + cmd="sudo date '+%Y-%m-%d %H:%M:%S'" + ) + + log_veri = rados_obj.get_journalctl_log( + start_time=start_time, + end_time=end_time, + daemon_type="osd", + daemon_id=target_osd, + ) + log.debug(f"The log lines for the OSD: {target_osd} is :{log_veri}") + + # If _open_super_meta min_alloc_size is found in the logs, print the log lines + if f"_open_super_meta min_alloc_size {hex(4096)}" in log_veri: + log.info( + f"Found '_open_super_meta min_alloc_size {hex(4096)}' in the logs for OSD {target_osd}" + ) + else: + log.error( + f"Error: '_open_super_meta min_alloc_size' not found in the logs for OSD {target_osd}" + ) log.debug( "Completed addition of OSD post removal. Checking bluestore_min_alloc_size value post OSD addition" ) @@ -267,12 +293,12 @@ def remove_osd_check_metadata(target_osd, alloc_size): show_config_hdd = int( mon_obj.show_config( - daemon="osd", id=osd_id, param="bluestore_min_alloc_size_hdd" + daemon="osd", id=rm_osd, param="bluestore_min_alloc_size_hdd" ) ) show_config_ssd = int( mon_obj.show_config( - daemon="osd", id=osd_id, param="bluestore_min_alloc_size_ssd" + daemon="osd", id=rm_osd, param="bluestore_min_alloc_size_ssd" ) ) @@ -288,7 +314,7 @@ def remove_osd_check_metadata(target_osd, alloc_size): # determine osd's block device path json_out = mon_obj.daemon_config_show( - daemon_type="osd", daemon_id=osd_id + daemon_type="osd", daemon_id=rm_osd ) daemon_alloc_size_hdd = int(json_out["bluestore_min_alloc_size_hdd"])