blob: 8fb1676fcafad74390b8839db75a6f755b88a519 [file] [log] [blame]
George Keishing06572472017-09-01 11:33:01 -05001*** Settings ***
Gunnar Mills917ba1a2018-04-08 16:42:12 -05002Documentation Suite to test hardware sensors.
George Keishing06572472017-09-01 11:33:01 -05003
4Resource ../lib/utils.robot
5Resource ../lib/boot_utils.robot
6Resource ../lib/state_manager.robot
7Resource ../lib/openbmc_ffdc.robot
George Keishingdcf746b2018-02-06 12:43:44 -06008Resource ../lib/ipmi_client.robot
9Variables ../data/ipmi_raw_cmd_table.py
George Keishing06572472017-09-01 11:33:01 -050010
George Keishing8bf8ed72017-12-07 04:01:45 -060011Suite Setup Suite Setup Execution
12Test Teardown Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -050013
14*** Test Cases ***
15
Steven Sombareabeccf2018-09-06 11:41:12 -050016
George Keishing06572472017-09-01 11:33:01 -050017Verify System Ambient Temperature
18 [Documentation] Check the ambient sensor temperature.
19 [Tags] Verify_System_Ambient_Temperature
20
21 # Example:
22 # /xyz/openbmc_project/sensors/temperature/ambient
23 # {
24 # "Scale": -3,
25 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
26 # "Value": 25767
27 # }
28
29 ${temp_data}= Read Properties ${SENSORS_URI}temperature/ambient
30 Should Be True ${temp_data["Scale"]} == ${-3}
31 Should Be Equal As Strings
32 ... ${temp_data["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
33 Should Be True ${temp_data["Value"]/1000} <= ${50}
34 ... msg=System working temperature crossed 50 degree celsius.
35
Steven Sombareabeccf2018-09-06 11:41:12 -050036
Sweta Potthuricca07de2017-09-26 06:14:23 -050037Verify Fan Sensors Attributes
38 [Documentation] Check fan attributes.
39 [Tags] Verify_Fan_Sensor_Attributes
George Keishing28f74052020-07-20 09:02:50 -050040
Sweta Potthuricca07de2017-09-26 06:14:23 -050041 # Example:
George Keishing28f74052020-07-20 09:02:50 -050042 # "/xyz/openbmc_project/sensors/fan_tach/fan0_0",
43 # "/xyz/openbmc_project/sensors/fan_tach/fan0_1",
44 # "/xyz/openbmc_project/sensors/fan_tach/fan1_0",
45 # "/xyz/openbmc_project/sensors/fan_tach/fan1_1",
46 # "/xyz/openbmc_project/sensors/fan_tach/fan2_0",
47 # "/xyz/openbmc_project/sensors/fan_tach/fan2_1",
48 # "/xyz/openbmc_project/sensors/fan_tach/fan3_0",
49 # "/xyz/openbmc_project/sensors/fan_tach/fan3_1"
50
Sweta Potthuricca07de2017-09-26 06:14:23 -050051 ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
52
53 # Access the properties of the fan and it should contain
54 # the following entries:
George Keishing28f74052020-07-20 09:02:50 -050055 # /xyz/openbmc_project/sensors/fan_tach/fan0_0
Sweta Potthuricca07de2017-09-26 06:14:23 -050056 # {
George Keishing28f74052020-07-20 09:02:50 -050057 # "Functional": true,
58 # "MaxValue": 0.0,
59 # "MinValue": 0.0,
60 # "Target": 10500,
Sweta Potthuricca07de2017-09-26 06:14:23 -050061 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
George Keishing28f74052020-07-20 09:02:50 -050062 # "Value": 0.0
Sweta Potthuricca07de2017-09-26 06:14:23 -050063 # }
64
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050065 FOR ${entry} IN @{fans}
66 ${resp}= OpenBMC Get Request ${entry}
67 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050068 Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
George Keishing28f74052020-07-20 09:02:50 -050069 Run Keyword And Ignore Error Should Be Equal As Strings
70 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050071 Should Be True ${json["data"]["Value"]} >= 0
72 END
Sweta Potthuricca07de2017-09-26 06:14:23 -050073
74Verify PCIE Sensors Attributes
75 [Documentation] Probe PCIE attributes.
76 [Tags] Verify_PCIE_Sensor_Attributes
77 # Example:
78 # /xyz/openbmc_project/sensors/temperature/pcie
79 ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
80
81 # Access the properties of the PCIE and it should contain
82 # the following entries:
83 # /xyz/openbmc_project/sensors/temperature/pcie
84 # {
85 # "Scale": -3,
86 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
87 # "Value": 29625
88 # }
89
90
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050091 FOR ${entry} IN @{temp_pcie}
92 ${resp}= OpenBMC Get Request ${entry}
93 ${json}= To JSON ${resp.content}
94 Should Be True ${json["data"]["Scale"]} == -3
95 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
96 ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
97 Should Be True ${temp_in_DegreeC} > 0
98 END
Sweta Potthuricca07de2017-09-26 06:14:23 -050099
100
101Verify Rail Voltage Sensors Attributes
102 [Documentation] Check rail voltage attributes.
103 [Tags] Verify_Rail_Voltage_Sensor_Attributes
104 # Example of one of the entries returned by 'Get Endpoint Paths':
105 # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
106 # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
107 ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
108
109 # Example:
110 # Access the properties of the rail voltage and it should contain
111 # the following entries:
112 # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
113 # {
114 # "Scale": -3,
115 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
116 # "Value": 5097
117 # },
118
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500119 FOR ${entry} IN @{temp_rail}
120 ${resp}= OpenBMC Get Request ${entry}
121 ${json}= To JSON ${resp.content}
122 Should Be True ${json["data"]["Scale"]} == -3
123 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
124 ${volts}= Evaluate ${json["data"]["Value"]} / 1000
125 Should Be True ${volts} > 0
126 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500127
128
129Verify VDN Temperature Sensors Attributes
130 [Documentation] Check vdn temperature attributes.
131 [Tags] Verify_VDN_Temperature_Sensors_Attributes
132 # Example of one of the entries returned by 'Get Endpoint Paths':
133 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
134 ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp
135
136 # Example:
137 # Access the properties of the rail voltage and it should contain
138 # the following entries:
139 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
140 # {
141 # "Scale": -3,
142 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
143 # "Value": 3000
144 # }
145
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500146 FOR ${entry} IN @{temp_vdn}
147 ${resp}= OpenBMC Get Request ${entry}
148 ${json}= To JSON ${resp.content}
149 Should Be True ${json["data"]["Scale"]} == -3
150 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
151 ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
152 Should Be True ${vdn_temp} > 0
153 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500154
155Verify VCS Temperature Sensors Attributes
156 [Documentation] Check vcs temperature attributes.
157 [Tags] Verify_VCS_Temperature_Sensors_Attributes
158 # Example of one of the entries returned by 'Get Endpoint Paths':
159 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
160 ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
161
162 # Example:
163 # Access the properties of the rail voltage and it should contain
164 # the following entries:
165 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
166 # {
167 # "Scale": -3,
168 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
169 # "Value": 31000
170 # },
171
172
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500173 FOR ${entry} IN @{temp_vcs}
174 ${resp}= OpenBMC Get Request ${entry}
175 ${json}= To JSON ${resp.content}
176 Should Be True ${json["data"]["Scale"]} == -3
177 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
178 ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
179 Should Be True ${vcs_temp} > 0
180 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500181
182
183Verify VDD Temperature Sensors Attributes
184 [Documentation] Check vdd temperature attributes.
185 [Tags] Verify_VDD_Temperature_Sensors_Attributes
186 # Example of one of the entries returned by 'Get Endpoint Paths':
187 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
188 ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
189
190 # Example:
191 # Access the properties of the rail voltage and it should contain
192 # the following entries:
193 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
194 # {
195 # "Scale": -3,
196 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
197 # "Value": 4000
198 # }
199
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500200 FOR ${entry} IN @{temp_vdd}
201 ${resp}= OpenBMC Get Request ${entry}
202 ${json}= To JSON ${resp.content}
203 Should Be True ${json["data"]["Scale"]} == -3
204 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
205 ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
206 Should Be True ${vdd_temp} > 0
207 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500208
209
210Verify VDDR Temperature Sensors Attributes
211 [Documentation] Check vddr temperature attributes.
212 [Tags] Verify_VDDR_Temperature_Sensors_Attributes
213 # Example of one of the entries returned by 'Get Endpoint Paths':
214 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
215 ${temp_vddr}=
216 ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
217
218 # Example:
219 # Access the properties of the rail voltage and it should contain
220 # the following entries:
221 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
222 # {
223 # "Scale": -3,
224 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
225 # "Value": 4000
226 # }
227
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500228 FOR ${entry} IN @{temp_vddr}
229 ${resp}= OpenBMC Get Request ${entry}
230 ${json}= To JSON ${resp.content}
231 Should Be True ${json["data"]["Scale"]} == -3
232 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
233 ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
234 Should Be True ${vddr_temp} > 0
235 END
George Keishing06572472017-09-01 11:33:01 -0500236
Jayashree-Dea982302020-07-21 16:44:13 +0530237Verify Power Sensors Attributes
238 [Documentation] Check power sensor attributes.
239 [Tags] Verify_Power_Sensor_Attributes
240 # Example:
241 # /xyz/openbmc_project/sensors/power/power_1
242 # /xyz/openbmc_project/sensors/power/power_2
243 # /xyz/openbmc_project/sensors/power/power0
244 # /xyz/openbmc_project/sensors/power/POWER1
245 # /xyz/openbmc_project/sensors/power/POWER_1
246
247 ${power}= Get Endpoint Paths /xyz/openbmc_project/sensors/ power*
248
249 # Access the properties of the power sensors and it should contain
250 # the following entries:
251 # /xyz/openbmc_project/sensors/power/power_1
252 # {
253 # "MaxValue": 255.0,
254 # "MinValue": 0.0,
255 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts",
256 # "Value": 0.0
257 # }
258
259 FOR ${entry} IN @{power}
260 ${resp}= OpenBMC Get Request ${entry}
261 ${json}= To JSON ${resp.content}
262 Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
263 Should Be True ${json["data"]["Value"]} >= 0
264 END
George Keishing8bf8ed72017-12-07 04:01:45 -0600265
Steven Sombareabeccf2018-09-06 11:41:12 -0500266Verify Power Redundancy Using REST
267 [Documentation] Verify power redundancy is enabled.
268 [Tags] Verify_Power_Redundancy_Using_REST
George Keishing8bf8ed72017-12-07 04:01:45 -0600269
270 # Example:
271 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
272 # {
273 # "error": 0,
274 # "units": "",
275 # "value": "Enabled"
276 # }
277
Steven Sombareabeccf2018-09-06 11:41:12 -0500278 # Power Redundancy is a read-only attribute. It cannot be set.
Steven Sombar27c1ad42018-09-11 14:44:25 -0500279
280 # Pass if sensor is in /xyz and it's enabled.
281 ${redundancy_setting}= Read Attribute
282 ... ${OPENBMC_BASE_URI}control/power_supply_redundancy
283 ... PowerSupplyRedundancyEnabled
284 Should Be Equal As Integers ${redundancy_setting} ${1}
285 ... msg=PowerSupplyRedundancyEnabled not set as expected.
George Keishing8bf8ed72017-12-07 04:01:45 -0600286
287
Steven Sombareabeccf2018-09-06 11:41:12 -0500288Verify Power Redundancy Using IPMI
Steven Sombar27c1ad42018-09-11 14:44:25 -0500289 [Documentation] Verify IPMI reports Power Redundancy is enabled.
Steven Sombareabeccf2018-09-06 11:41:12 -0500290 [Tags] Verify_Power_Redundancy_Using_IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600291
292 # Refer to data/ipmi_raw_cmd_table.py for command definition.
Steven Sombareabeccf2018-09-06 11:41:12 -0500293 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishingdcf746b2018-02-06 12:43:44 -0600294
295 ${output}= Run IPMI Standard Command
296 ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
297
Steven Sombar27c1ad42018-09-11 14:44:25 -0500298 ${scanning}= Set Variable
299 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]}
300 ${no_scanning}= Set Variable
George Keishingdcf746b2018-02-06 12:43:44 -0600301 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
Steven Sombar27c1ad42018-09-11 14:44:25 -0500302
303 ${enabled_scanning}= Evaluate $scanning in $output
304 ${enabled_no_scanning}= Evaluate $no_scanning in $output
305
306 # Either enabled_scanning or enabled_noscanning should be True.
307 Should Be True ${enabled_scanning} or ${enabled_no_scanning}
308 ... msg=Failed IPMI power redundancy check, result=${output}.
George Keishingdcf746b2018-02-06 12:43:44 -0600309
310
George Keishing06572472017-09-01 11:33:01 -0500311*** Keywords ***
312
George Keishing8bf8ed72017-12-07 04:01:45 -0600313Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500314 [Documentation] Do the initial test suite setup.
315 # - Power off.
316 # - Boot Host.
317 REST Power Off stack_mode=skip
318 REST Power On
319
George Keishing8bf8ed72017-12-07 04:01:45 -0600320Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500321 [Documentation] Do the post test teardown.
322 # - Capture FFDC on test failure.
323 # - Delete error logs.
324 # - Close all open SSH connections.
325
George Keishing8bf8ed72017-12-07 04:01:45 -0600326 FFDC On Test Case Fail
George Keishing32fe4e12018-07-13 05:06:47 -0500327 Delete All Error Logs
George Keishing8bf8ed72017-12-07 04:01:45 -0600328 Close All Connections