Skip to content

[Mellanox] [BMC] Update sonic-platform-common submodule and align UT#25864

Open
yxieca wants to merge 2 commits intosonic-net:masterfrom
yxieca:combine/bmc-ut-and-platform-common-submodule
Open

[Mellanox] [BMC] Update sonic-platform-common submodule and align UT#25864
yxieca wants to merge 2 commits intosonic-net:masterfrom
yxieca:combine/bmc-ut-and-platform-common-submodule

Conversation

@yxieca
Copy link
Contributor

@yxieca yxieca commented Mar 3, 2026

Why I did it

This PR combines the changes from #25594 and #25306:

  1. PR [submodule][master] Update submodule sonic-platform-common to the latest HEAD automatically #25594: Update the sonic-platform-common submodule to the latest HEAD, which includes:

  2. PR [Mellanox] [BMC] Reset root password UT alignment #25306: Align/fix the BMC reset_root_password unit 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

  • Cherry-picked changes from both PRs onto the latest master
  • Submodule src/sonic-platform-common updated from 43001df to 95666c6
  • Test file platform/mellanox/mlnx-platform-api/tests/test_bmc.py updated with new mocks for redfish_api_get_min_password_length and redfish_api_set_min_password_length

How 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

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>
Copilot AI review requested due to automatic review settings March 3, 2026 22:53
@yxieca yxieca requested a review from lguohan as a code owner March 3, 2026 22:53
@yxieca
Copy link
Contributor Author

yxieca commented Mar 3, 2026

Note: This PR was created by an AI agent (sonic-image) on behalf of @yxieca. It combines changes from #25594 and #25306 which are interdependent.

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-common submodule to a newer commit.
  • Updates test_bmc_reset_password to 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.

Comment on lines +97 to +98
mock_set_min_length.assert_any_call(8)
mock_set_min_length.assert_any_call(12)
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)]

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca-admin
Copy link

@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.

Copy link
Contributor

@benle7 benle7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants