Skip to content

[Platform API][pytest] Add basic tests for PSU class#1817

Merged
sujinmkang merged 11 commits intosonic-net:masterfrom
sujinmkang:test_psu
Jul 7, 2020
Merged

[Platform API][pytest] Add basic tests for PSU class#1817
sujinmkang merged 11 commits intosonic-net:masterfrom
sujinmkang:test_psu

Conversation

@sujinmkang
Copy link
Contributor

@sujinmkang sujinmkang commented Jun 25, 2020

Add a basic test suite for the Psu class of the new platform API, utilizing the platform API HTTP server, including the following functions:

test_fans
test_power
test_temperature
test_led

Example test results summary:

========================================================================== short test summary info ===========================================================================
FAILED platform_tests/api/test_psu.py::TestPsuApi::test_power - Failed: Failed to retrieve the voltage threshold values of PSU 0
FAILED platform_tests/api/test_psu.py::TestPsuApi::test_temperature - Failed: Failed to retrieve temperature of PSU 0
FAILED platform_tests/api/test_psu.py::TestPsuApi::test_led - Failed: Failed to set status_led of PSU 0
==================================================================== 3 failed, 1 passed in 46.80 seconds =====================================================================

This result could be returned when these apis are not implemented yet in the platform api on DUT.

  • get_voltage_high_threshold and get_voltage_low_threshold for test_power.
  • get_temperature for test_temperature.
  • set_status_led for test_led.

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

@sujinmkang: Can you please add more details to the description along with an example test results summary? See #1759 for an example.

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

As comments. Also, please ensure that all pytest_assert() error messages include details such as PSU ID and any seemingly incorrect values where applicable.

@sujinmkang
Copy link
Contributor Author

retest vsimage please

@jleveque jleveque changed the title Add psu platform api test [Platform API][pytest] Add basic tests for PSU class Jun 30, 2020
self.expect(result is True, "Failed to set status_led of PSU {}".format(psu_id))

color_status = psu.get_status_led(platform_api_conn, psu_id)
if self.expect(color_status is not None, "Failed to retrieve status_led of PSU {}".format(psu_id)):
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest to reword message: Failed to retrieve status LED color of PSU {}

Copy link
Contributor

Choose a reason for hiding this comment

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

Please update this message as suggested.

@sujinmkang
Copy link
Contributor Author

retest this please

@sujinmkang sujinmkang merged commit f5dbb94 into sonic-net:master Jul 7, 2020
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
* 2a8957d 2021-09-14 | [202012][sonic-utilities] CLI support for port auto negotiation (sonic-net#1817) (HEAD, origin/202012) [vdahiya12]

Signed-off-by: Guohan Lu <[email protected]>
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