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. |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 246 | ${resp}= Power Redundancy Setting getValue |
| 247 | ${content}= To Json ${resp.content} |
| 248 | Should Be Equal As Strings ${content["data"]} Enabled |
| 249 | |
| 250 | |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame^] | 251 | Verify Power Redundancy Using IPMI |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 252 | [Documentation] Enable power redundancy and verify that it is enabled. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame^] | 253 | [Tags] Verify_Power_Redundancy_Using_IPMI |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 254 | |
| 255 | # Refer to data/ipmi_raw_cmd_table.py for command definition. |
Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame^] | 256 | # Power Redundancy is a read-only attribute. It cannot be set. |
George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 257 | |
| 258 | ${output}= Run IPMI Standard Command |
| 259 | ... raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]} |
| 260 | |
| 261 | Should Be Equal As Strings |
| 262 | ... ${output.lstrip()} |
| 263 | ... ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} |
| 264 | ... msg=${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} = ${output}. |
| 265 | |
| 266 | |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 267 | *** Keywords *** |
| 268 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 269 | Suite Setup Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 270 | [Documentation] Do the initial test suite setup. |
| 271 | # - Power off. |
| 272 | # - Boot Host. |
| 273 | REST Power Off stack_mode=skip |
| 274 | REST Power On |
| 275 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 276 | Test Teardown Execution |
George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 277 | [Documentation] Do the post test teardown. |
| 278 | # - Capture FFDC on test failure. |
| 279 | # - Delete error logs. |
| 280 | # - Close all open SSH connections. |
| 281 | |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 282 | FFDC On Test Case Fail |
George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 283 | Delete All Error Logs |
George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 284 | Close All Connections |
| 285 | |
| 286 | Power Redundancy Setting |
| 287 | [Documentation] "Set" or "Get" power redundancy setting. |
| 288 | [Arguments] ${action} ${value}=${EMPTY} |
| 289 | |
| 290 | # Description of argument(s): |
| 291 | # action "setValue" or "getValue" API request string. |
| 292 | # value String argument for the API request (e.g. "Enabled"/"Disabled"). |
| 293 | |
| 294 | @{arglist}= Create List |
| 295 | Run Keyword If '${value}' != '${EMPTY}' |
| 296 | ... Append To List ${arglist} ${value} |
| 297 | |
| 298 | ${args}= Create Dictionary data=@{arglist} |
| 299 | ${resp}= Call Method ${SENSORS_URI}chassis/PowerSupplyRedundancy |
| 300 | ... ${action} data=${args} |
| 301 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 302 | |
| 303 | [Return] ${resp} |