blob: 90862115c806331b1698e709cb320ddcc9a8a7fc [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 # {
George Keishing06572472017-09-01 11:33:01 -050024 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +030025 # "Value": 25.767
George Keishing06572472017-09-01 11:33:01 -050026 # }
27
28 ${temp_data}= Read Properties ${SENSORS_URI}temperature/ambient
George Keishing06572472017-09-01 11:33:01 -050029 Should Be Equal As Strings
30 ... ${temp_data["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +030031 Should Be True ${temp_data["Value"]} <= ${50}
George Keishing06572472017-09-01 11:33:01 -050032 ... msg=System working temperature crossed 50 degree celsius.
33
Steven Sombareabeccf2018-09-06 11:41:12 -050034
Sweta Potthuricca07de2017-09-26 06:14:23 -050035Verify Fan Sensors Attributes
36 [Documentation] Check fan attributes.
George Keishingac8661e2022-02-10 00:36:12 -060037 [Tags] Verify_Fan_Sensors_Attributes
George Keishing28f74052020-07-20 09:02:50 -050038
Sweta Potthuricca07de2017-09-26 06:14:23 -050039 # Example:
George Keishing28f74052020-07-20 09:02:50 -050040 # "/xyz/openbmc_project/sensors/fan_tach/fan0_0",
41 # "/xyz/openbmc_project/sensors/fan_tach/fan0_1",
42 # "/xyz/openbmc_project/sensors/fan_tach/fan1_0",
43 # "/xyz/openbmc_project/sensors/fan_tach/fan1_1",
44 # "/xyz/openbmc_project/sensors/fan_tach/fan2_0",
45 # "/xyz/openbmc_project/sensors/fan_tach/fan2_1",
46 # "/xyz/openbmc_project/sensors/fan_tach/fan3_0",
47 # "/xyz/openbmc_project/sensors/fan_tach/fan3_1"
48
Sweta Potthuricca07de2017-09-26 06:14:23 -050049 ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
50
51 # Access the properties of the fan and it should contain
52 # the following entries:
George Keishing28f74052020-07-20 09:02:50 -050053 # /xyz/openbmc_project/sensors/fan_tach/fan0_0
Sweta Potthuricca07de2017-09-26 06:14:23 -050054 # {
George Keishing28f74052020-07-20 09:02:50 -050055 # "Functional": true,
56 # "MaxValue": 0.0,
57 # "MinValue": 0.0,
58 # "Target": 10500,
Sweta Potthuricca07de2017-09-26 06:14:23 -050059 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
George Keishing28f74052020-07-20 09:02:50 -050060 # "Value": 0.0
Sweta Potthuricca07de2017-09-26 06:14:23 -050061 # }
62
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050063 FOR ${entry} IN @{fans}
64 ${resp}= OpenBMC Get Request ${entry}
65 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050066 Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
George Keishing28f74052020-07-20 09:02:50 -050067 Run Keyword And Ignore Error Should Be Equal As Strings
68 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050069 Should Be True ${json["data"]["Value"]} >= 0
70 END
Sweta Potthuricca07de2017-09-26 06:14:23 -050071
72Verify PCIE Sensors Attributes
73 [Documentation] Probe PCIE attributes.
George Keishingac8661e2022-02-10 00:36:12 -060074 [Tags] Verify_PCIE_Sensors_Attributes
Sweta Potthuricca07de2017-09-26 06:14:23 -050075 # Example:
76 # /xyz/openbmc_project/sensors/temperature/pcie
77 ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
78
79 # Access the properties of the PCIE and it should contain
80 # the following entries:
81 # /xyz/openbmc_project/sensors/temperature/pcie
82 # {
Sweta Potthuricca07de2017-09-26 06:14:23 -050083 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +030084 # "Value": 29.625
Sweta Potthuricca07de2017-09-26 06:14:23 -050085 # }
86
87
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050088 FOR ${entry} IN @{temp_pcie}
89 ${resp}= OpenBMC Get Request ${entry}
90 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050091 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +030092 Should Be True ${json["data"]["Value"]} > 0
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050093 END
Sweta Potthuricca07de2017-09-26 06:14:23 -050094
95
96Verify Rail Voltage Sensors Attributes
97 [Documentation] Check rail voltage attributes.
George Keishingac8661e2022-02-10 00:36:12 -060098 [Tags] Verify_Rail_Voltage_Sensors_Attributes
Sweta Potthuricca07de2017-09-26 06:14:23 -050099 # Example of one of the entries returned by 'Get Endpoint Paths':
100 # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
101 # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
102 ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
103
104 # Example:
105 # Access the properties of the rail voltage and it should contain
106 # the following entries:
107 # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
108 # {
Sweta Potthuricca07de2017-09-26 06:14:23 -0500109 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300110 # "Value": 5.097
Sweta Potthuricca07de2017-09-26 06:14:23 -0500111 # },
112
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500113 FOR ${entry} IN @{temp_rail}
114 ${resp}= OpenBMC Get Request ${entry}
115 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500116 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300117 Should Be True ${json["data"]["Value"]} > 0
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500118 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500119
120
121Verify VDN Temperature Sensors Attributes
122 [Documentation] Check vdn temperature attributes.
123 [Tags] Verify_VDN_Temperature_Sensors_Attributes
124 # Example of one of the entries returned by 'Get Endpoint Paths':
125 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
126 ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp
127
128 # Example:
129 # Access the properties of the rail voltage and it should contain
130 # the following entries:
131 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
132 # {
Sweta Potthuricca07de2017-09-26 06:14:23 -0500133 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300134 # "Value": 3.000
Sweta Potthuricca07de2017-09-26 06:14:23 -0500135 # }
136
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500137 FOR ${entry} IN @{temp_vdn}
138 ${resp}= OpenBMC Get Request ${entry}
139 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500140 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300141 Should Be True ${json["data"]["Value"]} > 0
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500142 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500143
144Verify VCS Temperature Sensors Attributes
145 [Documentation] Check vcs temperature attributes.
146 [Tags] Verify_VCS_Temperature_Sensors_Attributes
147 # Example of one of the entries returned by 'Get Endpoint Paths':
148 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
149 ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
150
151 # Example:
152 # Access the properties of the rail voltage and it should contain
153 # the following entries:
154 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
155 # {
Sweta Potthuricca07de2017-09-26 06:14:23 -0500156 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300157 # "Value": 31.000
Sweta Potthuricca07de2017-09-26 06:14:23 -0500158 # },
159
160
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500161 FOR ${entry} IN @{temp_vcs}
162 ${resp}= OpenBMC Get Request ${entry}
163 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500164 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300165 Should Be True ${json["data"]["Value"]} > 0
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500166 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500167
168
169Verify VDD Temperature Sensors Attributes
170 [Documentation] Check vdd temperature attributes.
171 [Tags] Verify_VDD_Temperature_Sensors_Attributes
172 # Example of one of the entries returned by 'Get Endpoint Paths':
173 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
174 ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
175
176 # Example:
177 # Access the properties of the rail voltage and it should contain
178 # the following entries:
179 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
180 # {
Sweta Potthuricca07de2017-09-26 06:14:23 -0500181 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300182 # "Value": 4.000
Sweta Potthuricca07de2017-09-26 06:14:23 -0500183 # }
184
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500185 FOR ${entry} IN @{temp_vdd}
186 ${resp}= OpenBMC Get Request ${entry}
187 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500188 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300189 Should Be True ${json["data"]["Value"]} > 0
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500190 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500191
192
193Verify VDDR Temperature Sensors Attributes
194 [Documentation] Check vddr temperature attributes.
195 [Tags] Verify_VDDR_Temperature_Sensors_Attributes
196 # Example of one of the entries returned by 'Get Endpoint Paths':
197 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
198 ${temp_vddr}=
199 ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
200
201 # Example:
202 # Access the properties of the rail voltage and it should contain
203 # the following entries:
204 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
205 # {
Sweta Potthuricca07de2017-09-26 06:14:23 -0500206 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300207 # "Value": 4.000
Sweta Potthuricca07de2017-09-26 06:14:23 -0500208 # }
209
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500210 FOR ${entry} IN @{temp_vddr}
211 ${resp}= OpenBMC Get Request ${entry}
212 ${json}= To JSON ${resp.content}
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500213 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
Konstantin Aladyshev2ac4d4f2021-03-20 23:36:39 +0300214 Should Be True ${json["data"]["Value"]} > 0
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500215 END
George Keishing06572472017-09-01 11:33:01 -0500216
Jayashree-Dea982302020-07-21 16:44:13 +0530217Verify Power Sensors Attributes
218 [Documentation] Check power sensor attributes.
George Keishingac8661e2022-02-10 00:36:12 -0600219 [Tags] Verify_Power_Sensors_Attributes
Jayashree-Dea982302020-07-21 16:44:13 +0530220 # Example:
221 # /xyz/openbmc_project/sensors/power/power_1
222 # /xyz/openbmc_project/sensors/power/power_2
223 # /xyz/openbmc_project/sensors/power/power0
224 # /xyz/openbmc_project/sensors/power/POWER1
225 # /xyz/openbmc_project/sensors/power/POWER_1
226
227 ${power}= Get Endpoint Paths /xyz/openbmc_project/sensors/ power*
228
229 # Access the properties of the power sensors and it should contain
230 # the following entries:
231 # /xyz/openbmc_project/sensors/power/power_1
232 # {
233 # "MaxValue": 255.0,
234 # "MinValue": 0.0,
235 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts",
236 # "Value": 0.0
237 # }
238
239 FOR ${entry} IN @{power}
240 ${resp}= OpenBMC Get Request ${entry}
241 ${json}= To JSON ${resp.content}
242 Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
243 Should Be True ${json["data"]["Value"]} >= 0
244 END
George Keishing8bf8ed72017-12-07 04:01:45 -0600245
Jayashree-Dfe793fa2020-07-27 20:26:09 +0530246
247Verify Voltage Sensors Attributes
248 [Documentation] Check voltage sensors attributes.
George Keishingac8661e2022-02-10 00:36:12 -0600249 [Tags] Verify_Voltage_Sensors_Attributes
Jayashree-Dfe793fa2020-07-27 20:26:09 +0530250
251 # Example:
252 # "/xyz/openbmc_project/sensors/voltage/voltage0",
George Keishing16b3c7b2021-01-28 09:23:37 -0600253 # "/xyz/openbmc_project/sensors/voltage/voltage_1",
Jayashree-Dfe793fa2020-07-27 20:26:09 +0530254 # "/xyz/openbmc_project/sensors/voltage/VOLTAGE_2",
255 # "/xyz/openbmc_project/sensors/voltage/VOLTAGE1",
256 # "/xyz/openbmc_project/sensors/voltage/voltage".
257
258 ${voltage}= Get Endpoint Paths /xyz/openbmc_project/sensors/voltage/ *
259
260 # Access the properties of the voltage sensors and it should contain
261 # the following entries:
262 # /xyz/openbmc_project/sensors/voltage/voltage0
263 # {
264 # "MaxValue": 255.0,
265 # "MinValue": 0.0,
266 # "Unit": xyz.openbmc_project.Sensor.Value.Unit.Volts
267 # "Value": 0.0
268 # }
269
270 FOR ${entry} IN @{voltage}
271 ${resp}= OpenBMC Get Request ${entry}
272 ${json}= To JSON ${resp.content}
273 Run Keyword And Ignore Error Should Be Equal As Strings
274 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
275 Run Keyword And Ignore Error Should Be True ${json["data"]["Value"]} >= 0
276 END
277
278
279Verify Current Sensors Attributes
280 [Documentation] Check current sensors attributes.
George Keishingac8661e2022-02-10 00:36:12 -0600281 [Tags] Verify_Current_Sensors_Attributes
Jayashree-Dfe793fa2020-07-27 20:26:09 +0530282
283 # Example:
284 # "/xyz/openbmc_project/sensors/current/current0",
285 # "/xyz/openbmc_project/sensors/current/current_1",
286 # "/xyz/openbmc_project/sensors/current/CURRENT_2",
287 # "/xyz/openbmc_project/sensors/current/CURRENT1",
288 # "/xyz/openbmc_project/sensors/current/current".
289
290 ${current}= Get Endpoint Paths /xyz/openbmc_project/sensors/ curr*
291
292 # Access the properties of the current sensors and it should contain
293 # the following entries:
294 # /xyz/openbmc_project/sensors/current/current0
295 # {
296 # "MaxValue": 255.0,
297 # "MinValue": 0.0,
298 # "Unit": xyz.openbmc_project.Sensor.Value.Unit.Amperes
299 # "Value": 0.0
300 # }
301
302 FOR ${entry} IN @{current}
303 ${resp}= OpenBMC Get Request ${entry}
304 ${json}= To JSON ${resp.content}
305 Run Keyword And Ignore Error Should Be Equal As Strings
306 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Amperes
307 Should Be True ${json["data"]["Value"]} >= 0
308 END
309
310
Steven Sombareabeccf2018-09-06 11:41:12 -0500311Verify Power Redundancy Using REST
312 [Documentation] Verify power redundancy is enabled.
313 [Tags] Verify_Power_Redundancy_Using_REST
George Keishing8bf8ed72017-12-07 04:01:45 -0600314
315 # Example:
316 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
317 # {
318 # "error": 0,
319 # "units": "",
320 # "value": "Enabled"
321 # }
322
Steven Sombareabeccf2018-09-06 11:41:12 -0500323 # Power Redundancy is a read-only attribute. It cannot be set.
Steven Sombar27c1ad42018-09-11 14:44:25 -0500324
325 # Pass if sensor is in /xyz and it's enabled.
326 ${redundancy_setting}= Read Attribute
327 ... ${OPENBMC_BASE_URI}control/power_supply_redundancy
328 ... PowerSupplyRedundancyEnabled
329 Should Be Equal As Integers ${redundancy_setting} ${1}
330 ... msg=PowerSupplyRedundancyEnabled not set as expected.
George Keishing8bf8ed72017-12-07 04:01:45 -0600331
332
Steven Sombareabeccf2018-09-06 11:41:12 -0500333Verify Power Redundancy Using IPMI
Steven Sombar27c1ad42018-09-11 14:44:25 -0500334 [Documentation] Verify IPMI reports Power Redundancy is enabled.
Steven Sombareabeccf2018-09-06 11:41:12 -0500335 [Tags] Verify_Power_Redundancy_Using_IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600336
337 # Refer to data/ipmi_raw_cmd_table.py for command definition.
Steven Sombareabeccf2018-09-06 11:41:12 -0500338 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishingdcf746b2018-02-06 12:43:44 -0600339
340 ${output}= Run IPMI Standard Command
341 ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
342
Steven Sombar27c1ad42018-09-11 14:44:25 -0500343 ${scanning}= Set Variable
344 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]}
345 ${no_scanning}= Set Variable
George Keishingdcf746b2018-02-06 12:43:44 -0600346 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
Steven Sombar27c1ad42018-09-11 14:44:25 -0500347
348 ${enabled_scanning}= Evaluate $scanning in $output
349 ${enabled_no_scanning}= Evaluate $no_scanning in $output
350
351 # Either enabled_scanning or enabled_noscanning should be True.
352 Should Be True ${enabled_scanning} or ${enabled_no_scanning}
353 ... msg=Failed IPMI power redundancy check, result=${output}.
George Keishingdcf746b2018-02-06 12:43:44 -0600354
355
George Keishing06572472017-09-01 11:33:01 -0500356*** Keywords ***
357
George Keishing8bf8ed72017-12-07 04:01:45 -0600358Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500359 [Documentation] Do the initial test suite setup.
360 # - Power off.
361 # - Boot Host.
362 REST Power Off stack_mode=skip
363 REST Power On
364
George Keishing8bf8ed72017-12-07 04:01:45 -0600365Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500366 [Documentation] Do the post test teardown.
367 # - Capture FFDC on test failure.
368 # - Delete error logs.
369 # - Close all open SSH connections.
370
George Keishing8bf8ed72017-12-07 04:01:45 -0600371 FFDC On Test Case Fail
George Keishing32fe4e12018-07-13 05:06:47 -0500372 Delete All Error Logs
George Keishing8bf8ed72017-12-07 04:01:45 -0600373 Close All Connections