-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning/critical thresholds for PSU power (#304)
Add warning/critical thresholds for PSU power Signed-off-by: Stephen Sun <stephens@nvidia.com>
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from sonic_platform_base.psu_base import PsuBase | ||
|
||
class TestPsuBase: | ||
|
||
def test_psu_base(self): | ||
psu = PsuBase() | ||
not_implemented_methods = [ | ||
psu.get_voltage, | ||
psu.get_current, | ||
psu.get_power, | ||
psu.get_powergood_status, | ||
psu.get_temperature, | ||
psu.get_temperature_high_threshold, | ||
psu.get_voltage_high_threshold, | ||
psu.get_voltage_low_threshold, | ||
psu.get_maximum_supplied_power, | ||
psu.get_psu_power_warning_suppress_threshold, | ||
psu.get_psu_power_critical_threshold, | ||
psu.get_input_voltage, | ||
psu.get_input_current] | ||
|
||
for method in not_implemented_methods: | ||
exception_raised = False | ||
try: | ||
method() | ||
except NotImplementedError: | ||
exception_raised = True | ||
|
||
assert exception_raised |