Skip to content

[action] [PR:23219] Fetch leak sensors data from platform.json in test_liquid_cooling_leakage.py#23233

Merged
mssonicbld merged 1 commit intosonic-net:202511from
mssonicbld:cherry/202511/23219
Mar 24, 2026
Merged

[action] [PR:23219] Fetch leak sensors data from platform.json in test_liquid_cooling_leakage.py#23233
mssonicbld merged 1 commit intosonic-net:202511from
mssonicbld:cherry/202511/23219

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

Description of PR

Summary:
Fixes #23218

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
  • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

According to the test plan HLD the number of leak sensors should be defined in the platform.json for the respective SKU. Instead of using mellanox specific APIs to fetch this data we should be using the duthost facts data structure which is populated using the platform.json file across all vendors.

How did you do it?

Replaced platform specific mellanox calls with generic duthost.facts.get calls

Gate the test on platform.json / DUT facts (e.g., presence of leak_sensors.number), which is platform-agnostic and consistent with the intended design:

 self.leak_sensors_num = duthost.facts.get("leak_sensors", {}).get("number")
 if self.leak_sensors_num is None:
 pytest.skip("Platform does not declare liquid cooling support in platform.json")

This allows any vendor that correctly implements the SONiC platform API for liquid cooling to be covered by the test.

How did you verify/test it?

Ran the test on a Arista SKU to make sure the tests were skipped.

============================================ short test summary info ============================================
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:34: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:45: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:56: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:62: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:70: No liquid cooling system supported on this platform
================================= 5 skipped, 187 warnings in 156.15s (0:02:36) ==================================

Any platform specific information?

Supported testbed topology if it's a new test case?

This is a newly added test case.

Documentation

https://github.com/sonic-net/sonic-mgmt/blob/master/docs/testplan/bmc/Liquid-Cooling-leakage-detection-test-plan.md#test-case-7-platfform-api-get_num_leak_sensors

…kage.py (sonic-net#23219)

Approach
What is the motivation for this PR?
According to the test plan HLD the number of leak sensors should be defined in the platform.json for the respective SKU. Instead of using mellanox specific APIs to fetch this data we should be using the duthost facts data structure which is populated using the platform.json file across all vendors.

How did you do it?
Replaced platform specific mellanox calls with generic duthost.facts.get calls

Gate the test on platform.json / DUT facts (e.g., presence of leak_sensors.number), which is platform-agnostic and consistent with the intended design:

  self.leak_sensors_num = duthost.facts.get("leak_sensors", {}).get("number")
  if self.leak_sensors_num is None:
      pytest.skip("Platform does not declare liquid cooling support in platform.json")
This allows any vendor that correctly implements the SONiC platform API for liquid cooling to be covered by the test.

How did you verify/test it?
Ran the test on a Arista SKU to make sure the tests were skipped.

============================================ short test summary info ============================================
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:34: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:45: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:56: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:62: No liquid cooling system supported on this platform
SKIPPED [1] platform_tests/api/test_liquid_cooling_leakage.py:70: No liquid cooling system supported on this platform
================================= 5 skipped, 187 warnings in 156.15s (0:02:36) ==================================

Signed-off-by: arista-hpandya <[email protected]>
Signed-off-by: mssonicbld <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #23219

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit bfbc1ec into sonic-net:202511 Mar 24, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants