blob: 8c0d23432d47e99fe07f473495a05d50e3c2a6c9 [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.
Steven Sombar27c1ad42018-09-11 14:44:25 -0500246
247 # Pass if sensor is in /xyz and it's enabled.
248 ${redundancy_setting}= Read Attribute
249 ... ${OPENBMC_BASE_URI}control/power_supply_redundancy
250 ... PowerSupplyRedundancyEnabled
251 Should Be Equal As Integers ${redundancy_setting} ${1}
252 ... msg=PowerSupplyRedundancyEnabled not set as expected.
George Keishing8bf8ed72017-12-07 04:01:45 -0600253
254
Steven Sombareabeccf2018-09-06 11:41:12 -0500255Verify Power Redundancy Using IPMI
Steven Sombar27c1ad42018-09-11 14:44:25 -0500256 [Documentation] Verify IPMI reports Power Redundancy is enabled.
Steven Sombareabeccf2018-09-06 11:41:12 -0500257 [Tags] Verify_Power_Redundancy_Using_IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600258
259 # Refer to data/ipmi_raw_cmd_table.py for command definition.
Steven Sombareabeccf2018-09-06 11:41:12 -0500260 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishingdcf746b2018-02-06 12:43:44 -0600261
262 ${output}= Run IPMI Standard Command
263 ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
264
Steven Sombar27c1ad42018-09-11 14:44:25 -0500265 ${scanning}= Set Variable
266 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]}
267 ${no_scanning}= Set Variable
George Keishingdcf746b2018-02-06 12:43:44 -0600268 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
Steven Sombar27c1ad42018-09-11 14:44:25 -0500269
270 ${enabled_scanning}= Evaluate $scanning in $output
271 ${enabled_no_scanning}= Evaluate $no_scanning in $output
272
273 # Either enabled_scanning or enabled_noscanning should be True.
274 Should Be True ${enabled_scanning} or ${enabled_no_scanning}
275 ... msg=Failed IPMI power redundancy check, result=${output}.
George Keishingdcf746b2018-02-06 12:43:44 -0600276
277
George Keishing06572472017-09-01 11:33:01 -0500278*** Keywords ***
279
George Keishing8bf8ed72017-12-07 04:01:45 -0600280Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500281 [Documentation] Do the initial test suite setup.
282 # - Power off.
283 # - Boot Host.
284 REST Power Off stack_mode=skip
285 REST Power On
286
George Keishing8bf8ed72017-12-07 04:01:45 -0600287Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500288 [Documentation] Do the post test teardown.
289 # - Capture FFDC on test failure.
290 # - Delete error logs.
291 # - Close all open SSH connections.
292
George Keishing8bf8ed72017-12-07 04:01:45 -0600293 FFDC On Test Case Fail
George Keishing32fe4e12018-07-13 05:06:47 -0500294 Delete All Error Logs
George Keishing8bf8ed72017-12-07 04:01:45 -0600295 Close All Connections