-
Notifications
You must be signed in to change notification settings - Fork 34
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
base: main
Are you sure you want to change the base?
feat(anta.tests): Added testcase to validate power voltage and state #1192
Conversation
CodSpeed Performance ReportMerging #1192 will not alter performanceComparing Summary
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
0f1729f
to
34350b5
Compare
Conflicts have been resolved. A maintainer will review the pull request shortly. |
|
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* 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.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""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.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""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']}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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']}" |
Description
Added testcase to validate power voltage and state
Added test changes: system_hardware_power_supply_voltage_test.py
Checklist:
pre-commit run
)tox -e testenv
)