Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Serial Number check test case. #11092

Merged
Merged
Changes from 1 commit
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
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 @@ -96,6 +96,21 @@ def test_show_platform_summary(duthosts, enum_rand_one_per_hwsku_hostname, dut_v
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"
logging.info("Verifying output of '{}' on '{}' ...".format(cmd, duthost.hostname))
get_serial_no_cmd = duthost.command(cmd)
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))
xincunli-sonic marked this conversation as resolved.
Show resolved Hide resolved


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