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

[action] [PR:11092] Add Serial Number check test case. #11522

Merged
merged 1 commit into from
Feb 1, 2024
Merged
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
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
Loading