George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 1 | *** Settings *** |
Gunnar Mills | 917ba1a | 2018-04-08 16:42:12 -0500 | [diff] [blame] | 2 | Documentation Suite to test hardware sensors. |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 3 | |
| 4 | Resource ../lib/utils.robot |
| 5 | Resource ../lib/boot_utils.robot |
| 6 | Resource ../lib/state_manager.robot |
| 7 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 8 | Resource ../lib/ipmi_client.robot |
| 9 | Variables ../data/ipmi_raw_cmd_table.py |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 10 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 11 | Suite Setup Suite Setup Execution |
| 12 | Test Teardown Test Teardown Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 13 | |
| 14 | *** Test Cases *** |
| 15 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 16 | |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 17 | Verify 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 Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 36 | |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 37 | Verify Fan Sensors Attributes |
| 38 | [Documentation] Check fan attributes. |
| 39 | [Tags] Verify_Fan_Sensor_Attributes |
George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 40 | |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 41 | # Example: |
George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 42 | # "/xyz/openbmc_project/sensors/fan_tach/fan0_0", |
| 43 | # "/xyz/openbmc_project/sensors/fan_tach/fan0_1", |
| 44 | # "/xyz/openbmc_project/sensors/fan_tach/fan1_0", |
| 45 | # "/xyz/openbmc_project/sensors/fan_tach/fan1_1", |
| 46 | # "/xyz/openbmc_project/sensors/fan_tach/fan2_0", |
| 47 | # "/xyz/openbmc_project/sensors/fan_tach/fan2_1", |
| 48 | # "/xyz/openbmc_project/sensors/fan_tach/fan3_0", |
| 49 | # "/xyz/openbmc_project/sensors/fan_tach/fan3_1" |
| 50 | |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 51 | ${fans}= Get Endpoint Paths /xyz/openbmc_project/sensors/ fan* |
| 52 | |
| 53 | # Access the properties of the fan and it should contain |
| 54 | # the following entries: |
George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 55 | # /xyz/openbmc_project/sensors/fan_tach/fan0_0 |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 56 | # { |
George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 57 | # "Functional": true, |
| 58 | # "MaxValue": 0.0, |
| 59 | # "MinValue": 0.0, |
| 60 | # "Target": 10500, |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 61 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS", |
George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 62 | # "Value": 0.0 |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 63 | # } |
| 64 | |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 65 | FOR ${entry} IN @{fans} |
| 66 | ${resp}= OpenBMC Get Request ${entry} |
| 67 | ${json}= To JSON ${resp.content} |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 68 | Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0 |
George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 69 | Run Keyword And Ignore Error Should Be Equal As Strings |
| 70 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 71 | Should Be True ${json["data"]["Value"]} >= 0 |
| 72 | END |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 73 | |
| 74 | Verify PCIE Sensors Attributes |
| 75 | [Documentation] Probe PCIE attributes. |
| 76 | [Tags] Verify_PCIE_Sensor_Attributes |
| 77 | # Example: |
| 78 | # /xyz/openbmc_project/sensors/temperature/pcie |
| 79 | ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie |
| 80 | |
| 81 | # Access the properties of the PCIE and it should contain |
| 82 | # the following entries: |
| 83 | # /xyz/openbmc_project/sensors/temperature/pcie |
| 84 | # { |
| 85 | # "Scale": -3, |
| 86 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 87 | # "Value": 29625 |
| 88 | # } |
| 89 | |
| 90 | |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 91 | FOR ${entry} IN @{temp_pcie} |
| 92 | ${resp}= OpenBMC Get Request ${entry} |
| 93 | ${json}= To JSON ${resp.content} |
| 94 | Should Be True ${json["data"]["Scale"]} == -3 |
| 95 | Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 96 | ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000 |
| 97 | Should Be True ${temp_in_DegreeC} > 0 |
| 98 | END |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 99 | |
| 100 | |
| 101 | Verify Rail Voltage Sensors Attributes |
| 102 | [Documentation] Check rail voltage attributes. |
| 103 | [Tags] Verify_Rail_Voltage_Sensor_Attributes |
| 104 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 105 | # /xyz/openbmc_project/sensors/voltage/rail_1_voltage |
| 106 | # /xyz/openbmc_project/sensors/voltage/rail_2_voltage |
| 107 | ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail* |
| 108 | |
| 109 | # Example: |
| 110 | # Access the properties of the rail voltage and it should contain |
| 111 | # the following entries: |
| 112 | # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage": |
| 113 | # { |
| 114 | # "Scale": -3, |
| 115 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts", |
| 116 | # "Value": 5097 |
| 117 | # }, |
| 118 | |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 119 | FOR ${entry} IN @{temp_rail} |
| 120 | ${resp}= OpenBMC Get Request ${entry} |
| 121 | ${json}= To JSON ${resp.content} |
| 122 | Should Be True ${json["data"]["Scale"]} == -3 |
| 123 | Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts |
| 124 | ${volts}= Evaluate ${json["data"]["Value"]} / 1000 |
| 125 | Should Be True ${volts} > 0 |
| 126 | END |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 127 | |
| 128 | |
| 129 | Verify VDN Temperature Sensors Attributes |
| 130 | [Documentation] Check vdn temperature attributes. |
| 131 | [Tags] Verify_VDN_Temperature_Sensors_Attributes |
| 132 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 133 | # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp |
| 134 | ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp |
| 135 | |
| 136 | # Example: |
| 137 | # Access the properties of the rail voltage and it should contain |
| 138 | # the following entries: |
| 139 | # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp |
| 140 | # { |
| 141 | # "Scale": -3, |
| 142 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 143 | # "Value": 3000 |
| 144 | # } |
| 145 | |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 146 | FOR ${entry} IN @{temp_vdn} |
| 147 | ${resp}= OpenBMC Get Request ${entry} |
| 148 | ${json}= To JSON ${resp.content} |
| 149 | Should Be True ${json["data"]["Scale"]} == -3 |
| 150 | Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 151 | ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 152 | Should Be True ${vdn_temp} > 0 |
| 153 | END |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 154 | |
| 155 | Verify VCS Temperature Sensors Attributes |
| 156 | [Documentation] Check vcs temperature attributes. |
| 157 | [Tags] Verify_VCS_Temperature_Sensors_Attributes |
| 158 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 159 | # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp |
| 160 | ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp |
| 161 | |
| 162 | # Example: |
| 163 | # Access the properties of the rail voltage and it should contain |
| 164 | # the following entries: |
| 165 | # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp |
| 166 | # { |
| 167 | # "Scale": -3, |
| 168 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 169 | # "Value": 31000 |
| 170 | # }, |
| 171 | |
| 172 | |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 173 | FOR ${entry} IN @{temp_vcs} |
| 174 | ${resp}= OpenBMC Get Request ${entry} |
| 175 | ${json}= To JSON ${resp.content} |
| 176 | Should Be True ${json["data"]["Scale"]} == -3 |
| 177 | Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 178 | ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 179 | Should Be True ${vcs_temp} > 0 |
| 180 | END |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 181 | |
| 182 | |
| 183 | Verify VDD Temperature Sensors Attributes |
| 184 | [Documentation] Check vdd temperature attributes. |
| 185 | [Tags] Verify_VDD_Temperature_Sensors_Attributes |
| 186 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 187 | # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp |
| 188 | ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp |
| 189 | |
| 190 | # Example: |
| 191 | # Access the properties of the rail voltage and it should contain |
| 192 | # the following entries: |
| 193 | # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp |
| 194 | # { |
| 195 | # "Scale": -3, |
| 196 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 197 | # "Value": 4000 |
| 198 | # } |
| 199 | |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 200 | FOR ${entry} IN @{temp_vdd} |
| 201 | ${resp}= OpenBMC Get Request ${entry} |
| 202 | ${json}= To JSON ${resp.content} |
| 203 | Should Be True ${json["data"]["Scale"]} == -3 |
| 204 | Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 205 | ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 206 | Should Be True ${vdd_temp} > 0 |
| 207 | END |
Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 208 | |
| 209 | |
| 210 | Verify VDDR Temperature Sensors Attributes |
| 211 | [Documentation] Check vddr temperature attributes. |
| 212 | [Tags] Verify_VDDR_Temperature_Sensors_Attributes |
| 213 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 214 | # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp |
| 215 | ${temp_vddr}= |
| 216 | ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp |
| 217 | |
| 218 | # Example: |
| 219 | # Access the properties of the rail voltage and it should contain |
| 220 | # the following entries: |
| 221 | # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp |
| 222 | # { |
| 223 | # "Scale": -3, |
| 224 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 225 | # "Value": 4000 |
| 226 | # } |
| 227 | |
Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 228 | FOR ${entry} IN @{temp_vddr} |
| 229 | ${resp}= OpenBMC Get Request ${entry} |
| 230 | ${json}= To JSON ${resp.content} |
| 231 | Should Be True ${json["data"]["Scale"]} == -3 |
| 232 | Should Be Equal As Strings ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 233 | ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 234 | Should Be True ${vddr_temp} > 0 |
| 235 | END |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 236 | |
Jayashree-D | ea98230 | 2020-07-21 16:44:13 +0530 | [diff] [blame] | 237 | Verify Power Sensors Attributes |
| 238 | [Documentation] Check power sensor attributes. |
| 239 | [Tags] Verify_Power_Sensor_Attributes |
| 240 | # Example: |
| 241 | # /xyz/openbmc_project/sensors/power/power_1 |
| 242 | # /xyz/openbmc_project/sensors/power/power_2 |
| 243 | # /xyz/openbmc_project/sensors/power/power0 |
| 244 | # /xyz/openbmc_project/sensors/power/POWER1 |
| 245 | # /xyz/openbmc_project/sensors/power/POWER_1 |
| 246 | |
| 247 | ${power}= Get Endpoint Paths /xyz/openbmc_project/sensors/ power* |
| 248 | |
| 249 | # Access the properties of the power sensors and it should contain |
| 250 | # the following entries: |
| 251 | # /xyz/openbmc_project/sensors/power/power_1 |
| 252 | # { |
| 253 | # "MaxValue": 255.0, |
| 254 | # "MinValue": 0.0, |
| 255 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts", |
| 256 | # "Value": 0.0 |
| 257 | # } |
| 258 | |
| 259 | FOR ${entry} IN @{power} |
| 260 | ${resp}= OpenBMC Get Request ${entry} |
| 261 | ${json}= To JSON ${resp.content} |
| 262 | Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0 |
| 263 | Should Be True ${json["data"]["Value"]} >= 0 |
| 264 | END |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 265 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 266 | Verify Power Redundancy Using REST |
| 267 | [Documentation] Verify power redundancy is enabled. |
| 268 | [Tags] Verify_Power_Redundancy_Using_REST |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 269 | |
| 270 | # Example: |
| 271 | # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy |
| 272 | # { |
| 273 | # "error": 0, |
| 274 | # "units": "", |
| 275 | # "value": "Enabled" |
| 276 | # } |
| 277 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 278 | # Power Redundancy is a read-only attribute. It cannot be set. |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 279 | |
| 280 | # Pass if sensor is in /xyz and it's enabled. |
| 281 | ${redundancy_setting}= Read Attribute |
| 282 | ... ${OPENBMC_BASE_URI}control/power_supply_redundancy |
| 283 | ... PowerSupplyRedundancyEnabled |
| 284 | Should Be Equal As Integers ${redundancy_setting} ${1} |
| 285 | ... msg=PowerSupplyRedundancyEnabled not set as expected. |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 286 | |
| 287 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 288 | Verify Power Redundancy Using IPMI |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 289 | [Documentation] Verify IPMI reports Power Redundancy is enabled. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 290 | [Tags] Verify_Power_Redundancy_Using_IPMI |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 291 | |
| 292 | # Refer to data/ipmi_raw_cmd_table.py for command definition. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 293 | # Power Redundancy is a read-only attribute. It cannot be set. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 294 | |
| 295 | ${output}= Run IPMI Standard Command |
| 296 | ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]} |
| 297 | |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 298 | ${scanning}= Set Variable |
| 299 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]} |
| 300 | ${no_scanning}= Set Variable |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 301 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 302 | |
| 303 | ${enabled_scanning}= Evaluate $scanning in $output |
| 304 | ${enabled_no_scanning}= Evaluate $no_scanning in $output |
| 305 | |
| 306 | # Either enabled_scanning or enabled_noscanning should be True. |
| 307 | Should Be True ${enabled_scanning} or ${enabled_no_scanning} |
| 308 | ... msg=Failed IPMI power redundancy check, result=${output}. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 309 | |
| 310 | |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 311 | *** Keywords *** |
| 312 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 313 | Suite Setup Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 314 | [Documentation] Do the initial test suite setup. |
| 315 | # - Power off. |
| 316 | # - Boot Host. |
| 317 | REST Power Off stack_mode=skip |
| 318 | REST Power On |
| 319 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 320 | Test Teardown Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 321 | [Documentation] Do the post test teardown. |
| 322 | # - Capture FFDC on test failure. |
| 323 | # - Delete error logs. |
| 324 | # - Close all open SSH connections. |
| 325 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 326 | FFDC On Test Case Fail |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 327 | Delete All Error Logs |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 328 | Close All Connections |