8000 feat(anta.tests): Added testcase to validate power voltage and state by geetanjalimanegslab · Pull Request #1192 · aristanetworks/anta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(anta.tests): Added testcase to validate power voltage and state #1192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

geetanjalimanegslab
Copy link
Collaborator
@geetanjalimanegslab geetanjalimanegslab commented May 8, 2025

Description

Added testcase to validate power voltage and state

Added test changes: system_hardware_power_supply_voltage_test.py

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have run pre-commit for code linting and typing (pre-commit run)
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes (tox -e testenv)

Copy link
codspeed-hq bot commented May 8, 2025

CodSpeed Performance Report

Merging #1192 will not alter performance

Comparing geetanjalimanegslab:power_voltage (c2bc561) with main (6890d3f)

Summary

✅ 26 untouched benchmarks

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

Copy link

@geetanjalimanegslab geetanjalimanegslab marked this pull request as ready for review May 16, 2025 08:35
@@ -203,12 +203,12 @@ def test(self) -> None:


class VerifyEnvironmentPower(AntaTest):
"""Verifies the power supplies status.
"""Verifies the power supplies status and power voltage details.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Verifies the power supplies status and power voltage details.
"""Verifies the power supplies state and input voltage.


Expected Results
----------------
* Success: The test will pass if the power supplies status are within the accepted states list.
* Failure: The test will fail if some power supplies status is not within the accepted states list.
* Success: The test will pass if the statuses of all power supplies are in the accepted states list and the power voltage matches the expected value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Success: The test will pass if the statuses of all power supplies are in the accepted states list and the power voltage matches the expected value.
* Success: All power supplies are in an accepted state and their input voltage is greater than or equal to `min_input_voltage` (if provided.)

* Success: The test will pass if the power supplies status are within the accepted states list.
* Failure: The test will fail if some power supplies status is not within the accepted states list.
* Success: The test will pass if the statuses of all power supplies are in the accepted states list and the power voltage matches the expected value.
* Failure: The test will fail if the status of any power supply is not in the list of accepted states, or if the power voltage does not match the expected value.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Failure: The test will fail if the status of any power supply is not in the list of accepted states, or if the power voltage does not match the expected value.
* Failure: Any power supply is in an unaccepted state or its input voltage is less than `min_input_voltage` (if provided).

@@ -228,6 +228,8 @@ class Input(AntaTest.Input):

states: list[PowerSupplyStatus]
"""List of accepted states list of power supplies status."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""List of accepted states list of power supplies status."""
"""List of accepted states for power supplies."""

@@ -228,6 +228,8 @@ class Input(AntaTest.Input):

states: list[PowerSupplyStatus]
"""List of accepted states list of power supplies status."""
min_input_voltage: PositiveInteger | None = None
"""Minimum allowed input power voltage."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Minimum allowed input power voltage."""
"""Optional minimum input voltage (Volts) to verify."""

# Verify if the power supply voltage is greater than the minimum input voltage
if self.inputs.min_input_voltage and value["inputVoltage"] < self.inputs.min_input_voltage:
self.result.is_failure(
f"Powersupply: {power_supply} - Input power voltage mismatch - Expected: > {self.inputs.min_input_voltage} Actual: {value['inputVoltage']}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
f"Powersupply: {power_supply} - Input power voltage mismatch - Expected: > {self.inputs.min_input_voltage} Actual: {value['inputVoltage']}"
f"Power Supply: {power_supply} - Input voltage mismatch - Expected: > {self.inputs.min_input_voltage} Actual: {value['inputVoltage']}"

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.

3 participants
0