| Marissa Garza | 270a411 | 2019-10-08 11:36:58 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Check the indicator LEDs on the system can set the assert |
| 3 | ... property to the correct state. |
| 4 | |
| 5 | Resource ../../lib/rest_client.robot |
| 6 | Resource ../../lib/bmc_redfish_resource.robot |
| 7 | Resource ../../lib/bmc_redfish_utils.robot |
| 8 | Resource ../../lib/openbmc_ffdc.robot |
| 9 | Resource ../../lib/resource.robot |
| 10 | Resource ../../lib/boot_utils.robot |
| 11 | Library ../../lib/gen_robot_valid.py |
| 12 | Library ../../lib/gen_robot_keyword.py |
| 13 | |
| 14 | Suite Setup Suite Setup Execution |
| 15 | Suite Teardown Suite Teardown Execution |
| 16 | Test Setup Printn |
| 17 | Test Teardown Test Teardown Execution |
| 18 | |
| Igor Kanyuka | feb79d6 | 2025-10-20 21:24:03 +0100 | [diff] [blame^] | 19 | Test Tags Led_Indicator_Asserted |
| Marissa Garza | 270a411 | 2019-10-08 11:36:58 -0500 | [diff] [blame] | 20 | |
| 21 | *** Test Cases *** |
| 22 | |
| 23 | Verify LED Lamp Test Asserted At Standby |
| 24 | [Documentation] Verify the LED asserted at standby is set to off or blinking. |
| 25 | [Tags] Verify_LED_Lamp_Test_Asserted_At_Standby |
| 26 | [Template] Set and Verify Lamp LED Indicator |
| 27 | |
| 28 | # pre_req_state asserted expected_indicator_led |
| 29 | Off 1 Blinking |
| 30 | Off 0 Off |
| 31 | |
| 32 | |
| 33 | Verify LED Lamp Test Asserted At Runtime |
| 34 | [Documentation] Verify the LED asserted at runtime is set to off or blinking. |
| 35 | [Tags] Verify_LED_Lamp_Test_Asserted_At_Runtime |
| 36 | [Template] Set and Verify Lamp LED Indicator |
| 37 | |
| 38 | # pre_req_state asserted expected_indicator_led |
| 39 | On 1 Blinking |
| 40 | On 0 Off |
| 41 | |
| 42 | |
| 43 | Verify LED Power Supply Units Asserted At Standby |
| 44 | [Documentation] Verify the power supply units are asserted at standby to lit or off. |
| 45 | [Tags] Verify_LED_Power_Supply_Units_Asserted_At_Standby |
| 46 | [Template] Set and Verify LED Indicator |
| 47 | |
| 48 | # pre_req_state asserted expected_indicator_led |
| 49 | Off "xyz.openbmc_project.Led.Physical.Action.On" Lit |
| 50 | Off "xyz.openbmc_project.Led.Physical.Action.Off" Off |
| 51 | |
| 52 | |
| 53 | Verify LED Power Supply Units Asserted At Runtime |
| 54 | [Documentation] Verify the power supply units are asserted at runtime to lit or off. |
| 55 | [Tags] Verify_LED_Power_Supply_Units_Asserted_At_Runtime |
| 56 | [Template] Set and Verify LED Indicator |
| 57 | |
| 58 | # pre_req_state asserted expected_indicator_led |
| 59 | On "xyz.openbmc_project.Led.Physical.Action.On" Lit |
| 60 | On "xyz.openbmc_project.Led.Physical.Action.Off" Off |
| 61 | |
| 62 | |
| Marissa Garza | 3fc3405 | 2019-10-28 14:13:13 -0500 | [diff] [blame] | 63 | Verify LED Fans Asserted At Standby |
| 64 | [Documentation] Verify the fans are asserted at standby to lit or off. |
| 65 | [Tags] Verify_LED_Fans_Asserted_At_Standby |
| 66 | [Template] Set and Verify Fan LED Indicators |
| 67 | |
| 68 | # pre_req_state asserted expected_indicator_led |
| 69 | Off "xyz.openbmc_project.Led.Physical.Action.On" Lit |
| 70 | Off "xyz.openbmc_project.Led.Physical.Action.Off" Off |
| 71 | |
| 72 | |
| 73 | Verify LED Fans Asserted At Runtime |
| 74 | [Documentation] Verify the fans are asserted at runtime to lit or off. |
| 75 | [Tags] Verify_LED_Fans_Asserted_At_Runtime |
| 76 | [Template] Set and Verify Fan LED Indicators |
| 77 | |
| 78 | # pre_req_state asserted expected_indicator_led |
| 79 | On "xyz.openbmc_project.Led.Physical.Action.On" Lit |
| 80 | On "xyz.openbmc_project.Led.Physical.Action.Off" Off |
| 81 | |
| 82 | |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 83 | Verify Location Indicator Active status |
| 84 | [Documentation] Verify the Location Indicator Active status to true or false. |
| 85 | [Tags] Verify_Location_Indicator_Active_status |
| 86 | [setup] Set Suite LED Indicator Initial Value |
| George Keishing | c63bfe6 | 2023-11-15 19:09:59 +0530 | [diff] [blame] | 87 | [Teardown] Set Initial Value ${value} |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 88 | |
| 89 | |
| 90 | Set And Verify LED Location Indicator Active ${set_value} |
| 91 | |
| 92 | |
| Marissa Garza | 270a411 | 2019-10-08 11:36:58 -0500 | [diff] [blame] | 93 | *** Keywords *** |
| 94 | |
| 95 | Set and Verify Lamp LED Indicator |
| 96 | [Documentation] Verify the indicator LED for the group lamp test is asserted. |
| 97 | [Arguments] ${pre_req_state} ${asserted} ${expected_indicator_led} |
| 98 | |
| 99 | # Description of Arguments(s): |
| 100 | # pre_req_state The pre-requisite state of the host to perform the test (e.g. "On") |
| 101 | # asserted The assert property that sets the value to 0 - Off or 1 - Blinking (e.g. "1") |
| 102 | # expected_indicator_led The expected value of the IndicatorLED attribute for all the |
| 103 | # LEDs after the lamp test is initiated (e.g. "Blinking") |
| 104 | |
| 105 | Run Key U Redfish Power ${pre_req_state} \ stack_mode=skip \ quiet=1 |
| 106 | Redfish.Login |
| 107 | |
| 108 | Redfish.Put ${LED_LAMP_TEST_ASSERTED_URI}attr/Asserted body={"data":${asserted}} |
| 109 | |
| 110 | # Example result: |
| 111 | # power_supplies: |
| 112 | # [0]: |
| 113 | # [MemberId]: powersupply0 |
| 114 | # [PartNumber]: 02CL396 |
| 115 | # [IndicatorLED]: Blinking |
| 116 | # [EfficiencyPercent]: 90 |
| 117 | # [Status]: |
| 118 | # [Health]: OK |
| 119 | # [State]: Enabled |
| 120 | |
| 121 | Verify Indicator LEDs ${expected_indicator_led} |
| 122 | |
| 123 | |
| 124 | Set and Verify LED Indicator |
| 125 | [Documentation] Verify the indicator LED for the power supply units are asserted. |
| 126 | [Arguments] ${pre_req_state} ${asserted} ${expected_indicator_led} |
| 127 | |
| 128 | # Description of Arguments(s): |
| 129 | # pre_req_state The pre-requisite state of the host to perform the test (e.g. "On") |
| George Keishing | e4d4142 | 2019-12-12 11:17:03 -0600 | [diff] [blame] | 130 | # asserted The assert property that sets the value |
| 131 | # (e.g. "xyz.openbmc_project.Led.Physical.Action.On") |
| Marissa Garza | 270a411 | 2019-10-08 11:36:58 -0500 | [diff] [blame] | 132 | # expected_indicator_led The expected value of the IndicatorLED attribute for all the |
| 133 | # power supplies units are initiated (e.g. "Lit") |
| 134 | |
| 135 | Run Key U Redfish Power ${pre_req_state} \ stack_mode=skip \ quiet=1 |
| 136 | Redfish.Login |
| 137 | |
| 138 | # Put both power supply LEDs On/Off to check all units are asserted |
| 139 | Redfish.Put ${LED_PHYSICAL_PS0_URI}attr/State body={"data":${asserted}} |
| 140 | Redfish.Put ${LED_PHYSICAL_PS1_URI}attr/State body={"data":${asserted}} |
| 141 | |
| 142 | # Example output: |
| 143 | # power_supplies: |
| 144 | # [0]: |
| 145 | # [MemberId]: powersupply0 |
| 146 | # [IndicatorLED]: Lit |
| 147 | # [Status]: |
| 148 | # [Health]: OK |
| 149 | # [State]: Enabled |
| 150 | # [1]: |
| 151 | # [MemberId]: powersupply1 |
| 152 | # [IndicatorLED]: Lit |
| 153 | # [Status]: |
| 154 | # [Health]: OK |
| 155 | # [State]: Enabled |
| 156 | |
| 157 | Verify Indicator LEDs ${expected_indicator_led} |
| 158 | |
| 159 | |
| 160 | Verify Indicator LEDs |
| 161 | [Documentation] Verify the LEDs on the power supply units are set according to caller's expectation. |
| 162 | [Arguments] ${expected_indicator_led} |
| 163 | |
| 164 | # Description of Arguments(s): |
| 165 | # expected_indicator_led The expected value of the IndicatorLED attribute for all the |
| 166 | # LEDs after the lamp test is initiated (e.g. "Blinking") |
| 167 | |
| 168 | ${power_supplies}= Redfish.Get Attribute ${REDFISH_CHASSIS_POWER_URI} PowerSupplies |
| 169 | Rprint Vars power_supplies |
| 170 | FOR ${power_supply_leds} IN @{power_supplies} |
| George Keishing | 396083b | 2020-03-05 21:54:23 -0600 | [diff] [blame] | 171 | Valid Value power_supply_leds['IndicatorLED'] ['${expected_indicator_led}'] |
| Marissa Garza | 270a411 | 2019-10-08 11:36:58 -0500 | [diff] [blame] | 172 | END |
| 173 | |
| 174 | |
| Marissa Garza | 3fc3405 | 2019-10-28 14:13:13 -0500 | [diff] [blame] | 175 | Set and Verify Fan LED Indicators |
| 176 | [Documentation] Verify the indicator LED for the fans are asserted. |
| 177 | [Arguments] ${pre_req_state} ${asserted} ${expected_indicator_led} |
| 178 | |
| 179 | # Description of Arguments(s): |
| 180 | # pre_req_state The pre-requisite state of the host to perform the test (e.g. "On") |
| George Keishing | e4d4142 | 2019-12-12 11:17:03 -0600 | [diff] [blame] | 181 | # asserted The assert property that sets the value |
| 182 | # (e.g. "xyz.openbmc_project.Led.Physical.Action.On") |
| 183 | # expected_indicator_led The expected value of the IndicatorLED attribute for all the fans |
| 184 | # are initiated (e.g. "Lit") |
| Marissa Garza | 3fc3405 | 2019-10-28 14:13:13 -0500 | [diff] [blame] | 185 | |
| 186 | Run Key U Redfish Power ${pre_req_state} \ stack_mode=skip \ quiet=1 |
| 187 | Redfish.Login |
| 188 | |
| 189 | # Put all the fan LEDs On/Off to check all are asserted |
| 190 | Redfish.Put ${LED_PHYSICAL_FAN0_URI}attr/State body={"data":${asserted}} |
| 191 | Redfish.Put ${LED_PHYSICAL_FAN2_URI}attr/State body={"data":${asserted}} |
| 192 | Redfish.Put ${LED_PHYSICAL_FAN3_URI}attr/State body={"data":${asserted}} |
| 193 | |
| 194 | # Example output: |
| 195 | # fans: |
| 196 | # [0]: |
| 197 | # [@odata.id]: /redfish/v1/Chassis/chassis/Thermal#/Fans/0 |
| 198 | # [@odata.type]: #Thermal.v1_3_0.Fan |
| 199 | # [IndicatorLED]: Lit |
| 200 | # [MemberId]: fan0_0 |
| 201 | # [Name]: fan0 0 |
| 202 | # [Status]: |
| 203 | # [Health]: OK |
| 204 | # [State]: Enabled |
| 205 | |
| 206 | ${fans}= Redfish.Get Attribute ${REDFISH_CHASSIS_THERMAL_URI} Fans |
| 207 | Rprint Vars fans |
| 208 | FOR ${fan_leds} IN @{fans} |
| George Keishing | 396083b | 2020-03-05 21:54:23 -0600 | [diff] [blame] | 209 | Valid Value fan_leds['IndicatorLED'] ['${expected_indicator_led}'] |
| Marissa Garza | 3fc3405 | 2019-10-28 14:13:13 -0500 | [diff] [blame] | 210 | END |
| 211 | |
| 212 | |
| Marissa Garza | 270a411 | 2019-10-08 11:36:58 -0500 | [diff] [blame] | 213 | Suite Teardown Execution |
| 214 | [Documentation] Do the post suite teardown. |
| 215 | |
| 216 | Redfish.Logout |
| 217 | |
| 218 | |
| 219 | Suite Setup Execution |
| 220 | [Documentation] Do test case setup tasks. |
| 221 | |
| 222 | Printn |
| 223 | Redfish.Login |
| 224 | |
| 225 | |
| 226 | Test Teardown Execution |
| 227 | [Documentation] Do the post test teardown. |
| 228 | |
| 229 | FFDC On Test Case Fail |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 230 | |
| 231 | |
| 232 | Set Suite LED Indicator Initial Value |
| 233 | [Documentation] set suite For LED Initial value. |
| 234 | |
| Yi Hu | c32434a | 2024-01-11 17:33:10 -0800 | [diff] [blame] | 235 | ${value}= Redfish.Get Attribute /redfish/v1/Systems/${SYSTEM_ID} LocationIndicatorActive |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 236 | Set Suite Variable ${value} |
| 237 | |
| 238 | IF ${value} == False |
| 239 | Set Suite Variable ${set_value} ${True} |
| 240 | ELSE |
| 241 | Set Suite Variable ${set_value} ${False} |
| 242 | END |
| 243 | |
| 244 | |
| 245 | Set And Verify LED Location Indicator Active |
| 246 | [Documentation] Set And Verify LED Location Indicator State. |
| 247 | [Arguments] ${set_value} |
| 248 | |
| 249 | ${payload}= Create Dictionary LocationIndicatorActive=${set_value} |
| Yi Hu | c32434a | 2024-01-11 17:33:10 -0800 | [diff] [blame] | 250 | Redfish.Patch /redfish/v1/Systems/${SYSTEM_ID} body=&{payload} |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 251 | ... valid_status_codes=[${HTTP_NO_CONTENT}] |
| 252 | |
| Yi Hu | c32434a | 2024-01-11 17:33:10 -0800 | [diff] [blame] | 253 | ${value}= Redfish.Get Attribute /redfish/v1/Systems/${SYSTEM_ID} LocationIndicatorActive |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 254 | |
| 255 | Should Be Equal As Strings ${value} ${set_value} |
| 256 | |
| 257 | |
| George Keishing | c63bfe6 | 2023-11-15 19:09:59 +0530 | [diff] [blame] | 258 | Set Initial Value |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 259 | [Documentation] setting back Initial value. |
| 260 | [Arguments] ${value} |
| 261 | |
| 262 | ${payload}= Create Dictionary LocationIndicatorActive=${value} |
| Yi Hu | c32434a | 2024-01-11 17:33:10 -0800 | [diff] [blame] | 263 | Redfish.Patch /redfish/v1/Systems/${SYSTEM_ID} body=&{payload} |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 264 | ... valid_status_codes=[${HTTP_NO_CONTENT}] |
| 265 | |
| Yi Hu | c32434a | 2024-01-11 17:33:10 -0800 | [diff] [blame] | 266 | ${intial_value}= Redfish.Get Attribute /redfish/v1/Systems/${SYSTEM_ID} LocationIndicatorActive |
| Alagiridhilipank | 2643e59 | 2023-11-08 14:31:59 +0530 | [diff] [blame] | 267 | Should Be Equal As Strings ${intial_value} ${value} |