Skip to content

Commit

Permalink
Add Serial Number check test case. (#11092)
Browse files Browse the repository at this point in the history
* Add Serial Number check test case.
  • Loading branch information
xincunli-sonic authored and mssonicbld committed Feb 1, 2024
1 parent 653e6ed commit f2bd98d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/platform_tests/cli/test_show_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,21 @@ def test_show_platform_summary(duthosts, enum_rand_one_per_hwsku_hostname, dut_v
"Unexpected value of fields, actual={}, expected={} on host '{}'".format(actual_fields_values, expected_fields_values, duthost.hostname))


def test_platform_serial_no(duthosts, enum_rand_one_per_hwsku_hostname, dut_vars):
"""
@summary: Verify device's serial no with output of `sudo decode-syseeprom -s`
"""
duthost = duthosts[enum_rand_one_per_hwsku_hostname]
cmd = "sudo decode-syseeprom -s"
get_serial_no_cmd = duthost.command(cmd)
logging.info("Verifying output of '{}' on '{}' ...".format(get_serial_no_cmd, duthost.hostname))
get_serial_no_output = get_serial_no_cmd["stdout"].replace('\x00', '')
expected_serial_no = dut_vars['serial']
pytest_assert(get_serial_no_output == expected_serial_no,
"Expected serial_no '{}' is not matching with {} in syseeprom on '{}'".
format(expected_serial_no, get_serial_no_output, duthost.hostname))


def test_show_platform_syseeprom(duthosts, enum_rand_one_per_hwsku_hostname, dut_vars):
"""
@summary: Verify output of `show platform syseeprom`
Expand Down

0 comments on commit f2bd98d

Please sign in to comment.