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 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 229 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 230 | Verify Power Redundancy Using REST |
| 231 | [Documentation] Verify power redundancy is enabled. |
| 232 | [Tags] Verify_Power_Redundancy_Using_REST |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 233 | |
| 234 | # Example: |
| 235 | # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy |
| 236 | # { |
| 237 | # "error": 0, |
| 238 | # "units": "", |
| 239 | # "value": "Enabled" |
| 240 | # } |
| 241 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 242 | # Power Redundancy is a read-only attribute. It cannot be set. |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 243 | |
| 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 Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 250 | |
| 251 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 252 | Verify Power Redundancy Using IPMI |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 253 | [Documentation] Verify IPMI reports Power Redundancy is enabled. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 254 | [Tags] Verify_Power_Redundancy_Using_IPMI |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 255 | |
| 256 | # Refer to data/ipmi_raw_cmd_table.py for command definition. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 257 | # Power Redundancy is a read-only attribute. It cannot be set. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 258 | |
| 259 | ${output}= Run IPMI Standard Command |
| 260 | ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]} |
| 261 | |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 262 | ${scanning}= Set Variable |
| 263 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]} |
| 264 | ${no_scanning}= Set Variable |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 265 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 266 | |
| 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 Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 273 | |
| 274 | |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 275 | *** Keywords *** |
| 276 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 277 | Suite Setup Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 278 | [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 Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 284 | Test Teardown Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 285 | [Documentation] Do the post test teardown. |
| 286 | # - Capture FFDC on test failure. |
| 287 | # - Delete error logs. |
| 288 | # - Close all open SSH connections. |
| 289 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 290 | FFDC On Test Case Fail |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 291 | Delete All Error Logs |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 292 | Close All Connections |