blob: 51abaeafbcc33c71db570898658035aff123a382 [file] [log] [blame]
Marissa Garza6e3f9ec2019-07-24 15:31:26 -05001*** Settings ***
Marissa Garzad76b1422019-09-13 16:31:54 -05002Documentation Get the system power supply voltage readings.
Marissa Garza6e3f9ec2019-07-24 15:31:26 -05003
4Resource ../../lib/bmc_redfish_resource.robot
5Resource ../../lib/bmc_redfish_utils.robot
6Resource ../../lib/openbmc_ffdc.robot
7Library ../../lib/gen_robot_valid.py
8
9Suite Setup Suite Setup Execution
10Suite Teardown Suite Teardown Execution
11Test Setup Printn
12Test Teardown Test Teardown Execution
13
Igor Kanyukafeb79d62025-10-20 21:24:03 +010014Test Tags Powersupply_Readings
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050015
16*** Test Cases ***
17
18Verify Power Supplies Input Watts
19 [Documentation] Verify there are no invalid power supply input watt records.
20 [Tags] Verify_Power_Supplies_Input_Watts
21 [Template] Verify Watts Record
22
23 # record_type redfish_uri reading_type
Marissa Garza6f7958a2019-08-13 14:58:05 -050024 PowerSupplies ${REDFISH_CHASSIS_POWER_URI} PowerInputWatts
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050025
26
27Verify Power Supplies Input Output Voltages
28 [Documentation] Verify there are no invalid power supply voltage records.
29 [Tags] Verify_Power_Supplies_Input_Output_Voltages
30 [Template] Verify Voltage Records
31
32 # record_type redfish_uri reading_type
Marissa Garza6f7958a2019-08-13 14:58:05 -050033 Voltages ${REDFISH_CHASSIS_POWER_URI} ReadingVolts
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050034
35
Marissa Garzafdee1b02019-09-20 14:52:12 -050036Verify Power Supplies Efficiency Percentage
37 [Documentation] Verify the efficiency percentage is set to correct value.
38 [Tags] Verify_Power_Supplies_Efficiency_Percentage
39
40 # Example output:
41 # records:
42 # [0]:
43 # [@odata.id]: /redfish/v1/Chassis/chassis/Power#/PowerSupplies/0
44 # [EfficiencyPercent]: 90
45 # [IndicatorLED]: Off
46 # [Manufacturer]:
47 # [MemberId]: powersupply0
48 # [Model]: 2B1D
49 # [Name]: powersupply0
50 # [PartNumber]: 01KL779
51 # [PowerInputWatts]: 106.0
52 # [SerialNumber]: 75B1C2
53 # [Status]:
54 # [Health]: OK
55 # [State]: Enabled
56
57 ${records}= Verify Valid Records PowerSupplies ${REDFISH_CHASSIS_POWER_URI} EfficiencyPercent
58 ${efficiency_percentages}= Nested Get EfficiencyPercent ${records}
59 Valid List efficiency_percentages [90]
60
61
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050062*** Keywords ***
63
64Verify Watts Record
65 [Documentation] Verify the power watt records.
66 [Arguments] ${record_type} ${redfish_uri} ${reading_type}
67
68 # Description of Arguments(s):
69 # record_type The sensor record type (e.g. "PowerSupplies")
Marissa Garza6f7958a2019-08-13 14:58:05 -050070 # redfish_uri The power supply URI (e.g. /redfish/v1/Chassis/chassis/Power)
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050071 # reading_type The power watt readings (e.g. "PowerInputWatts")
72
73 Verify Valid Records ${record_type} ${redfish_uri} ${reading_type}
74
75
76Verify Voltage Records
77 [Documentation] Verify the power voltage records.
78 [Arguments] ${record_type} ${redfish_uri} ${reading_type}
79
80 # Description of Arguments(s):
81 # record_type The sensor record type (e.g. "Voltages")
Marissa Garza6f7958a2019-08-13 14:58:05 -050082 # redfish_uri The power supply URI (e.g. /redfish/v1/Chassis/chassis/Power)
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050083 # reading_type The power voltage readings (e.g. "ReadingVolts")
84
85 Verify Valid Records ${record_type} ${redfish_uri} ${reading_type}
86
Marissa Garzad76b1422019-09-13 16:31:54 -050087 ${records}= Redfish.Get Attribute ${redfish_uri} ${record_type}
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050088
Marissa Garza743d5972020-01-24 14:17:52 -060089 ${cmd} Catenate [x for x in ${records}
90 ... if not x['LowerThresholdNonCritical'] <= x['${reading_type}'] <= x['UpperThresholdNonCritical']]
91 ${invalid_records}= Evaluate ${cmd}
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050092
Marissa Garzad76b1422019-09-13 16:31:54 -050093 Valid Length invalid_records max_length=0
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050094
Marissa Garzafdee1b02019-09-20 14:52:12 -050095
Marissa Garza6e3f9ec2019-07-24 15:31:26 -050096Suite Teardown Execution
97 [Documentation] Do the post suite teardown.
98
99 Redfish.Logout
100
101
102Suite Setup Execution
103 [Documentation] Do test case setup tasks.
104
105 Printn
Marissa Garza6f7958a2019-08-13 14:58:05 -0500106 Redfish Power On stack_mode=skip
Marissa Garza6e3f9ec2019-07-24 15:31:26 -0500107 Redfish.Login
108
109
110Test Teardown Execution
111 [Documentation] Do the post test teardown.
112
113 FFDC On Test Case Fail