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 |
| 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 Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 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 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 Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 65 | |
| 66 | Verify 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 Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 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 ${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 Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 91 | |
| 92 | |
| 93 | Verify 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 Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 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 ${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 Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 119 | |
| 120 | |
| 121 | Verify 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 Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 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 ${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 Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 146 | |
| 147 | Verify 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 Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 165 | 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 Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 173 | |
| 174 | |
| 175 | Verify 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 Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 192 | 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 Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 200 | |
| 201 | |
| 202 | Verify 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 Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 220 | 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 Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 228 | |
Jayashree-D | ea98230 | 2020-07-21 16:44:13 +0530 | [diff] [blame] | 229 | Verify Power Sensors Attributes |
| 230 | [Documentation] Check power sensor attributes. |
| 231 | [Tags] Verify_Power_Sensor_Attributes |
| 232 | # Example: |
| 233 | # /xyz/openbmc_project/sensors/power/power_1 |
| 234 | # /xyz/openbmc_project/sensors/power/power_2 |
| 235 | # /xyz/openbmc_project/sensors/power/power0 |
| 236 | # /xyz/openbmc_project/sensors/power/POWER1 |
| 237 | # /xyz/openbmc_project/sensors/power/POWER_1 |
| 238 | |
| 239 | ${power}= Get Endpoint Paths /xyz/openbmc_project/sensors/ power* |
| 240 | |
| 241 | # Access the properties of the power sensors and it should contain |
| 242 | # the following entries: |
| 243 | # /xyz/openbmc_project/sensors/power/power_1 |
| 244 | # { |
| 245 | # "MaxValue": 255.0, |
| 246 | # "MinValue": 0.0, |
| 247 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts", |
| 248 | # "Value": 0.0 |
| 249 | # } |
| 250 | |
| 251 | FOR ${entry} IN @{power} |
| 252 | ${resp}= OpenBMC Get Request ${entry} |
| 253 | ${json}= To JSON ${resp.content} |
| 254 | Run Keyword And Ignore Error Should Be True ${json["data"]["Target"]} >= 0 |
| 255 | Should Be True ${json["data"]["Value"]} >= 0 |
| 256 | END |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 257 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 258 | Verify Power Redundancy Using REST |
| 259 | [Documentation] Verify power redundancy is enabled. |
| 260 | [Tags] Verify_Power_Redundancy_Using_REST |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 261 | |
| 262 | # Example: |
| 263 | # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy |
| 264 | # { |
| 265 | # "error": 0, |
| 266 | # "units": "", |
| 267 | # "value": "Enabled" |
| 268 | # } |
| 269 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 270 | # Power Redundancy is a read-only attribute. It cannot be set. |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 271 | |
| 272 | # Pass if sensor is in /xyz and it's enabled. |
| 273 | ${redundancy_setting}= Read Attribute |
| 274 | ... ${OPENBMC_BASE_URI}control/power_supply_redundancy |
| 275 | ... PowerSupplyRedundancyEnabled |
| 276 | Should Be Equal As Integers ${redundancy_setting} ${1} |
| 277 | ... msg=PowerSupplyRedundancyEnabled not set as expected. |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 278 | |
| 279 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 280 | Verify Power Redundancy Using IPMI |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 281 | [Documentation] Verify IPMI reports Power Redundancy is enabled. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 282 | [Tags] Verify_Power_Redundancy_Using_IPMI |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 283 | |
| 284 | # Refer to data/ipmi_raw_cmd_table.py for command definition. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 285 | # Power Redundancy is a read-only attribute. It cannot be set. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 286 | |
| 287 | ${output}= Run IPMI Standard Command |
| 288 | ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]} |
| 289 | |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 290 | ${scanning}= Set Variable |
| 291 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]} |
| 292 | ${no_scanning}= Set Variable |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 293 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 294 | |
| 295 | ${enabled_scanning}= Evaluate $scanning in $output |
| 296 | ${enabled_no_scanning}= Evaluate $no_scanning in $output |
| 297 | |
| 298 | # Either enabled_scanning or enabled_noscanning should be True. |
| 299 | Should Be True ${enabled_scanning} or ${enabled_no_scanning} |
| 300 | ... msg=Failed IPMI power redundancy check, result=${output}. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 301 | |
| 302 | |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 303 | *** Keywords *** |
| 304 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 305 | Suite Setup Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 306 | [Documentation] Do the initial test suite setup. |
| 307 | # - Power off. |
| 308 | # - Boot Host. |
| 309 | REST Power Off stack_mode=skip |
| 310 | REST Power On |
| 311 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 312 | Test Teardown Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 313 | [Documentation] Do the post test teardown. |
| 314 | # - Capture FFDC on test failure. |
| 315 | # - Delete error logs. |
| 316 | # - Close all open SSH connections. |
| 317 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 318 | FFDC On Test Case Fail |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 319 | Delete All Error Logs |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 320 | Close All Connections |