| 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 | # { | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 24 | #     "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 25 | #     "Value": 25.767 | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 26 | # } | 
|  | 27 |  | 
|  | 28 | ${temp_data}=  Read Properties  ${SENSORS_URI}temperature/ambient | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 29 | Should Be Equal As Strings | 
|  | 30 | ...  ${temp_data["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.DegreesC | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 31 | Should Be True  ${temp_data["Value"]} <= ${50} | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 32 | ...  msg=System working temperature crossed 50 degree celsius. | 
|  | 33 |  | 
| Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 34 |  | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 35 | Verify Fan Sensors Attributes | 
|  | 36 | [Documentation]  Check fan attributes. | 
| George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 37 | [Tags]  Verify_Fan_Sensors_Attributes | 
| George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 38 |  | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 39 | # Example: | 
| George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 40 | # "/xyz/openbmc_project/sensors/fan_tach/fan0_0", | 
|  | 41 | # "/xyz/openbmc_project/sensors/fan_tach/fan0_1", | 
|  | 42 | # "/xyz/openbmc_project/sensors/fan_tach/fan1_0", | 
|  | 43 | # "/xyz/openbmc_project/sensors/fan_tach/fan1_1", | 
|  | 44 | # "/xyz/openbmc_project/sensors/fan_tach/fan2_0", | 
|  | 45 | # "/xyz/openbmc_project/sensors/fan_tach/fan2_1", | 
|  | 46 | # "/xyz/openbmc_project/sensors/fan_tach/fan3_0", | 
|  | 47 | # "/xyz/openbmc_project/sensors/fan_tach/fan3_1" | 
|  | 48 |  | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 49 | ${fans}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/  fan* | 
|  | 50 |  | 
|  | 51 | # Access the properties of the fan and it should contain | 
|  | 52 | # the following entries: | 
| George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 53 | # /xyz/openbmc_project/sensors/fan_tach/fan0_0 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 54 | # { | 
| George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 55 | #     "Functional": true, | 
|  | 56 | #     "MaxValue": 0.0, | 
|  | 57 | #     "MinValue": 0.0, | 
|  | 58 | #     "Target": 10500, | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 59 | #     "Unit": "xyz.openbmc_project.Sensor.Value.Unit.RPMS", | 
| George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 60 | #     "Value": 0.0 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 61 | # } | 
|  | 62 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 63 | FOR  ${entry}  IN  @{fans} | 
|  | 64 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 65 | ${json}=  To JSON  ${resp.content} | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 66 | Run Keyword And Ignore Error  Should Be True  ${json["data"]["Target"]} >= 0 | 
| George Keishing | 28f7405 | 2020-07-20 09:02:50 -0500 | [diff] [blame] | 67 | Run Keyword And Ignore Error  Should Be Equal As Strings | 
|  | 68 | ...  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.RPMS | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 69 | Should Be True  ${json["data"]["Value"]} >= 0 | 
|  | 70 | END | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 71 |  | 
|  | 72 | Verify PCIE Sensors Attributes | 
|  | 73 | [Documentation]  Probe PCIE attributes. | 
| George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 74 | [Tags]  Verify_PCIE_Sensors_Attributes | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 75 | # Example: | 
|  | 76 | # /xyz/openbmc_project/sensors/temperature/pcie | 
|  | 77 | ${temp_pcie}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/  pcie | 
|  | 78 |  | 
|  | 79 | # Access the properties of the PCIE and it should contain | 
|  | 80 | # the following entries: | 
|  | 81 | # /xyz/openbmc_project/sensors/temperature/pcie | 
|  | 82 | # { | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 83 | #    "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 84 | #    "Value": 29.625 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 85 | # } | 
|  | 86 |  | 
|  | 87 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 88 | FOR  ${entry}  IN  @{temp_pcie} | 
|  | 89 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 90 | ${json}=  To JSON  ${resp.content} | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 91 | Should Be Equal As Strings  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.DegreesC | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 92 | Should Be True  ${json["data"]["Value"]} > 0 | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 93 | END | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 94 |  | 
|  | 95 |  | 
|  | 96 | Verify Rail Voltage Sensors Attributes | 
|  | 97 | [Documentation]  Check rail voltage attributes. | 
| George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 98 | [Tags]  Verify_Rail_Voltage_Sensors_Attributes | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 99 | # Example of one of the entries returned by 'Get Endpoint Paths': | 
|  | 100 | # /xyz/openbmc_project/sensors/voltage/rail_1_voltage | 
|  | 101 | # /xyz/openbmc_project/sensors/voltage/rail_2_voltage | 
|  | 102 | ${temp_rail}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/  rail* | 
|  | 103 |  | 
|  | 104 | # Example: | 
|  | 105 | # Access the properties of the rail voltage and it should contain | 
|  | 106 | # the following entries: | 
|  | 107 | # "/xyz/openbmc_project/sensors/voltage/rail_1_voltage": | 
|  | 108 | # { | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 109 | #    "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Volts", | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 110 | #    "Value": 5.097 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 111 | # }, | 
|  | 112 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 113 | FOR  ${entry}  IN  @{temp_rail} | 
|  | 114 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 115 | ${json}=  To JSON  ${resp.content} | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 116 | Should Be Equal As Strings  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.Volts | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 117 | Should Be True  ${json["data"]["Value"]} > 0 | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 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 | # { | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 133 | #    "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 134 | #    "Value": 3.000 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 135 | # } | 
|  | 136 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 137 | FOR  ${entry}  IN  @{temp_vdn} | 
|  | 138 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 139 | ${json}=  To JSON  ${resp.content} | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 140 | Should Be Equal As Strings  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.DegreesC | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 141 | Should Be True  ${json["data"]["Value"]} > 0 | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 142 | END | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 143 |  | 
|  | 144 | Verify VCS Temperature Sensors Attributes | 
|  | 145 | [Documentation]  Check vcs temperature attributes. | 
|  | 146 | [Tags]  Verify_VCS_Temperature_Sensors_Attributes | 
|  | 147 | # Example of one of the entries returned by 'Get Endpoint Paths': | 
|  | 148 | # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp | 
|  | 149 | ${temp_vcs}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/  *_vcs_temp | 
|  | 150 |  | 
|  | 151 | # Example: | 
|  | 152 | # Access the properties of the rail voltage and it should contain | 
|  | 153 | # the following entries: | 
|  | 154 | # /xyz/openbmc_project/sensors/temperature/p0_vcs_temp | 
|  | 155 | # { | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 156 | #     "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 157 | #     "Value": 31.000 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 158 | # }, | 
|  | 159 |  | 
|  | 160 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 161 | FOR  ${entry}  IN  @{temp_vcs} | 
|  | 162 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 163 | ${json}=  To JSON  ${resp.content} | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 164 | Should Be Equal As Strings  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.DegreesC | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 165 | Should Be True  ${json["data"]["Value"]} > 0 | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 166 | END | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 167 |  | 
|  | 168 |  | 
|  | 169 | Verify VDD Temperature Sensors Attributes | 
|  | 170 | [Documentation]  Check vdd temperature attributes. | 
|  | 171 | [Tags]  Verify_VDD_Temperature_Sensors_Attributes | 
|  | 172 | # Example of one of the entries returned by 'Get Endpoint Paths': | 
|  | 173 | # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp | 
|  | 174 | ${temp_vdd}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/  *_vdd_temp | 
|  | 175 |  | 
|  | 176 | # Example: | 
|  | 177 | # Access the properties of the rail voltage and it should contain | 
|  | 178 | # the following entries: | 
|  | 179 | # /xyz/openbmc_project/sensors/temperature/p0_vdd_temp | 
|  | 180 | # { | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 181 | #     "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 182 | #     "Value": 4.000 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 183 | # } | 
|  | 184 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 185 | FOR  ${entry}  IN  @{temp_vdd} | 
|  | 186 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 187 | ${json}=  To JSON  ${resp.content} | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 188 | Should Be Equal As Strings  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.DegreesC | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 189 | Should Be True  ${json["data"]["Value"]} > 0 | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 190 | END | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 191 |  | 
|  | 192 |  | 
|  | 193 | Verify VDDR Temperature Sensors Attributes | 
|  | 194 | [Documentation]  Check vddr temperature attributes. | 
|  | 195 | [Tags]  Verify_VDDR_Temperature_Sensors_Attributes | 
|  | 196 | # Example of one of the entries returned by 'Get Endpoint Paths': | 
|  | 197 | # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp | 
|  | 198 | ${temp_vddr}= | 
|  | 199 | ...  Get Endpoint Paths  /xyz/openbmc_project/sensors/  *_vddr_temp | 
|  | 200 |  | 
|  | 201 | # Example: | 
|  | 202 | # Access the properties of the rail voltage and it should contain | 
|  | 203 | # the following entries: | 
|  | 204 | # /xyz/openbmc_project/sensors/temperature/p0_vddr_temp | 
|  | 205 | # { | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 206 | #     "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC", | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 207 | #     "Value": 4.000 | 
| Sweta Potthuri | cca07de | 2017-09-26 06:14:23 -0500 | [diff] [blame] | 208 | # } | 
|  | 209 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 210 | FOR  ${entry}  IN  @{temp_vddr} | 
|  | 211 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 212 | ${json}=  To JSON  ${resp.content} | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 213 | Should Be Equal As Strings  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.DegreesC | 
| Konstantin Aladyshev | 2ac4d4f | 2021-03-20 23:36:39 +0300 | [diff] [blame] | 214 | Should Be True  ${json["data"]["Value"]} > 0 | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 215 | END | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 216 |  | 
| Jayashree-D | ea98230 | 2020-07-21 16:44:13 +0530 | [diff] [blame] | 217 | Verify Power Sensors Attributes | 
|  | 218 | [Documentation]  Check power sensor attributes. | 
| George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 219 | [Tags]  Verify_Power_Sensors_Attributes | 
| Jayashree-D | ea98230 | 2020-07-21 16:44:13 +0530 | [diff] [blame] | 220 | # Example: | 
|  | 221 | # /xyz/openbmc_project/sensors/power/power_1 | 
|  | 222 | # /xyz/openbmc_project/sensors/power/power_2 | 
|  | 223 | # /xyz/openbmc_project/sensors/power/power0 | 
|  | 224 | # /xyz/openbmc_project/sensors/power/POWER1 | 
|  | 225 | # /xyz/openbmc_project/sensors/power/POWER_1 | 
|  | 226 |  | 
|  | 227 | ${power}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/  power* | 
|  | 228 |  | 
|  | 229 | # Access the properties of the power sensors and it should contain | 
|  | 230 | # the following entries: | 
|  | 231 | # /xyz/openbmc_project/sensors/power/power_1 | 
|  | 232 | # { | 
|  | 233 | #     "MaxValue": 255.0, | 
|  | 234 | #     "MinValue": 0.0, | 
|  | 235 | #     "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts", | 
|  | 236 | #     "Value": 0.0 | 
|  | 237 | # } | 
|  | 238 |  | 
|  | 239 | FOR  ${entry}  IN  @{power} | 
|  | 240 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 241 | ${json}=  To JSON  ${resp.content} | 
|  | 242 | Run Keyword And Ignore Error  Should Be True  ${json["data"]["Target"]} >= 0 | 
|  | 243 | Should Be True  ${json["data"]["Value"]} >= 0 | 
|  | 244 | END | 
| George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 245 |  | 
| Jayashree-D | fe793fa | 2020-07-27 20:26:09 +0530 | [diff] [blame] | 246 |  | 
|  | 247 | Verify Voltage Sensors Attributes | 
|  | 248 | [Documentation]  Check voltage sensors attributes. | 
| George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 249 | [Tags]  Verify_Voltage_Sensors_Attributes | 
| Jayashree-D | fe793fa | 2020-07-27 20:26:09 +0530 | [diff] [blame] | 250 |  | 
|  | 251 | # Example: | 
|  | 252 | # "/xyz/openbmc_project/sensors/voltage/voltage0", | 
| George Keishing | 16b3c7b | 2021-01-28 09:23:37 -0600 | [diff] [blame] | 253 | # "/xyz/openbmc_project/sensors/voltage/voltage_1", | 
| Jayashree-D | fe793fa | 2020-07-27 20:26:09 +0530 | [diff] [blame] | 254 | # "/xyz/openbmc_project/sensors/voltage/VOLTAGE_2", | 
|  | 255 | # "/xyz/openbmc_project/sensors/voltage/VOLTAGE1", | 
|  | 256 | # "/xyz/openbmc_project/sensors/voltage/voltage". | 
|  | 257 |  | 
|  | 258 | ${voltage}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/voltage/  * | 
|  | 259 |  | 
|  | 260 | # Access the properties of the voltage sensors and it should contain | 
|  | 261 | # the following entries: | 
|  | 262 | # /xyz/openbmc_project/sensors/voltage/voltage0 | 
|  | 263 | # { | 
|  | 264 | #     "MaxValue": 255.0, | 
|  | 265 | #     "MinValue": 0.0, | 
|  | 266 | #     "Unit": xyz.openbmc_project.Sensor.Value.Unit.Volts | 
|  | 267 | #     "Value": 0.0 | 
|  | 268 | # } | 
|  | 269 |  | 
|  | 270 | FOR  ${entry}  IN  @{voltage} | 
|  | 271 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 272 | ${json}=  To JSON  ${resp.content} | 
|  | 273 | Run Keyword And Ignore Error  Should Be Equal As Strings | 
|  | 274 | ...  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.Volts | 
|  | 275 | Run Keyword And Ignore Error  Should Be True  ${json["data"]["Value"]} >= 0 | 
|  | 276 | END | 
|  | 277 |  | 
|  | 278 |  | 
|  | 279 | Verify Current Sensors Attributes | 
|  | 280 | [Documentation]  Check current sensors attributes. | 
| George Keishing | ac8661e | 2022-02-10 00:36:12 -0600 | [diff] [blame] | 281 | [Tags]  Verify_Current_Sensors_Attributes | 
| Jayashree-D | fe793fa | 2020-07-27 20:26:09 +0530 | [diff] [blame] | 282 |  | 
|  | 283 | # Example: | 
|  | 284 | # "/xyz/openbmc_project/sensors/current/current0", | 
|  | 285 | # "/xyz/openbmc_project/sensors/current/current_1", | 
|  | 286 | # "/xyz/openbmc_project/sensors/current/CURRENT_2", | 
|  | 287 | # "/xyz/openbmc_project/sensors/current/CURRENT1", | 
|  | 288 | # "/xyz/openbmc_project/sensors/current/current". | 
|  | 289 |  | 
|  | 290 | ${current}=  Get Endpoint Paths  /xyz/openbmc_project/sensors/  curr* | 
|  | 291 |  | 
|  | 292 | # Access the properties of the current sensors and it should contain | 
|  | 293 | # the following entries: | 
|  | 294 | # /xyz/openbmc_project/sensors/current/current0 | 
|  | 295 | # { | 
|  | 296 | #     "MaxValue": 255.0, | 
|  | 297 | #     "MinValue": 0.0, | 
|  | 298 | #     "Unit": xyz.openbmc_project.Sensor.Value.Unit.Amperes | 
|  | 299 | #     "Value": 0.0 | 
|  | 300 | # } | 
|  | 301 |  | 
|  | 302 | FOR  ${entry}  IN  @{current} | 
|  | 303 | ${resp}=  OpenBMC Get Request  ${entry} | 
|  | 304 | ${json}=  To JSON  ${resp.content} | 
|  | 305 | Run Keyword And Ignore Error  Should Be Equal As Strings | 
|  | 306 | ...  ${json["data"]["Unit"]}  xyz.openbmc_project.Sensor.Value.Unit.Amperes | 
|  | 307 | Should Be True  ${json["data"]["Value"]} >= 0 | 
|  | 308 | END | 
|  | 309 |  | 
|  | 310 |  | 
| Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 311 | Verify Power Redundancy Using REST | 
|  | 312 | [Documentation]  Verify power redundancy is enabled. | 
|  | 313 | [Tags]  Verify_Power_Redundancy_Using_REST | 
| George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 314 |  | 
|  | 315 | # Example: | 
|  | 316 | # /xyz/openbmc_project/sensors/chassis/PowerSupplyRedundancy | 
|  | 317 | # { | 
|  | 318 | #     "error": 0, | 
|  | 319 | #     "units": "", | 
|  | 320 | #     "value": "Enabled" | 
|  | 321 | # } | 
|  | 322 |  | 
| Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 323 | # Power Redundancy is a read-only attribute.  It cannot be set. | 
| Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 324 |  | 
|  | 325 | # Pass if sensor is in /xyz and it's enabled. | 
|  | 326 | ${redundancy_setting}=  Read Attribute | 
|  | 327 | ...  ${OPENBMC_BASE_URI}control/power_supply_redundancy | 
|  | 328 | ...  PowerSupplyRedundancyEnabled | 
|  | 329 | Should Be Equal As Integers  ${redundancy_setting}  ${1} | 
|  | 330 | ...  msg=PowerSupplyRedundancyEnabled not set as expected. | 
| George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 331 |  | 
|  | 332 |  | 
| Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 333 | Verify Power Redundancy Using IPMI | 
| Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 334 | [Documentation]  Verify IPMI reports Power Redundancy is enabled. | 
| Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 335 | [Tags]  Verify_Power_Redundancy_Using_IPMI | 
| George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 336 |  | 
|  | 337 | # Refer to data/ipmi_raw_cmd_table.py for command definition. | 
| Steven Sombar | eabeccf | 2018-09-06 11:41:12 -0500 | [diff] [blame] | 338 | # Power Redundancy is a read-only attribute.  It cannot be set. | 
| George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 339 |  | 
|  | 340 | ${output}=  Run IPMI Standard Command | 
|  | 341 | ...  raw ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][0]} | 
|  | 342 |  | 
| Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 343 | ${scanning}=  Set Variable | 
|  | 344 | ...  ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][5]} | 
|  | 345 | ${no_scanning}=  Set Variable | 
| George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 346 | ...  ${IPMI_RAW_CMD['power_supply_redundancy']['Get'][3]} | 
| Steven Sombar | 27c1ad4 | 2018-09-11 14:44:25 -0500 | [diff] [blame] | 347 |  | 
|  | 348 | ${enabled_scanning}=  Evaluate  $scanning in $output | 
|  | 349 | ${enabled_no_scanning}=  Evaluate  $no_scanning in $output | 
|  | 350 |  | 
|  | 351 | # Either enabled_scanning or enabled_noscanning should be True. | 
|  | 352 | Should Be True  ${enabled_scanning} or ${enabled_no_scanning} | 
|  | 353 | ...  msg=Failed IPMI power redundancy check, result=${output}. | 
| George Keishing | dcf746b | 2018-02-06 12:43:44 -0600 | [diff] [blame] | 354 |  | 
|  | 355 |  | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 356 | *** Keywords *** | 
|  | 357 |  | 
| George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 358 | Suite Setup Execution | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 359 | [Documentation]  Do the initial test suite setup. | 
|  | 360 | # - Power off. | 
|  | 361 | # - Boot Host. | 
|  | 362 | REST Power Off  stack_mode=skip | 
|  | 363 | REST Power On | 
|  | 364 |  | 
| George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 365 | Test Teardown Execution | 
| George Keishing | 0657247 | 2017-09-01 11:33:01 -0500 | [diff] [blame] | 366 | [Documentation]  Do the post test teardown. | 
|  | 367 | # - Capture FFDC on test failure. | 
|  | 368 | # - Delete error logs. | 
|  | 369 | # - Close all open SSH connections. | 
|  | 370 |  | 
| George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 371 | FFDC On Test Case Fail | 
| George Keishing | 32fe4e1 | 2018-07-13 05:06:47 -0500 | [diff] [blame] | 372 | Delete All Error Logs | 
| George Keishing | 8bf8ed7 | 2017-12-07 04:01:45 -0600 | [diff] [blame] | 373 | Close All Connections |