blob: b1ce7661cf469d20baa6afe1259bc48d1850aa47 [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
George Keishing8bf8ed72017-12-07 04:01:45 -0600229
Steven Sombareabeccf2018-09-06 11:41:12 -0500230Verify Power Redundancy Using REST
231 [Documentation] Verify power redundancy is enabled.
232 [Tags] Verify_Power_Redundancy_Using_REST
George Keishing8bf8ed72017-12-07 04:01:45 -0600233
234 # Example:
235 # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy
236 # {
237 # "error": 0,
238 # "units": "",
239 # "value": "Enabled"
240 # }
241
Steven Sombareabeccf2018-09-06 11:41:12 -0500242 # Power Redundancy is a read-only attribute. It cannot be set.
Steven Sombar27c1ad42018-09-11 14:44:25 -0500243
244 # Pass if sensor is in /xyz and it's enabled.
245 ${redundancy_setting}= Read Attribute
246 ... ${OPENBMC_BASE_URI}control/power_supply_redundancy
247 ... PowerSupplyRedundancyEnabled
248 Should Be Equal As Integers ${redundancy_setting} ${1}
249 ... msg=PowerSupplyRedundancyEnabled not set as expected.
George Keishing8bf8ed72017-12-07 04:01:45 -0600250
251
Steven Sombareabeccf2018-09-06 11:41:12 -0500252Verify Power Redundancy Using IPMI
Steven Sombar27c1ad42018-09-11 14:44:25 -0500253 [Documentation] Verify IPMI reports Power Redundancy is enabled.
Steven Sombareabeccf2018-09-06 11:41:12 -0500254 [Tags] Verify_Power_Redundancy_Using_IPMI
George Keishingdcf746b2018-02-06 12:43:44 -0600255
256 # Refer to data/ipmi_raw_cmd_table.py for command definition.
Steven Sombareabeccf2018-09-06 11:41:12 -0500257 # Power Redundancy is a read-only attribute. It cannot be set.
George Keishingdcf746b2018-02-06 12:43:44 -0600258
259 ${output}= Run IPMI Standard Command
260 ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]}
261
Steven Sombar27c1ad42018-09-11 14:44:25 -0500262 ${scanning}= Set Variable
263 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]}
264 ${no_scanning}= Set Variable
George Keishingdcf746b2018-02-06 12:43:44 -0600265 ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]}
Steven Sombar27c1ad42018-09-11 14:44:25 -0500266
267 ${enabled_scanning}= Evaluate $scanning in $output
268 ${enabled_no_scanning}= Evaluate $no_scanning in $output
269
270 # Either enabled_scanning or enabled_noscanning should be True.
271 Should Be True ${enabled_scanning} or ${enabled_no_scanning}
272 ... msg=Failed IPMI power redundancy check, result=${output}.
George Keishingdcf746b2018-02-06 12:43:44 -0600273
274
George Keishing06572472017-09-01 11:33:01 -0500275*** Keywords ***
276
George Keishing8bf8ed72017-12-07 04:01:45 -0600277Suite Setup Execution
George Keishing06572472017-09-01 11:33:01 -0500278 [Documentation] Do the initial test suite setup.
279 # - Power off.
280 # - Boot Host.
281 REST Power Off stack_mode=skip
282 REST Power On
283
George Keishing8bf8ed72017-12-07 04:01:45 -0600284Test Teardown Execution
George Keishing06572472017-09-01 11:33:01 -0500285 [Documentation] Do the post test teardown.
286 # - Capture FFDC on test failure.
287 # - Delete error logs.
288 # - Close all open SSH connections.
289
George Keishing8bf8ed72017-12-07 04:01:45 -0600290 FFDC On Test Case Fail
George Keishing32fe4e12018-07-13 05:06:47 -0500291 Delete All Error Logs
George Keishing8bf8ed72017-12-07 04:01:45 -0600292 Close All Connections