blob: 4289ab4da71704e2f440e4d2742d03a098ddd60c [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
George Keishinga61e9dc2017-12-12 22:11:53 -060011Suite Teardown Run Keyword And Ignore Error
12... Power Redundancy Setting setValue Enabled
George Keishing06572472017-09-01 11:33:01 -050013
14*** Test Cases ***
15
16Verify System Ambient Temperature
17 [Documentation] Check the ambient sensor temperature.
18 [Tags] Verify_System_Ambient_Temperature
19
20 # Example:
21 # /xyz/openbmc_project/sensors/temperature/ambient
22 # {
23 # "Scale": -3,
24 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
25 # "Value": 25767
26 # }
27
28 ${temp_data}= Read Properties ${SENSORS_URI}temperature/ambient
29 Should Be True ${temp_data["Scale"]} == ${-3}
30 Should Be Equal As Strings
31 ... ${temp_data["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
32 Should Be True ${temp_data["Value"]/1000} <= ${50}
33 ... msg=System working temperature crossed 50 degree celsius.
34
Sweta Potthuricca07de2017-09-26 06:14:23 -050035Verify Fan Sensors Attributes
36 [Documentation] Check fan attributes.
37 [Tags] Verify_Fan_Sensor_Attributes
38 # Example:
39 # /xyz/openbmc_project/sensors/fan_tach/fan0
40 # /xyz/openbmc_project/sensors/fan_tach/fan1
41 # /xyz/openbmc_project/sensors/fan_tach/fan2
42 # /xyz/openbmc_project/sensors/fan_tach/fan3
43 ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
44
45 # Access the properties of the fan and it should contain
46 # the following entries:
47 # /xyz/openbmc_project/sensors/fan_tach/fan0
48 # {
49 # "Scale": 0,
50 # "Target": 0,
51 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
52 # "Value": 0
53 # }
54
55 :FOR ${entry} IN @{fans}
56 \ ${resp}= OpenBMC Get Request ${entry}
57 \ ${json}= To JSON ${resp.content}
58 \ Should Be True ${json["data"]["Scale"]} >= 0
59 \ Run Keyword And Ignore Error
60 ... Should Be True ${json["data"]["Target"]} >= 0
61 \ Should Be Equal As Strings
62 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
63 \ Should Be True ${json["data"]["Value"]} >= 0
64
65
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
83 :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
88 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
89 \ ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
90 \ Should Be True ${temp_in_DegreeC} > 0
91
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
111 :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
116 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
117 \ ${volts}= Evaluate ${json["data"]["Value"]} / 1000
118 \ Should Be True ${volts} > 0
119
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
138 :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
143 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
144 \ ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
145 \ Should Be True ${vdn_temp} > 0
146
147
148Verify VCS Temperature Sensors Attributes
149 [Documentation] Check vcs temperature attributes.
150 [Tags] Verify_VCS_Temperature_Sensors_Attributes
151 # Example of one of the entries returned by 'Get Endpoint Paths':
152 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
153 ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
154
155 # Example:
156 # Access the properties of the rail voltage and it should contain
157 # the following entries:
158 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
159 # {
160 # "Scale": -3,
161 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
162 # "Value": 31000
163 # },
164
165
166 :FOR ${entry} IN @{temp_vcs}
167 \ ${resp}= OpenBMC Get Request ${entry}
168 \ ${json}= To JSON ${resp.content}
169 \ Should Be True ${json["data"]["Scale"]} == -3
170 \ Should Be Equal As Strings
171 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
172 \ ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000
173 \ Should Be True ${vcs_temp} > 0
174
175
176Verify VDD Temperature Sensors Attributes
177 [Documentation] Check vdd temperature attributes.
178 [Tags] Verify_VDD_Temperature_Sensors_Attributes
179 # Example of one of the entries returned by 'Get Endpoint Paths':
180 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
181 ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
182
183 # Example:
184 # Access the properties of the rail voltage and it should contain
185 # the following entries:
186 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
187 # {
188 # "Scale": -3,
189 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
190 # "Value": 4000
191 # }
192
193 :FOR ${entry} IN @{temp_vdd}
194 \ ${resp}= OpenBMC Get Request ${entry}
195 \ ${json}= To JSON ${resp.content}
196 \ Should Be True ${json["data"]["Scale"]} == -3
197 \ Should Be Equal As Strings
198 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
199 \ ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000
200 \ Should Be True ${vdd_temp} > 0
201
202
203Verify VDDR Temperature Sensors Attributes
204 [Documentation] Check vddr temperature attributes.
205 [Tags] Verify_VDDR_Temperature_Sensors_Attributes
206 # Example of one of the entries returned by 'Get Endpoint Paths':
207 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
208 ${temp_vddr}=
209 ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
210
211 # Example:
212 # Access the properties of the rail voltage and it should contain
213 # the following entries:
214 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
215 # {
216 # "Scale": -3,
217 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
218 # "Value": 4000
219 # }
220
221 :FOR ${entry} IN @{temp_vddr}
222 \ ${resp}= OpenBMC Get Request ${entry}
223 \ ${json}= To JSON ${resp.content}
224 \ Should Be True ${json["data"]["Scale"]} == -3
225 \ Should Be Equal As Strings
226 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
227 \ ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000
228 \ Should Be True ${vddr_temp} > 0
George Keishing06572472017-09-01 11:33:01 -0500229
George Keishing8bf8ed72017-12-07 04:01:45 -0600230Disable Power Redundancy And Verify
231 [Documentation] Disable power redundancy and verify that it is disabled.
232 [Tags] Disable_Power_Redundancy_And_Verify
233
234 # Example:
235 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
236 # {
237 # "error": 0,
238 # "units": "",
239 # "value": "Disabled"
240 # }
241
242 Power Redundancy Setting setValue Disabled
243
244 ${resp}= Power Redundancy Setting getValue
245 ${content}= To Json ${resp.content}
246 Should Be Equal As Strings ${content["data"]} Disabled
247
248
249Enable Power Redundancy And Verify
250 [Documentation] Enable power redundancy and verify that it is enabled.
251 [Tags] Enable_Power_Redundancy_And_Verify
252
253 # Example:
254 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
255 # {
256 # "error": 0,
257 # "units": "",
258 # "value": "Enabled"
259 # }
260
261 Power Redundancy Setting setValue Enabled
262
263 ${resp}= Power Redundancy Setting getValue
264 ${content}= To Json ${resp.content}
265 Should Be Equal As Strings ${content["data"]} Enabled
266
267
George Keishing06572472017-09-01 11:33:01 -0500268*** Keywords ***
269
George Keishing8bf8ed72017-12-07 04:01:45 -0600270Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500271 [Documentation] Do the initial test suite setup.
272 # - Power off.
273 # - Boot Host.
274 REST Power Off stack_mode=skip
275 REST Power On
276
George Keishing8bf8ed72017-12-07 04:01:45 -0600277Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500278 [Documentation] Do the post test teardown.
279 # - Capture FFDC on test failure.
280 # - Delete error logs.
281 # - Close all open SSH connections.
282
George Keishing8bf8ed72017-12-07 04:01:45 -0600283 FFDC On Test Case Fail
284 Delete Error Logs
285 Close All Connections
286
287Power Redundancy Setting
288 [Documentation] "Set" or "Get" power redundancy setting.
289 [Arguments] ${action} ${value}=${EMPTY}
290
291 # Description of argument(s):
292 # action "setValue" or "getValue" API request string.
293 # value String argument for the API request (e.g. "Enabled"/"Disabled").
294
295 @{arglist}= Create List
296 Run Keyword If '${value}' != '${EMPTY}'
297 ... Append To List ${arglist} ${value}
298
299 ${args}= Create Dictionary data=@{arglist}
300 ${resp}= Call Method ${SENSORS_URI}chassis/PowerSupplyRedundancy
301 ... ${action} data=${args}
302 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
303
304 [Return] ${resp}
George Keishing06572472017-09-01 11:33:01 -0500305