Skip to content

Commit

Permalink
instead of using hardcoded disk, let ssdutil to determine the default…
Browse files Browse the repository at this point in the history
… disk device
  • Loading branch information
sujinmkang committed Dec 7, 2021
1 parent f49d712 commit d69237a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/platform_tests/cli/test_show_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,13 @@ def test_show_platform_ssdhealth(duthosts, enum_supervisor_dut_hostname):
@summary: Verify output of `show platform ssdhealth`
"""
duthost = duthosts[enum_supervisor_dut_hostname]
cmd = "cat /sys/block/sda/queue/rotational"
ssdcheck_output_lines = duthost.command(cmd)["stdout_lines"]
if '0' not in ssdcheck_output_lines:
pytest.skip("Disk type is not SSD")

cmd = " ".join([CMD_SHOW_PLATFORM, "ssdhealth"])

logging.info("Verifying output of '{}' on ''{}'...".format(cmd, duthost.hostname))
ssdhealth_output_lines = duthost.command(cmd)["stdout_lines"]
if 'not SSD' in ssdcheck_output_lines:
pytest.skip("Disk type is not SSD")

ssdhealth_dict = util.parse_colon_speparated_lines(ssdhealth_output_lines)
expected_fields = set(["Device Model", "Health", "Temperature"])
actual_fields = set(ssdhealth_dict.keys())
Expand Down

0 comments on commit d69237a

Please sign in to comment.