From 39100805ab26cae382dacc12b53654d8c7b5c6d5 Mon Sep 17 00:00:00 2001 From: Ashwin Srinivasan Date: Sun, 11 Aug 2024 03:05:21 +0000 Subject: [PATCH 1/2] Modified ssdhealth test to account for currently supported disk types --- tests/platform_tests/cli/test_show_platform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/platform_tests/cli/test_show_platform.py b/tests/platform_tests/cli/test_show_platform.py index f4ecbbc580..fe17f7988b 100644 --- a/tests/platform_tests/cli/test_show_platform.py +++ b/tests/platform_tests/cli/test_show_platform.py @@ -447,11 +447,15 @@ def test_show_platform_ssdhealth(duthosts, enum_supervisor_dut_hostname): """ duthost = duthosts[enum_supervisor_dut_hostname] cmd = " ".join([CMD_SHOW_PLATFORM, "ssdhealth"]) + supported_disks = ["SATA", "NVME"] logging.info("Verifying output of '{}' on ''{}'...".format(cmd, duthost.hostname)) + ssdhealth_output_lines = duthost.command(cmd)["stdout_lines"] + if not any(disk_type in ssdhealth_output_lines[0] for disk_type in supported_disks): + pytest.skip("Disk Type is not supported") ssdhealth_dict = util.parse_colon_speparated_lines(ssdhealth_output_lines) - expected_fields = {"Device Model", "Health", "Temperature"} + expected_fields = {"Disk Type", "Device Model", "Health", "Temperature"} actual_fields = set(ssdhealth_dict.keys()) missing_fields = expected_fields - actual_fields From a821ad0a084f133807b0a68e32bcbe65b55d3f22 Mon Sep 17 00:00:00 2001 From: Ashwin Srinivasan Date: Mon, 28 Oct 2024 19:23:45 +0000 Subject: [PATCH 2/2] Print unsupported storage disk type before skipping test --- tests/platform_tests/cli/test_show_platform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/platform_tests/cli/test_show_platform.py b/tests/platform_tests/cli/test_show_platform.py index fe17f7988b..741878c332 100644 --- a/tests/platform_tests/cli/test_show_platform.py +++ b/tests/platform_tests/cli/test_show_platform.py @@ -453,7 +453,7 @@ def test_show_platform_ssdhealth(duthosts, enum_supervisor_dut_hostname): ssdhealth_output_lines = duthost.command(cmd)["stdout_lines"] if not any(disk_type in ssdhealth_output_lines[0] for disk_type in supported_disks): - pytest.skip("Disk Type is not supported") + pytest.skip("Disk Type {} is not supported".format(ssdhealth_output_lines[0].split(':')[-1])) ssdhealth_dict = util.parse_colon_speparated_lines(ssdhealth_output_lines) expected_fields = {"Disk Type", "Device Model", "Health", "Temperature"} actual_fields = set(ssdhealth_dict.keys())