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 | |
| 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 |
| 62 | ... Should Be True ${json["data"]["Target"]} >= 0 |
| 63 | \ Should Be Equal As Strings |
| 64 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.RPMS |
| 65 | \ Should Be True ${json["data"]["Value"]} >= 0 |
| 66 | |
| 67 | |
| 68 | Verify PCIE Sensors Attributes |
| 69 | [Documentation] Probe PCIE attributes. |
| 70 | [Tags] Verify_PCIE_Sensor_Attributes |
| 71 | # Example: |
| 72 | # /xyz/openbmc_project/sensors/temperature/pcie |
| 73 | ${temp_pcie}= Get Endpoint Paths /xyz/openbmc_project/sensors/ pcie |
| 74 | |
| 75 | # Access the properties of the PCIE and it should contain |
| 76 | # the following entries: |
| 77 | # /xyz/openbmc_project/sensors/temperature/pcie |
| 78 | # { |
| 79 | # "Scale": -3, |
| 80 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 81 | # "Value": 29625 |
| 82 | # } |
| 83 | |
| 84 | |
| 85 | :FOR ${entry} IN @{temp_pcie} |
| 86 | \ ${resp}= OpenBMC Get Request ${entry} |
| 87 | \ ${json}= To JSON ${resp.content} |
| 88 | \ Should Be True ${json["data"]["Scale"]} == -3 |
| 89 | \ Should Be Equal As Strings |
| 90 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 91 | \ ${temp_in_DegreeC}= Evaluate ${json["data"]["Value"]} / 1000 |
| 92 | \ Should Be True ${temp_in_DegreeC} > 0 |
| 93 | |
| 94 | |
| 95 | Verify Rail Voltage Sensors Attributes |
| 96 | [Documentation] Check rail voltage attributes. |
| 97 | [Tags] Verify_Rail_Voltage_Sensor_Attributes |
| 98 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 99 | # /xyz/openbmc_project/sensors/voltage/rail_1_voltage |
| 100 | # /xyz/openbmc_project/sensors/voltage/rail_2_voltage |
| 101 | ${temp_rail}= Get Endpoint Paths /xyz/openbmc_project/sensors/ rail* |
| 102 | |
| 103 | # Example: |
| 104 | # Access the properties of the rail voltage and it should contain |
| 105 | # the following entries: |
| 106 | # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage": |
| 107 | # { |
| 108 | # "Scale": -3, |
| 109 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts", |
| 110 | # "Value": 5097 |
| 111 | # }, |
| 112 | |
| 113 | :FOR ${entry} IN @{temp_rail} |
| 114 | \ ${resp}= OpenBMC Get Request ${entry} |
| 115 | \ ${json}= To JSON ${resp.content} |
| 116 | \ Should Be True ${json["data"]["Scale"]} == -3 |
| 117 | \ Should Be Equal As Strings |
| 118 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.Volts |
| 119 | \ ${volts}= Evaluate ${json["data"]["Value"]} / 1000 |
| 120 | \ Should Be True ${volts} > 0 |
| 121 | |
| 122 | |
| 123 | Verify VDN Temperature Sensors Attributes |
| 124 | [Documentation] Check vdn temperature attributes. |
| 125 | [Tags] Verify_VDN_Temperature_Sensors_Attributes |
| 126 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 127 | # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp |
| 128 | ${temp_vdn}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdn_temp |
| 129 | |
| 130 | # Example: |
| 131 | # Access the properties of the rail voltage and it should contain |
| 132 | # the following entries: |
| 133 | # /xyz/openbmc_project/sensors/temperature/p0_vdn_temp |
| 134 | # { |
| 135 | # "Scale": -3, |
| 136 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 137 | # "Value": 3000 |
| 138 | # } |
| 139 | |
| 140 | :FOR ${entry} IN @{temp_vdn} |
| 141 | \ ${resp}= OpenBMC Get Request ${entry} |
| 142 | \ ${json}= To JSON ${resp.content} |
| 143 | \ Should Be True ${json["data"]["Scale"]} == -3 |
| 144 | \ Should Be Equal As Strings |
| 145 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 146 | \ ${vdn_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 147 | \ Should Be True ${vdn_temp} > 0 |
| 148 | |
| 149 | |
| 150 | Verify VCS Temperature Sensors Attributes |
| 151 | [Documentation] Check vcs temperature attributes. |
| 152 | [Tags] Verify_VCS_Temperature_Sensors_Attributes |
| 153 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 154 | # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp |
| 155 | ${temp_vcs}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vcs_temp |
| 156 | |
| 157 | # Example: |
| 158 | # Access the properties of the rail voltage and it should contain |
| 159 | # the following entries: |
| 160 | # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp |
| 161 | # { |
| 162 | # "Scale": -3, |
| 163 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 164 | # "Value": 31000 |
| 165 | # }, |
| 166 | |
| 167 | |
| 168 | :FOR ${entry} IN @{temp_vcs} |
| 169 | \ ${resp}= OpenBMC Get Request ${entry} |
| 170 | \ ${json}= To JSON ${resp.content} |
| 171 | \ Should Be True ${json["data"]["Scale"]} == -3 |
| 172 | \ Should Be Equal As Strings |
| 173 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 174 | \ ${vcs_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 175 | \ Should Be True ${vcs_temp} > 0 |
| 176 | |
| 177 | |
| 178 | Verify VDD Temperature Sensors Attributes |
| 179 | [Documentation] Check vdd temperature attributes. |
| 180 | [Tags] Verify_VDD_Temperature_Sensors_Attributes |
| 181 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 182 | # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp |
| 183 | ${temp_vdd}= Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vdd_temp |
| 184 | |
| 185 | # Example: |
| 186 | # Access the properties of the rail voltage and it should contain |
| 187 | # the following entries: |
| 188 | # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp |
| 189 | # { |
| 190 | # "Scale": -3, |
| 191 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 192 | # "Value": 4000 |
| 193 | # } |
| 194 | |
| 195 | :FOR ${entry} IN @{temp_vdd} |
| 196 | \ ${resp}= OpenBMC Get Request ${entry} |
| 197 | \ ${json}= To JSON ${resp.content} |
| 198 | \ Should Be True ${json["data"]["Scale"]} == -3 |
| 199 | \ Should Be Equal As Strings |
| 200 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 201 | \ ${vdd_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 202 | \ Should Be True ${vdd_temp} > 0 |
| 203 | |
| 204 | |
| 205 | Verify VDDR Temperature Sensors Attributes |
| 206 | [Documentation] Check vddr temperature attributes. |
| 207 | [Tags] Verify_VDDR_Temperature_Sensors_Attributes |
| 208 | # Example of one of the entries returned by 'Get Endpoint Paths': |
| 209 | # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp |
| 210 | ${temp_vddr}= |
| 211 | ... Get Endpoint Paths /xyz/openbmc_project/sensors/ *_vddr_temp |
| 212 | |
| 213 | # Example: |
| 214 | # Access the properties of the rail voltage and it should contain |
| 215 | # the following entries: |
| 216 | # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp |
| 217 | # { |
| 218 | # "Scale": -3, |
| 219 | # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", |
| 220 | # "Value": 4000 |
| 221 | # } |
| 222 | |
| 223 | :FOR ${entry} IN @{temp_vddr} |
| 224 | \ ${resp}= OpenBMC Get Request ${entry} |
| 225 | \ ${json}= To JSON ${resp.content} |
| 226 | \ Should Be True ${json["data"]["Scale"]} == -3 |
| 227 | \ Should Be Equal As Strings |
| 228 | ... ${json["data"]["Unit"]} xyz.openbmc_project.Sensor.Value.Unit.DegreesC |
| 229 | \ ${vddr_temp}= Evaluate ${json["data"]["Value"]} / 1000 |
| 230 | \ Should Be True ${vddr_temp} > 0 |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 231 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 232 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 233 | Verify Power Redundancy Using REST |
| 234 | [Documentation] Verify power redundancy is enabled. |
| 235 | [Tags] Verify_Power_Redundancy_Using_REST |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 236 | |
| 237 | # Example: |
| 238 | # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy |
| 239 | # { |
| 240 | # "error": 0, |
| 241 | # "units": "", |
| 242 | # "value": "Enabled" |
| 243 | # } |
| 244 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 245 | # Power Redundancy is a read-only attribute. It cannot be set. |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 246 | |
| 247 | # Pass if sensor is in /xyz and it's enabled. |
| 248 | ${redundancy_setting}= Read Attribute |
| 249 | ... ${OPENBMC_BASE_URI}control/power_supply_redundancy |
| 250 | ... PowerSupplyRedundancyEnabled |
| 251 | Should Be Equal As Integers ${redundancy_setting} ${1} |
| 252 | ... msg=PowerSupplyRedundancyEnabled not set as expected. |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 253 | |
| 254 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 255 | Verify Power Redundancy Using IPMI |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 256 | [Documentation] Verify IPMI reports Power Redundancy is enabled. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 257 | [Tags] Verify_Power_Redundancy_Using_IPMI |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 258 | |
| 259 | # Refer to data/ipmi_raw_cmd_table.py for command definition. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 260 | # Power Redundancy is a read-only attribute. It cannot be set. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 261 | |
| 262 | ${output}= Run IPMI Standard Command |
| 263 | ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]} |
| 264 | |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 265 | ${scanning}= Set Variable |
| 266 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]} |
| 267 | ${no_scanning}= Set Variable |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 268 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} |
Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 269 | |
| 270 | ${enabled_scanning}= Evaluate $scanning in $output |
| 271 | ${enabled_no_scanning}= Evaluate $no_scanning in $output |
| 272 | |
| 273 | # Either enabled_scanning or enabled_noscanning should be True. |
| 274 | Should Be True ${enabled_scanning} or ${enabled_no_scanning} |
| 275 | ... msg=Failed IPMI power redundancy check, result=${output}. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 276 | |
| 277 | |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 278 | *** Keywords *** |
| 279 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 280 | Suite Setup Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 281 | [Documentation] Do the initial test suite setup. |
| 282 | # - Power off. |
| 283 | # - Boot Host. |
| 284 | REST Power Off stack_mode=skip |
| 285 | REST Power On |
| 286 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 287 | Test Teardown Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 288 | [Documentation] Do the post test teardown. |
| 289 | # - Capture FFDC on test failure. |
| 290 | # - Delete error logs. |
| 291 | # - Close all open SSH connections. |
| 292 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 293 | FFDC On Test Case Fail |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 294 | Delete All Error Logs |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 295 | Close All Connections |