blob: 88f53709c7fb2cc3c711c9251ce76ca8948bca1e [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
9Suite Setup Pre Test Suite Execution
10Test Teardown Post Test Case Execution
11
12*** Test Cases ***
13
14Verify System Ambient Temperature
15 [Documentation] Check the ambient sensor temperature.
16 [Tags] Verify_System_Ambient_Temperature
17
18 # Example:
19 # /xyz/openbmc_project/sensors/temperature/ambient
20 # {
21 # "Scale": -3,
22 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
23 # "Value": 25767
24 # }
25
26 ${temp_data}= Read Properties ${SENSORS_URI}temperature/ambient
27 Should Be True ${temp_data["Scale"]} == ${-3}
28 Should Be Equal As Strings
29 ... ${temp_data["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
30 Should Be True ${temp_data["Value"]/1000} <= ${50}
31 ... msg=System working temperature crossed 50 degree celsius.
32
Sweta Potthuricca07de2017-09-26 06:14:23 -050033Verify Fan Sensors Attributes
34 [Documentation] Check fan attributes.
35 [Tags] Verify_Fan_Sensor_Attributes
36 # Example:
37 # /xyz/openbmc_project/sensors/fan_tach/fan0
38 # /xyz/openbmc_project/sensors/fan_tach/fan1
39 # /xyz/openbmc_project/sensors/fan_tach/fan2
40 # /xyz/openbmc_project/sensors/fan_tach/fan3
41 ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan*
42
43 # Access the properties of the fan and it should contain
44 # the following entries:
45 # /xyz/openbmc_project/sensors/fan_tach/fan0
46 # {
47 # "Scale": 0,
48 # "Target": 0,
49 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS",
50 # "Value": 0
51 # }
52
53 :FOR ${entry} IN @{fans}
54 \ ${resp}= OpenBMC Get Request ${entry}
55 \ ${json}= To JSON ${resp.content}
56 \ Should Be True ${json["data"]["Scale"]} >= 0
57 \ Run Keyword And Ignore Error
58 ... Should Be True ${json["data"]["Target"]} >= 0
59 \ Should Be Equal As Strings
60 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS
61 \ Should Be True ${json["data"]["Value"]} >= 0
62
63
64Verify PCIE Sensors Attributes
65 [Documentation] Probe PCIE attributes.
66 [Tags] Verify_PCIE_Sensor_Attributes
67 # Example:
68 # /xyz/openbmc_project/sensors/temperature/pcie
69 ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie
70
71 # Access the properties of the PCIE and it should contain
72 # the following entries:
73 # /xyz/openbmc_project/sensors/temperature/pcie
74 # {
75 # "Scale": -3,
76 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
77 # "Value": 29625
78 # }
79
80
81 :FOR ${entry} IN @{temp_pcie}
82 \ ${resp}= OpenBMC Get Request ${entry}
83 \ ${json}= To JSON ${resp.content}
84 \ Should Be True ${json["data"]["Scale"]} == -3
85 \ Should Be Equal As Strings
86 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
87 \ ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000
88 \ Should Be True ${temp_in_DegreeC} > 0
89
90
91Verify Rail Voltage Sensors Attributes
92 [Documentation] Check rail voltage attributes.
93 [Tags] Verify_Rail_Voltage_Sensor_Attributes
94 # Example of one of the entries returned by 'Get Endpoint Paths':
95 # /xyz/openbmc_project/sensors/voltage/rail_1_voltage
96 # /xyz/openbmc_project/sensors/voltage/rail_2_voltage
97 ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail*
98
99 # Example:
100 # Access the properties of the rail voltage and it should contain
101 # the following entries:
102 # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage":
103 # {
104 # "Scale": -3,
105 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts",
106 # "Value": 5097
107 # },
108
109 :FOR ${entry} IN @{temp_rail}
110 \ ${resp}= OpenBMC Get Request ${entry}
111 \ ${json}= To JSON ${resp.content}
112 \ Should Be True ${json["data"]["Scale"]} == -3
113 \ Should Be Equal As Strings
114 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts
115 \ ${volts}= Evaluate ${json["data"]["Value"]} / 1000
116 \ Should Be True ${volts} > 0
117
118
119Verify VDN Temperature Sensors Attributes
120 [Documentation] Check vdn temperature attributes.
121 [Tags] Verify_VDN_Temperature_Sensors_Attributes
122 # Example of one of the entries returned by 'Get Endpoint Paths':
123 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
124 ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp
125
126 # Example:
127 # Access the properties of the rail voltage and it should contain
128 # the following entries:
129 # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp
130 # {
131 # "Scale": -3,
132 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
133 # "Value": 3000
134 # }
135
136 :FOR ${entry} IN @{temp_vdn}
137 \ ${resp}= OpenBMC Get Request ${entry}
138 \ ${json}= To JSON ${resp.content}
139 \ Should Be True ${json["data"]["Scale"]} == -3
140 \ Should Be Equal As Strings
141 ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC
142 \ ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000
143 \ Should Be True ${vdn_temp} > 0
144
145
146Verify VCS Temperature Sensors Attributes
147 [Documentation] Check vcs temperature attributes.
148 [Tags] Verify_VCS_Temperature_Sensors_Attributes
149 # Example of one of the entries returned by 'Get Endpoint Paths':
150 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
151 ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp
152
153 # Example:
154 # Access the properties of the rail voltage and it should contain
155 # the following entries:
156 # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp
157 # {
158 # "Scale": -3,
159 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
160 # "Value": 31000
161 # },
162
163
164 :FOR ${entry} IN @{temp_vcs}
165 \ ${resp}= OpenBMC Get Request ${entry}
166 \ ${json}= To JSON ${resp.content}
167 \ Should Be True ${json["data"]["Scale"]} == -3
168 \ Should Be Equal As Strings
169 ... ${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
173
174Verify VDD Temperature Sensors Attributes
175 [Documentation] Check vdd temperature attributes.
176 [Tags] Verify_VDD_Temperature_Sensors_Attributes
177 # Example of one of the entries returned by 'Get Endpoint Paths':
178 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
179 ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp
180
181 # Example:
182 # Access the properties of the rail voltage and it should contain
183 # the following entries:
184 # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp
185 # {
186 # "Scale": -3,
187 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
188 # "Value": 4000
189 # }
190
191 :FOR ${entry} IN @{temp_vdd}
192 \ ${resp}= OpenBMC Get Request ${entry}
193 \ ${json}= To JSON ${resp.content}
194 \ Should Be True ${json["data"]["Scale"]} == -3
195 \ Should Be Equal As Strings
196 ... ${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
200
201Verify VDDR Temperature Sensors Attributes
202 [Documentation] Check vddr temperature attributes.
203 [Tags] Verify_VDDR_Temperature_Sensors_Attributes
204 # Example of one of the entries returned by 'Get Endpoint Paths':
205 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
206 ${temp_vddr}=
207 ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp
208
209 # Example:
210 # Access the properties of the rail voltage and it should contain
211 # the following entries:
212 # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp
213 # {
214 # "Scale": -3,
215 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
216 # "Value": 4000
217 # }
218
219 :FOR ${entry} IN @{temp_vddr}
220 \ ${resp}= OpenBMC Get Request ${entry}
221 \ ${json}= To JSON ${resp.content}
222 \ Should Be True ${json["data"]["Scale"]} == -3
223 \ Should Be Equal As Strings
224 ... ${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
George Keishing06572472017-09-01 11:33:01 -0500227
228*** Keywords ***
229
230Pre Test Suite Execution
231 [Documentation] Do the initial test suite setup.
232 # - Power off.
233 # - Boot Host.
234 REST Power Off stack_mode=skip
235 REST Power On
236
237Post Test Case Execution
238 [Documentation] Do the post test teardown.
239 # - Capture FFDC on test failure.
240 # - Delete error logs.
241 # - Close all open SSH connections.
242
243 FFDC On Test Case Fail
244 Delete Error Logs
245 Close All Connections
246