Skip to content

Commit

Permalink
Modified ssdhealth test to account for currently supported disk types (
Browse files Browse the repository at this point in the history
…#14071)

* Modified ssdhealth test to account for currently supported disk types

* Print unsupported storage disk type before skipping test
  • Loading branch information
assrinivasan authored and mssonicbld committed Dec 11, 2024
1 parent f988eb6 commit 01f8450
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/platform_tests/cli/test_show_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,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".format(ssdhealth_output_lines[0].split(':')[-1]))
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
Expand Down

0 comments on commit 01f8450

Please sign in to comment.