Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions tests/platform_tests/cli/test_show_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,6 @@ def test_show_platform_syseeprom(duthost):
pytest_assert(line in syseeprom_output, "Line '{}' was not found in output".format(line))


# TODO: Gather expected data from a platform-specific data file instead of this method
def check_vendor_specific_psustatus(dut, psu_status_line):
"""
@summary: Vendor specific psu status check
"""
if dut.facts["asic_type"] in ["mellanox"]:
from ..mellanox.check_sysfs import check_psu_sysfs

psu_line_pattern = re.compile(r"PSU\s+(\d)+\s+(OK|NOT OK|NOT PRESENT)")
psu_match = psu_line_pattern.match(psu_status_line)
psu_id = psu_match.group(1)
psu_status = psu_match.group(2)

check_psu_sysfs(dut, psu_id, psu_status)


def test_show_platform_psustatus(duthost):
"""
@summary: Verify output of `show platform psustatus`
Expand All @@ -118,7 +102,7 @@ def test_show_platform_psustatus(duthost):
psu_line_pattern = re.compile(r"PSU\s+\d+\s+(OK|NOT OK|NOT PRESENT)")
for line in psu_status_output_lines[2:]:
pytest_assert(psu_line_pattern.match(line), "Unexpected PSU status output: '{}'".format(line))
check_vendor_specific_psustatus(duthost, line)
# TODO: Compare against expected platform-specific output


def verify_show_platform_fan_output(raw_output_lines):
Expand Down
15 changes: 15 additions & 0 deletions tests/platform_tests/test_platform_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ def get_psu_num(dut):
return psu_num


def check_vendor_specific_psustatus(dut, psu_status_line):
"""
@summary: Vendor specific psu status check
"""
if dut.facts["asic_type"] in ["mellanox"]:
from .mellanox.check_sysfs import check_psu_sysfs

psu_line_pattern = re.compile(r"PSU\s+(\d)+\s+(OK|NOT OK|NOT PRESENT)")
psu_match = psu_line_pattern.match(psu_status_line)
psu_id = psu_match.group(1)
psu_status = psu_match.group(2)

check_psu_sysfs(dut, psu_id, psu_status)


def turn_all_psu_on(psu_ctrl):
all_psu_status = psu_ctrl.get_psu_status()
if all_psu_status:
Expand Down