Skip to content

Commit daec57d

Browse files
ashwnsrisreejithsreekumaran
authored andcommitted
Modified ssdhealth test to account for currently supported disk types (sonic-net#14071)
* Modified ssdhealth test to account for currently supported disk types * Print unsupported storage disk type before skipping test
1 parent 9d3d495 commit daec57d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/platform_tests/cli/test_show_platform.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,15 @@ def test_show_platform_ssdhealth(duthosts, enum_supervisor_dut_hostname):
447447
"""
448448
duthost = duthosts[enum_supervisor_dut_hostname]
449449
cmd = " ".join([CMD_SHOW_PLATFORM, "ssdhealth"])
450+
supported_disks = ["SATA", "NVME"]
450451

451452
logging.info("Verifying output of '{}' on ''{}'...".format(cmd, duthost.hostname))
453+
452454
ssdhealth_output_lines = duthost.command(cmd)["stdout_lines"]
455+
if not any(disk_type in ssdhealth_output_lines[0] for disk_type in supported_disks):
456+
pytest.skip("Disk Type {} is not supported".format(ssdhealth_output_lines[0].split(':')[-1]))
453457
ssdhealth_dict = util.parse_colon_speparated_lines(ssdhealth_output_lines)
454-
expected_fields = {"Device Model", "Health", "Temperature"}
458+
expected_fields = {"Disk Type", "Device Model", "Health", "Temperature"}
455459
actual_fields = set(ssdhealth_dict.keys())
456460

457461
missing_fields = expected_fields - actual_fields

0 commit comments

Comments
 (0)