blob: 2d2d40b4d5abded7832a19de444e6c8e749d8227 [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
40 # Example:
41 # /xyz/openbmc_project/sensors/fan_tach/fan0
42 # /xyz/openbmc_project/sensors/fan_tach/fan1
43 # /xyz/openbmc_project/sensors/fan_tach/fan2
44 # /xyz/openbmc_project/sensors/fan_tach/fan3
45 ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
46
47 # Access the properties of the fan and it should contain
48 # the following entries:
49 # /xyz/openbmc_project/sensors/fan_tach/fan0
50 # {
51 # "Scale": 0,
52 # "Target": 0,
53 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
54 # "Value": 0
55 # }
56
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050057 FOR ${entry} IN @{fans}
58 ${resp}= OpenBMC Get Request ${entry}
59 ${json}= To JSON ${resp.content}
60 Should Be True ${json["data"]["Scale"]} >= 0
61 Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
62 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
63 Should Be True ${json["data"]["Value"]} >= 0
64 END
Sweta Potthuricca07de2017-09-26 06:14:23 -050065
66Verify PCIE Sensors Attributes
67 [Documentation] Probe PCIE attributes.
68 [Tags] Verify_PCIE_Sensor_Attributes
69 # Example:
70 # /xyz/openbmc_project/sensors/temperature/pcie
71 ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
72
73 # Access the properties of the PCIE and it should contain
74 # the following entries:
75 # /xyz/openbmc_project/sensors/temperature/pcie
76 # {
77 # "Scale": -3,
78 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
79 # "Value": 29625
80 # }
81
82
Sushil Singh5dbaf9d2020-06-19 05:43:20 -050083 FOR ${entry} IN @{temp_pcie}
84 ${resp}= OpenBMC Get Request ${entry}
85 ${json}= To JSON ${resp.content}
86 Should Be True ${json["data"]["Scale"]} == -3
87 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
88 ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
89 Should Be True ${temp_in_DegreeC} > 0
90 END
Sweta Potthuricca07de2017-09-26 06:14:23 -050091
92
93Verify Rail Voltage Sensors Attributes
94 [Documentation] Check rail voltage attributes.
95 [Tags] Verify_Rail_Voltage_Sensor_Attributes
96 # Example of one of the entries returned by 'Get Endpoint Paths':
97 # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
98 # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
99 ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
100
101 # Example:
102 # Access the properties of the rail voltage and it should contain
103 # the following entries:
104 # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
105 # {
106 # "Scale": -3,
107 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
108 # "Value": 5097
109 # },
110
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500111 FOR ${entry} IN @{temp_rail}
112 ${resp}= OpenBMC Get Request ${entry}
113 ${json}= To JSON ${resp.content}
114 Should Be True ${json["data"]["Scale"]} == -3
115 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
116 ${volts}= Evaluate ${json["data"]["Value"]} / 1000
117 Should Be True ${volts} > 0
118 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 # {
133 # "Scale": -3,
134 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
135 # "Value": 3000
136 # }
137
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500138 FOR ${entry} IN @{temp_vdn}
139 ${resp}= OpenBMC Get Request ${entry}
140 ${json}= To JSON ${resp.content}
141 Should Be True ${json["data"]["Scale"]} == -3
142 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
143 ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
144 Should Be True ${vdn_temp} > 0
145 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500146
147Verify VCS Temperature Sensors Attributes
148 [Documentation] Check vcs temperature attributes.
149 [Tags] Verify_VCS_Temperature_Sensors_Attributes
150 # Example of one of the entries returned by 'Get Endpoint Paths':
151 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
152 ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
153
154 # Example:
155 # Access the properties of the rail voltage and it should contain
156 # the following entries:
157 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
158 # {
159 # "Scale": -3,
160 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
161 # "Value": 31000
162 # },
163
164
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500165 FOR ${entry} IN @{temp_vcs}
166 ${resp}= OpenBMC Get Request ${entry}
167 ${json}= To JSON ${resp.content}
168 Should Be True ${json["data"]["Scale"]} == -3
169 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
170 ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
171 Should Be True ${vcs_temp} > 0
172 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500173
174
175Verify VDD Temperature Sensors Attributes
176 [Documentation] Check vdd temperature attributes.
177 [Tags] Verify_VDD_Temperature_Sensors_Attributes
178 # Example of one of the entries returned by 'Get Endpoint Paths':
179 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
180 ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
181
182 # Example:
183 # Access the properties of the rail voltage and it should contain
184 # the following entries:
185 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
186 # {
187 # "Scale": -3,
188 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
189 # "Value": 4000
190 # }
191
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500192 FOR ${entry} IN @{temp_vdd}
193 ${resp}= OpenBMC Get Request ${entry}
194 ${json}= To JSON ${resp.content}
195 Should Be True ${json["data"]["Scale"]} == -3
196 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
197 ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
198 Should Be True ${vdd_temp} > 0
199 END
Sweta Potthuricca07de2017-09-26 06:14:23 -0500200
201
202Verify VDDR Temperature Sensors Attributes
203 [Documentation] Check vddr temperature attributes.
204 [Tags] Verify_VDDR_Temperature_Sensors_Attributes
205 # Example of one of the entries returned by 'Get Endpoint Paths':
206 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
207 ${temp_vddr}=
208 ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
209
210 # Example:
211 # Access the properties of the rail voltage and it should contain
212 # the following entries:
213 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
214 # {
215 # "Scale": -3,
216 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
217 # "Value": 4000
218 # }
219
Sushil Singh5dbaf9d2020-06-19 05:43:20 -0500220 FOR ${entry} IN @{temp_vddr}
221 ${resp}= OpenBMC Get Request ${entry}
222 ${json}= To JSON ${resp.content}
223 Should Be True ${json["data"]["Scale"]} == -3
224 Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
225 ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
226 Should Be True ${vddr_temp} > 0
227 END
George Keishing06572472017-09-01 11:33:01 -0500228
Jayashree-Dea982302020-07-21 16:44:13 +0530229Verify Power Sensors Attributes
230 [Documentation] Check power sensor attributes.
231 [Tags] Verify_Power_Sensor_Attributes
232 # Example:
233 # /xyz/openbmc_project/sensors/power/power_1
234 # /xyz/openbmc_project/sensors/power/power_2
235 # /xyz/openbmc_project/sensors/power/power0
236 # /xyz/openbmc_project/sensors/power/POWER1
237 # /xyz/openbmc_project/sensors/power/POWER_1
238
239 ${power}= Get Endpoint Paths /xyz/openbmc_project/sensors/ power*
240
241 # Access the properties of the power sensors and it should contain
242 # the following entries:
243 # /xyz/openbmc_project/sensors/power/power_1
244 # {
245 # "MaxValue": 255.0,
246 # "MinValue": 0.0,
247 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts",
248 # "Value": 0.0
249 # }
250
251 FOR ${entry} IN @{power}
252 ${resp}= OpenBMC Get Request ${entry}
253 ${json}= To JSON ${resp.content}
254 Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0
255 Should Be True ${json["data"]["Value"]} >= 0
256 END
George Keishing8bf8ed72017-12-07 04:01:45 -0600257
Steven Sombareabeccf2018-09-06 11:41:12 -0500258Verify Power Redundancy Using REST
259 [Documentation] Verify power redundancy is enabled.
260 [Tags] Verify_Power_Redundancy_Using_REST
George Keishing8bf8ed72017-12-07 04:01:45 -0600261
262 # Example:
263 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
264 # {
265 # "error": 0,
266 # "units": "",
267 # "value": "Enabled"
268 # }
269
Steven Sombareabeccf2018-09-06 11:41:12 -0500270 # Power Redundancy is a read-only attribute. It cannot be set.
Steven Sombar27c1ad42018-09-11 14:44:25 -0500271
272 # Pass if sensor is in /xyz and it's enabled.
273 ${redundancy_setting}= Read Attribute
274 ... ${OPENBMC_BASE_URI}control/power_supply_redundancy
275 ... PowerSupplyRedundancyEnabled
276 Should Be Equal As Integers ${redundancy_setting} ${1}
277 ... msg=PowerSupplyRedundancyEnabled not set as expected.
George Keishing8bf8ed72017-12-07 04:01:45 -0600278
279
Steven Sombareabeccf2018-09-06 11:41:12 -0500280Verify Power Redundancy Using IPMI
Steven Sombar27c1ad42018-09-11 14:44:25 -0500281 [Documentation] Verify IPMI reports Power Redundancy is enabled.
Steven Sombareabeccf2018-09-06 11:41:12 -0500282 [Tags] Verify_Power_Redundancy_Using_IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600283
284 # Refer to data/ipmi_raw_cmd_table.py for command definition.
Steven Sombareabeccf2018-09-06 11:41:12 -0500285 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishingdcf746b2018-02-06 12:43:44 -0600286
287 ${output}= Run IPMI Standard Command
288 ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
289
Steven Sombar27c1ad42018-09-11 14:44:25 -0500290 ${scanning}= Set Variable
291 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]}
292 ${no_scanning}= Set Variable
George Keishingdcf746b2018-02-06 12:43:44 -0600293 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
Steven Sombar27c1ad42018-09-11 14:44:25 -0500294
295 ${enabled_scanning}= Evaluate $scanning in $output
296 ${enabled_no_scanning}= Evaluate $no_scanning in $output
297
298 # Either enabled_scanning or enabled_noscanning should be True.
299 Should Be True ${enabled_scanning} or ${enabled_no_scanning}
300 ... msg=Failed IPMI power redundancy check, result=${output}.
George Keishingdcf746b2018-02-06 12:43:44 -0600301
302
George Keishing06572472017-09-01 11:33:01 -0500303*** Keywords ***
304
George Keishing8bf8ed72017-12-07 04:01:45 -0600305Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500306 [Documentation] Do the initial test suite setup.
307 # - Power off.
308 # - Boot Host.
309 REST Power Off stack_mode=skip
310 REST Power On
311
George Keishing8bf8ed72017-12-07 04:01:45 -0600312Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500313 [Documentation] Do the post test teardown.
314 # - Capture FFDC on test failure.
315 # - Delete error logs.
316 # - Close all open SSH connections.
317
George Keishing8bf8ed72017-12-07 04:01:45 -0600318 FFDC On Test Case Fail
George Keishing32fe4e12018-07-13 05:06:47 -0500319 Delete All Error Logs
George Keishing8bf8ed72017-12-07 04:01:45 -0600320 Close All Connections