[Mellanox] [BMC] Update sonic-platform-common submodule and align UT#25864
[Mellanox] [BMC] Update sonic-platform-common submodule and align UT#25864yxieca wants to merge 2 commits intosonic-net:masterfrom
Conversation
Combines changes from PR sonic-net#25306 and PR sonic-net#25594: - Update sonic-platform-common submodule to latest HEAD (includes new Redfish methods for manual session management) - Align BMC reset_root_password UT for new min password length functionality Signed-off-by: Ying Xie <ying.xie@microsoft.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Updates the Mellanox BMC integration to match recent sonic-platform-common Redfish password policy changes and keeps unit tests aligned with the new behavior.
Changes:
- Bumps
src/sonic-platform-commonsubmodule to a newer commit. - Updates
test_bmc_reset_passwordto mock/get/set Redfish minimum password length during password reset. - Adjusts expected return message and strengthens mock expectations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/sonic-platform-common | Advances the submodule pointer to pull in updated Redfish/password-policy behavior. |
| platform/mellanox/mlnx-platform-api/tests/test_bmc.py | Aligns the BMC password reset unit test with min-password-length get/set flow. |
You can also share your feedback on Copilot code review. Take the survey.
| mock_set_min_length.assert_any_call(8) | ||
| mock_set_min_length.assert_any_call(12) |
There was a problem hiding this comment.
assert_any_call doesn’t verify call order or that there were no extra calls, so this test could pass even if redfish_api_set_min_password_length is called multiple times or in the wrong sequence. Consider asserting the exact call list (and call_count) to ensure the min length is set to 8 before the password change and restored to 12 afterward.
| mock_set_min_length.assert_any_call(8) | |
| mock_set_min_length.assert_any_call(12) | |
| assert mock_set_min_length.call_args_list == [mock.call(8), mock.call(12)] |
There was a problem hiding this comment.
Good catch! Updated to use call_args_list to verify exact call order and count. This ensures min length is set to 8 before the password change and restored to 12 afterward.
Replace assert_any_call with call_args_list to verify exact call order and count for redfish_api_set_min_password_length, ensuring min length is set to 8 before password change and restored to 12. Signed-off-by: Ying Xie <ying.xie@microsoft.com>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@liat-grozovik @benle7 There are some comments from AI review and my agent responded. Please check these diffs. I can roll back to your original change if you prefer. |
Why I did it
This PR combines the changes from #25594 and #25306:
PR [submodule][master] Update submodule sonic-platform-common to the latest HEAD automatically #25594: Update the
sonic-platform-commonsubmodule to the latest HEAD, which includes:PR [Mellanox] [BMC] Reset root password UT alignment #25306: Align/fix the BMC
reset_root_passwordunit test to match the new min password length functionality introduced in sonic-platform-common PR still seeing the snmpd error msg in the syslog #622.These two PRs are interdependent (#25306 depends on #25594) and are combined here for clean integration.
How I did it
src/sonic-platform-commonupdated from43001dfto95666c6platform/mellanox/mlnx-platform-api/tests/test_bmc.pyupdated with new mocks forredfish_api_get_min_password_lengthandredfish_api_set_min_password_lengthHow to verify it
UT execution of
test_bmc.py.Supersedes #25594 and #25306.
Signed-off-by: Ying Xie ying.xie@microsoft.com
Signed-off-by: Ben Levi belevi@nvidia.com