blob: 08bf3ab379ea6ef296acfc7ca40eeec277572d85 [file] [log] [blame]
George Keishing06572472017-09-01 11:33:01 -05001*** Settings ***
2Documentation Suite to test harware sensors.
3
4Resource ../lib/utils.robot
5Resource ../lib/boot_utils.robot
6Resource ../lib/state_manager.robot
7Resource ../lib/openbmc_ffdc.robot
8
George Keishing8bf8ed72017-12-07 04:01:45 -06009Suite Setup Suite Setup Execution
10Test Teardown Test Teardown Execution
11Suite Teardown Power Redundancy Setting setValue Enabled
George Keishing06572472017-09-01 11:33:01 -050012
13*** Test Cases ***
14
15Verify System Ambient Temperature
16 [Documentation] Check the ambient sensor temperature.
17 [Tags] Verify_System_Ambient_Temperature
18
19 # Example:
20 # /xyz/openbmc_project/sensors/temperature/ambient
21 # {
22 # "Scale": -3,
23 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
24 # "Value": 25767
25 # }
26
27 ${temp_data}= Read Properties ${SENSORS_URI}temperature/ambient
28 Should Be True ${temp_data["Scale"]} == ${-3}
29 Should Be Equal As Strings
30 ... ${temp_data["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
31 Should Be True ${temp_data["Value"]/1000} <= ${50}
32 ... msg=System working temperature crossed 50 degree celsius.
33
Sweta Potthuricca07de2017-09-26 06:14:23 -050034Verify Fan Sensors Attributes
35 [Documentation] Check fan attributes.
36 [Tags] Verify_Fan_Sensor_Attributes
37 # Example:
38 # /xyz/openbmc_project/sensors/fan_tach/fan0
39 # /xyz/openbmc_project/sensors/fan_tach/fan1
40 # /xyz/openbmc_project/sensors/fan_tach/fan2
41 # /xyz/openbmc_project/sensors/fan_tach/fan3
42 ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
43
44 # Access the properties of the fan and it should contain
45 # the following entries:
46 # /xyz/openbmc_project/sensors/fan_tach/fan0
47 # {
48 # "Scale": 0,
49 # "Target": 0,
50 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
51 # "Value": 0
52 # }
53
54 :FOR ${entry} IN @{fans}
55 \ ${resp}= OpenBMC Get Request ${entry}
56 \ ${json}= To JSON ${resp.content}
57 \ Should Be True ${json["data"]["Scale"]} >= 0
58 \ Run Keyword And Ignore Error
59 ... Should Be True ${json["data"]["Target"]} >= 0
60 \ Should Be Equal As Strings
61 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
62 \ Should Be True ${json["data"]["Value"]} >= 0
63
64
65Verify PCIE Sensors Attributes
66 [Documentation] Probe PCIE attributes.
67 [Tags] Verify_PCIE_Sensor_Attributes
68 # Example:
69 # /xyz/openbmc_project/sensors/temperature/pcie
70 ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
71
72 # Access the properties of the PCIE and it should contain
73 # the following entries:
74 # /xyz/openbmc_project/sensors/temperature/pcie
75 # {
76 # "Scale": -3,
77 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
78 # "Value": 29625
79 # }
80
81
82 :FOR ${entry} IN @{temp_pcie}
83 \ ${resp}= OpenBMC Get Request ${entry}
84 \ ${json}= To JSON ${resp.content}
85 \ Should Be True ${json["data"]["Scale"]} == -3
86 \ Should Be Equal As Strings
87 ... ${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
91
92Verify Rail Voltage Sensors Attributes
93 [Documentation] Check rail voltage attributes.
94 [Tags] Verify_Rail_Voltage_Sensor_Attributes
95 # Example of one of the entries returned by 'Get Endpoint Paths':
96 # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
97 # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
98 ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
99
100 # Example:
101 # Access the properties of the rail voltage and it should contain
102 # the following entries:
103 # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
104 # {
105 # "Scale": -3,
106 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
107 # "Value": 5097
108 # },
109
110 :FOR ${entry} IN @{temp_rail}
111 \ ${resp}= OpenBMC Get Request ${entry}
112 \ ${json}= To JSON ${resp.content}
113 \ Should Be True ${json["data"]["Scale"]} == -3
114 \ Should Be Equal As Strings
115 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
116 \ ${volts}= Evaluate ${json["data"]["Value"]} / 1000
117 \ Should Be True ${volts} > 0
118
119
120Verify VDN Temperature Sensors Attributes
121 [Documentation] Check vdn temperature attributes.
122 [Tags] Verify_VDN_Temperature_Sensors_Attributes
123 # Example of one of the entries returned by 'Get Endpoint Paths':
124 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
125 ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp
126
127 # Example:
128 # Access the properties of the rail voltage and it should contain
129 # the following entries:
130 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
131 # {
132 # "Scale": -3,
133 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
134 # "Value": 3000
135 # }
136
137 :FOR ${entry} IN @{temp_vdn}
138 \ ${resp}= OpenBMC Get Request ${entry}
139 \ ${json}= To JSON ${resp.content}
140 \ Should Be True ${json["data"]["Scale"]} == -3
141 \ Should Be Equal As Strings
142 ... ${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
146
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
165 :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
170 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
171 \ ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
172 \ Should Be True ${vcs_temp} > 0
173
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
192 :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
197 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
198 \ ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
199 \ Should Be True ${vdd_temp} > 0
200
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
220 :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
225 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
226 \ ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
227 \ Should Be True ${vddr_temp} > 0
George Keishing06572472017-09-01 11:33:01 -0500228
George Keishing8bf8ed72017-12-07 04:01:45 -0600229Disable Power Redundancy And Verify
230 [Documentation] Disable power redundancy and verify that it is disabled.
231 [Tags] Disable_Power_Redundancy_And_Verify
232
233 # Example:
234 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
235 # {
236 # "error": 0,
237 # "units": "",
238 # "value": "Disabled"
239 # }
240
241 Power Redundancy Setting setValue Disabled
242
243 ${resp}= Power Redundancy Setting getValue
244 ${content}= To Json ${resp.content}
245 Should Be Equal As Strings ${content["data"]} Disabled
246
247
248Enable Power Redundancy And Verify
249 [Documentation] Enable power redundancy and verify that it is enabled.
250 [Tags] Enable_Power_Redundancy_And_Verify
251
252 # Example:
253 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
254 # {
255 # "error": 0,
256 # "units": "",
257 # "value": "Enabled"
258 # }
259
260 Power Redundancy Setting setValue Enabled
261
262 ${resp}= Power Redundancy Setting getValue
263 ${content}= To Json ${resp.content}
264 Should Be Equal As Strings ${content["data"]} Enabled
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
283 Delete Error Logs
284 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}
George Keishing06572472017-09-01 11:33:01 -0500304