blob: e1615a9cc23c793e184fb9fb2afebc0ae47c2bc3 [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
Jayashree-Dfe793fa2020-07-27 20:26:09 +0530266
267Verify Voltage Sensors Attributes
268 [Documentation] Check voltage sensors attributes.
269 [Tags] Verify_Voltage_Sensor_Attributes
270
271 # Example:
272 # "/xyz/openbmc_project/sensors/voltage/voltage0",
George Keishing16b3c7b2021-01-28 09:23:37 -0600273 # "/xyz/openbmc_project/sensors/voltage/voltage_1",
Jayashree-Dfe793fa2020-07-27 20:26:09 +0530274 # "/xyz/openbmc_project/sensors/voltage/VOLTAGE_2",
275 # "/xyz/openbmc_project/sensors/voltage/VOLTAGE1",
276 # "/xyz/openbmc_project/sensors/voltage/voltage".
277
278 ${voltage}= Get Endpoint Paths /xyz/openbmc_project/sensors/voltage/ *
279
280 # Access the properties of the voltage sensors and it should contain
281 # the following entries:
282 # /xyz/openbmc_project/sensors/voltage/voltage0
283 # {
284 # "MaxValue": 255.0,
285 # "MinValue": 0.0,
286 # "Unit": xyz.openbmc_project.Sensor.Value.Unit.Volts
287 # "Value": 0.0
288 # }
289
290 FOR ${entry} IN @{voltage}
291 ${resp}= OpenBMC Get Request ${entry}
292 ${json}= To JSON ${resp.content}
293 Run Keyword And Ignore Error Should Be Equal As Strings
294 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
295 Run Keyword And Ignore Error Should Be True ${json["data"]["Value"]} >= 0
296 END
297
298
299Verify Current Sensors Attributes
300 [Documentation] Check current sensors attributes.
301 [Tags] Verify_Current_Sensor_Attributes
302
303 # Example:
304 # "/xyz/openbmc_project/sensors/current/current0",
305 # "/xyz/openbmc_project/sensors/current/current_1",
306 # "/xyz/openbmc_project/sensors/current/CURRENT_2",
307 # "/xyz/openbmc_project/sensors/current/CURRENT1",
308 # "/xyz/openbmc_project/sensors/current/current".
309
310 ${current}= Get Endpoint Paths /xyz/openbmc_project/sensors/ curr*
311
312 # Access the properties of the current sensors and it should contain
313 # the following entries:
314 # /xyz/openbmc_project/sensors/current/current0
315 # {
316 # "MaxValue": 255.0,
317 # "MinValue": 0.0,
318 # "Unit": xyz.openbmc_project.Sensor.Value.Unit.Amperes
319 # "Value": 0.0
320 # }
321
322 FOR ${entry} IN @{current}
323 ${resp}= OpenBMC Get Request ${entry}
324 ${json}= To JSON ${resp.content}
325 Run Keyword And Ignore Error Should Be Equal As Strings
326 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Amperes
327 Should Be True ${json["data"]["Value"]} >= 0
328 END
329
330
Steven Sombareabeccf2018-09-06 11:41:12 -0500331Verify Power Redundancy Using REST
332 [Documentation] Verify power redundancy is enabled.
333 [Tags] Verify_Power_Redundancy_Using_REST
George Keishing8bf8ed72017-12-07 04:01:45 -0600334
335 # Example:
336 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
337 # {
338 # "error": 0,
339 # "units": "",
340 # "value": "Enabled"
341 # }
342
Steven Sombareabeccf2018-09-06 11:41:12 -0500343 # Power Redundancy is a read-only attribute. It cannot be set.
Steven Sombar27c1ad42018-09-11 14:44:25 -0500344
345 # Pass if sensor is in /xyz and it's enabled.
346 ${redundancy_setting}= Read Attribute
347 ... ${OPENBMC_BASE_URI}control/power_supply_redundancy
348 ... PowerSupplyRedundancyEnabled
349 Should Be Equal As Integers ${redundancy_setting} ${1}
350 ... msg=PowerSupplyRedundancyEnabled not set as expected.
George Keishing8bf8ed72017-12-07 04:01:45 -0600351
352
Steven Sombareabeccf2018-09-06 11:41:12 -0500353Verify Power Redundancy Using IPMI
Steven Sombar27c1ad42018-09-11 14:44:25 -0500354 [Documentation] Verify IPMI reports Power Redundancy is enabled.
Steven Sombareabeccf2018-09-06 11:41:12 -0500355 [Tags] Verify_Power_Redundancy_Using_IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600356
357 # Refer to data/ipmi_raw_cmd_table.py for command definition.
Steven Sombareabeccf2018-09-06 11:41:12 -0500358 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishingdcf746b2018-02-06 12:43:44 -0600359
360 ${output}= Run IPMI Standard Command
361 ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
362
Steven Sombar27c1ad42018-09-11 14:44:25 -0500363 ${scanning}= Set Variable
364 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]}
365 ${no_scanning}= Set Variable
George Keishingdcf746b2018-02-06 12:43:44 -0600366 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
Steven Sombar27c1ad42018-09-11 14:44:25 -0500367
368 ${enabled_scanning}= Evaluate $scanning in $output
369 ${enabled_no_scanning}= Evaluate $no_scanning in $output
370
371 # Either enabled_scanning or enabled_noscanning should be True.
372 Should Be True ${enabled_scanning} or ${enabled_no_scanning}
373 ... msg=Failed IPMI power redundancy check, result=${output}.
George Keishingdcf746b2018-02-06 12:43:44 -0600374
375
George Keishing06572472017-09-01 11:33:01 -0500376*** Keywords ***
377
George Keishing8bf8ed72017-12-07 04:01:45 -0600378Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500379 [Documentation] Do the initial test suite setup.
380 # - Power off.
381 # - Boot Host.
382 REST Power Off stack_mode=skip
383 REST Power On
384
George Keishing8bf8ed72017-12-07 04:01:45 -0600385Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500386 [Documentation] Do the post test teardown.
387 # - Capture FFDC on test failure.
388 # - Delete error logs.
389 # - Close all open SSH connections.
390
George Keishing8bf8ed72017-12-07 04:01:45 -0600391 FFDC On Test Case Fail
George Keishing32fe4e12018-07-13 05:06:47 -0500392 Delete All Error Logs
George Keishing8bf8ed72017-12-07 04:01:45 -0600393 Close All Connections