blob: ee98da49bc933722819d15179a860bc0d80068d5 [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
57 :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
62 ... Should Be True ${json["data"]["Target"]} >= 0
63 \ Should Be Equal As Strings
64 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
65 \ Should Be True ${json["data"]["Value"]} >= 0
66
67
68Verify PCIE Sensors Attributes
69 [Documentation] Probe PCIE attributes.
70 [Tags] Verify_PCIE_Sensor_Attributes
71 # Example:
72 # /xyz/openbmc_project/sensors/temperature/pcie
73 ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
74
75 # Access the properties of the PCIE and it should contain
76 # the following entries:
77 # /xyz/openbmc_project/sensors/temperature/pcie
78 # {
79 # "Scale": -3,
80 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
81 # "Value": 29625
82 # }
83
84
85 :FOR ${entry} IN @{temp_pcie}
86 \ ${resp}= OpenBMC Get Request ${entry}
87 \ ${json}= To JSON ${resp.content}
88 \ Should Be True ${json["data"]["Scale"]} == -3
89 \ Should Be Equal As Strings
90 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
91 \ ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
92 \ Should Be True ${temp_in_DegreeC} > 0
93
94
95Verify Rail Voltage Sensors Attributes
96 [Documentation] Check rail voltage attributes.
97 [Tags] Verify_Rail_Voltage_Sensor_Attributes
98 # Example of one of the entries returned by 'Get Endpoint Paths':
99 # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
100 # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
101 ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
102
103 # Example:
104 # Access the properties of the rail voltage and it should contain
105 # the following entries:
106 # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
107 # {
108 # "Scale": -3,
109 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
110 # "Value": 5097
111 # },
112
113 :FOR ${entry} IN @{temp_rail}
114 \ ${resp}= OpenBMC Get Request ${entry}
115 \ ${json}= To JSON ${resp.content}
116 \ Should Be True ${json["data"]["Scale"]} == -3
117 \ Should Be Equal As Strings
118 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
119 \ ${volts}= Evaluate ${json["data"]["Value"]} / 1000
120 \ Should Be True ${volts} > 0
121
122
123Verify VDN Temperature Sensors Attributes
124 [Documentation] Check vdn temperature attributes.
125 [Tags] Verify_VDN_Temperature_Sensors_Attributes
126 # Example of one of the entries returned by 'Get Endpoint Paths':
127 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
128 ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp
129
130 # Example:
131 # Access the properties of the rail voltage and it should contain
132 # the following entries:
133 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
134 # {
135 # "Scale": -3,
136 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
137 # "Value": 3000
138 # }
139
140 :FOR ${entry} IN @{temp_vdn}
141 \ ${resp}= OpenBMC Get Request ${entry}
142 \ ${json}= To JSON ${resp.content}
143 \ Should Be True ${json["data"]["Scale"]} == -3
144 \ Should Be Equal As Strings
145 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
146 \ ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
147 \ Should Be True ${vdn_temp} > 0
148
149
150Verify VCS Temperature Sensors Attributes
151 [Documentation] Check vcs temperature attributes.
152 [Tags] Verify_VCS_Temperature_Sensors_Attributes
153 # Example of one of the entries returned by 'Get Endpoint Paths':
154 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
155 ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
156
157 # Example:
158 # Access the properties of the rail voltage and it should contain
159 # the following entries:
160 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
161 # {
162 # "Scale": -3,
163 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
164 # "Value": 31000
165 # },
166
167
168 :FOR ${entry} IN @{temp_vcs}
169 \ ${resp}= OpenBMC Get Request ${entry}
170 \ ${json}= To JSON ${resp.content}
171 \ Should Be True ${json["data"]["Scale"]} == -3
172 \ Should Be Equal As Strings
173 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
174 \ ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
175 \ Should Be True ${vcs_temp} > 0
176
177
178Verify VDD Temperature Sensors Attributes
179 [Documentation] Check vdd temperature attributes.
180 [Tags] Verify_VDD_Temperature_Sensors_Attributes
181 # Example of one of the entries returned by 'Get Endpoint Paths':
182 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
183 ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
184
185 # Example:
186 # Access the properties of the rail voltage and it should contain
187 # the following entries:
188 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
189 # {
190 # "Scale": -3,
191 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
192 # "Value": 4000
193 # }
194
195 :FOR ${entry} IN @{temp_vdd}
196 \ ${resp}= OpenBMC Get Request ${entry}
197 \ ${json}= To JSON ${resp.content}
198 \ Should Be True ${json["data"]["Scale"]} == -3
199 \ Should Be Equal As Strings
200 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
201 \ ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
202 \ Should Be True ${vdd_temp} > 0
203
204
205Verify VDDR Temperature Sensors Attributes
206 [Documentation] Check vddr temperature attributes.
207 [Tags] Verify_VDDR_Temperature_Sensors_Attributes
208 # Example of one of the entries returned by 'Get Endpoint Paths':
209 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
210 ${temp_vddr}=
211 ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
212
213 # Example:
214 # Access the properties of the rail voltage and it should contain
215 # the following entries:
216 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
217 # {
218 # "Scale": -3,
219 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
220 # "Value": 4000
221 # }
222
223 :FOR ${entry} IN @{temp_vddr}
224 \ ${resp}= OpenBMC Get Request ${entry}
225 \ ${json}= To JSON ${resp.content}
226 \ Should Be True ${json["data"]["Scale"]} == -3
227 \ Should Be Equal As Strings
228 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
229 \ ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
230 \ Should Be True ${vddr_temp} > 0
George Keishing06572472017-09-01 11:33:01 -0500231
George Keishing8bf8ed72017-12-07 04:01:45 -0600232
Steven Sombareabeccf2018-09-06 11:41:12 -0500233Verify Power Redundancy Using REST
234 [Documentation] Verify power redundancy is enabled.
235 [Tags] Verify_Power_Redundancy_Using_REST
George Keishing8bf8ed72017-12-07 04:01:45 -0600236
237 # Example:
238 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
239 # {
240 # "error": 0,
241 # "units": "",
242 # "value": "Enabled"
243 # }
244
Steven Sombareabeccf2018-09-06 11:41:12 -0500245 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishing8bf8ed72017-12-07 04:01:45 -0600246 ${resp}= Power Redundancy Setting getValue
247 ${content}= To Json ${resp.content}
248 Should Be Equal As Strings ${content["data"]} Enabled
249
250
Steven Sombareabeccf2018-09-06 11:41:12 -0500251Verify Power Redundancy Using IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600252 [Documentation] Enable power redundancy and verify that it is enabled.
Steven Sombareabeccf2018-09-06 11:41:12 -0500253 [Tags] Verify_Power_Redundancy_Using_IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600254
255 # Refer to data/ipmi_raw_cmd_table.py for command definition.
Steven Sombareabeccf2018-09-06 11:41:12 -0500256 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishingdcf746b2018-02-06 12:43:44 -0600257
258 ${output}= Run IPMI Standard Command
259 ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
260
261 Should Be Equal As Strings
262 ... ${output.lstrip()}
263 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
264 ... msg=${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} = ${output}.
265
266
George Keishing06572472017-09-01 11:33:01 -0500267*** Keywords ***
268
George Keishing8bf8ed72017-12-07 04:01:45 -0600269Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500270 [Documentation] Do the initial test suite setup.
271 # - Power off.
272 # - Boot Host.
273 REST Power Off stack_mode=skip
274 REST Power On
275
George Keishing8bf8ed72017-12-07 04:01:45 -0600276Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500277 [Documentation] Do the post test teardown.
278 # - Capture FFDC on test failure.
279 # - Delete error logs.
280 # - Close all open SSH connections.
281
George Keishing8bf8ed72017-12-07 04:01:45 -0600282 FFDC On Test Case Fail
George Keishing32fe4e12018-07-13 05:06:47 -0500283 Delete All Error Logs
George Keishing8bf8ed72017-12-07 04:01:45 -0600284 Close All Connections
285
286Power Redundancy Setting
287 [Documentation] "Set" or "Get" power redundancy setting.
288 [Arguments] ${action} ${value}=${EMPTY}
289
290 # Description of argument(s):
291 # action "setValue" or "getValue" API request string.
292 # value String argument for the API request (e.g. "Enabled"/"Disabled").
293
294 @{arglist}= Create List
295 Run Keyword If '${value}' != '${EMPTY}'
296 ... Append To List ${arglist} ${value}
297
298 ${args}= Create Dictionary data=@{arglist}
299 ${resp}= Call Method ${SENSORS_URI}chassis/PowerSupplyRedundancy
300 ... ${action} data=${args}
301 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
302
303 [Return] ${resp}