[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 Mar 24, 2026
Merged
Conversation
…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]>
12 tasks
Collaborator
Author
|
Original PR: #23219 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes #23218
Type of change
Back port request
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.getcallsGate the test on platform.json / DUT facts (e.g., presence of leak_sensors.number), which is platform-agnostic and consistent with the intended design:
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.
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