Skip to content

[BMC] Align get_presence for the new infra#685

Open
benle7 wants to merge 1 commit into
sonic-net:masterfrom
benle7:host_bmc_communication
Open

[BMC] Align get_presence for the new infra#685
benle7 wants to merge 1 commit into
sonic-net:masterfrom
benle7:host_bmc_communication

Conversation

@benle7
Copy link
Copy Markdown
Contributor

@benle7 benle7 commented Jun 2, 2026

Description

  • Updated sonic_platform_base/bmc_base.py to check:
    • device_info.is_switch_host()
    • device_info.get_bmc_data()
  • Removed the older bmc_addr-only presence condition.
  • Updated tests/bmc_base_test.py to match the new behavior:
    • present on Switch-Host with bmc data
    • not present when bmc data is missing
    • not present on non-host even if bmc data exists

Motivation and Context

BMCBase.get_presence() was aligned with the new host/BMC split (sonic-net/sonic-buildimage#26544)
so BMC presence is reported only for Switch-Host platforms with runtime BMC data.
This avoids treating Switch-BMC side execution as BMC-present for host-only logic.

How Has This Been Tested?

  • Run unit tests:
    • pytest tests/bmc_base_test.py
  • Validate platform API behavior manually:
    • bmc.get_presence() returns True only on Switch-Host with valid /etc/sonic/bmc.json
    • returns False on Switch-BMC side or when BMC data is unavailable

Additional Information (Optional)

Signed-off-by: Ben Levi <belevi@nvidia.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants