| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 1 | *** Settings *** | 
 | 2 |  | 
 | 3 | Documentation  Test LED groups in OpenBMC. | 
 | 4 |  | 
 | 5 | Resource       ../lib/rest_client.robot | 
| Sandhya Somashekar | 839a0c2 | 2019-01-31 05:05:43 -0600 | [diff] [blame] | 6 | Resource       ../lib/resource.robot | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 7 | Resource       ../lib/openbmc_ffdc.robot | 
 | 8 |  | 
 | 9 | Suite Setup    Setup The Suite | 
 | 10 | Test Teardown  FFDC On Test Case Fail | 
 | 11 |  | 
 | 12 | Force Tags  LED_Group | 
 | 13 |  | 
 | 14 | *** Variables *** | 
 | 15 |  | 
 | 16 |  | 
 | 17 | *** Test Cases *** | 
 | 18 |  | 
 | 19 | Verify CPU Fault LEDs Group | 
 | 20 |     [Documentation]  Verify CPU's fault LEDs. | 
 | 21 |     [Tags]  Verify_CPU_Fault_LEDs_Group | 
 | 22 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 23 |     Verify LED Group  cpu  fault | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 24 |  | 
 | 25 | Verify Fan Fault LEDs Group | 
 | 26 |     [Documentation]  Verify fan's fault LEDs. | 
 | 27 |     [Tags]  Verify_Fan_Fault_LEDs_Group | 
 | 28 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 29 |     Verify LED Group  fan  fault | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 30 |  | 
 | 31 | Verify DIMM Fault LEDs Group | 
 | 32 |     [Documentation]  Verify DIMM's fault LEDs. | 
 | 33 |     [Tags]  Verify_DIMM_Fault_LEDs_Group | 
 | 34 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 35 |     Verify LED Group  dimm  fault | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 36 |  | 
 | 37 | Verify GPU Fault LEDs Group | 
 | 38 |     [Documentation]  Verify GPU's fault LEDs. | 
 | 39 |     [Tags]  Verify_GPU_Fault_LEDs_Group | 
 | 40 |  | 
| George Keishing | 9c459f9 | 2017-11-29 22:55:39 -0600 | [diff] [blame] | 41 |     Verify LED Group  gv100card  fault | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 42 |  | 
 | 43 | Verify Power Supply Fault LEDs Group | 
 | 44 |     [Documentation]  Verify power supply's fault LEDs. | 
 | 45 |     [Tags]  Verify_Power_Supply_Fault_LEDs_Group | 
 | 46 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 47 |     Verify LED Group  powersupply  fault | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 48 |  | 
 | 49 | Verify Enclosure Fault LED Group | 
 | 50 |     [Documentation]  Validate enclosure's fault LED. | 
 | 51 |     [Tags]  Verify_Enclosure_Fault_LED_Group | 
 | 52 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 53 |     Verify LED Group  enclosure  fault | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 54 |  | 
 | 55 | Verify Power State LEDs Group | 
 | 56 |     [Documentation]  Verify power state LEDs. | 
 | 57 |     [Tags]  Verify_Power_State_LEDs_Group | 
 | 58 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 59 |     Verify LED Group  power | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 60 |  | 
 | 61 | Verify Enclosure Identify LED Group | 
 | 62 |     [Documentation]  Validate enclosure's identify LED. | 
 | 63 |     [Tags]  Verify_Enclosure_Identify_LED_Group | 
 | 64 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 65 |     Verify LED Group  enclosure  identify | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 66 |  | 
 | 67 | Verify Fan Identify LEDs Group | 
 | 68 |     [Documentation]  Verify fan's identify LEDs. | 
 | 69 |     [Tags]  Verify_Fan_Identify_LEDs_Group | 
 | 70 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 71 |     Verify LED Group  fan  identify | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 72 |  | 
 | 73 | Verify Other Fault LEDs Group | 
 | 74 |     [Documentation]  Verify other fault LEDs. | 
 | 75 |     [Tags]  Verify_Other_Fault_LEDs_Group | 
 | 76 |  | 
| George Keishing | 15b3891 | 2017-03-30 06:54:30 -0500 | [diff] [blame] | 77 |     Verify LED Group  system_fault | 
 | 78 |     Verify LED Group  boxelder_fault | 
 | 79 |     Verify LED Group  bmc_fault | 
 | 80 |     Verify LED Group  motherboard_fault | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 81 |  | 
| Sweta Potthuri | e5a9fc7 | 2017-05-03 07:02:46 -0500 | [diff] [blame] | 82 | Verify Enclosure Fault LED On Assertion | 
 | 83 |     [Documentation]  Verify enclosure fault LED on assertion. | 
 | 84 |     [Tags]  Verify_Enclosure_Fault_LED_On_Assertion | 
 | 85 |  | 
 | 86 |     Set LED State  On  cpu0_fault | 
 | 87 |     ${resp}=  Get System LED State  rear_fault | 
 | 88 |     Should Be Equal  ${resp}  On | 
 | 89 |  | 
| Rahul Maheshwari | 977bc23 | 2017-07-07 02:28:09 -0500 | [diff] [blame] | 90 |  | 
 | 91 | Verify Rear Power LED Association With Group LED | 
 | 92 |     [Documentation]  Verify rear power LED state association with | 
 | 93 |     ...  power on group LED. | 
 | 94 |     [Tags]  Verify_Rear_Power_LED_Association_With_Group_LED | 
 | 95 |  | 
 | 96 |     Set LED State  On  power_on | 
 | 97 |     ${resp}=  Get System LED State  rear_power | 
 | 98 |     Should Be Equal  ${resp}  On | 
 | 99 |  | 
 | 100 |     Set LED State  Off  power_on | 
 | 101 |     ${resp}=  Get System LED State  rear_power | 
| Rahul Maheshwari | 23a9d46 | 2017-10-24 11:51:56 -0500 | [diff] [blame] | 102 |     Should Be Equal  ${resp}  Blink | 
| Rahul Maheshwari | 977bc23 | 2017-07-07 02:28:09 -0500 | [diff] [blame] | 103 |  | 
 | 104 |  | 
| Sweta Potthuri | e5a9fc7 | 2017-05-03 07:02:46 -0500 | [diff] [blame] | 105 | ***Keywords*** | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 106 |  | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 107 | Set LED State | 
 | 108 |     [Documentation]  Set state of given LED to on or off. | 
 | 109 |     [Arguments]  ${state}  ${led_name} | 
 | 110 |     # Description of arguments: | 
 | 111 |     # state     LED's state to set, i.e. On or Off | 
 | 112 |     # led_name  Name of LED | 
 | 113 |  | 
 | 114 |     ${data}=  Run Keyword If | 
 | 115 |     ...  '${state}' == 'On'  Create Dictionary  data=${True} | 
 | 116 |     ...  ELSE IF  '${state}' == 'Off'  Create Dictionary  data=${False} | 
 | 117 |     ...  ELSE  Fail  msg=Invalid LED state | 
 | 118 |  | 
 | 119 |     ${resp}=  OpenBMC Put Request | 
 | 120 |     ...  ${LED_GROUPS_URI}${led_name}/attr/Asserted  data=${data} | 
 | 121 |     ${jsondata}=  to JSON  ${resp.content} | 
 | 122 |     Should Be Equal As Strings  ${jsondata['status']}  ok | 
 | 123 |  | 
 | 124 | Verify LED Group | 
 | 125 |     [Documentation]  Set and validate state of all LEDs with given name. | 
 | 126 |     [Arguments]  ${led_prefix}  ${led_suffix}=${EMPTY} | 
 | 127 |     # Description of arguments: | 
 | 128 |     # led_prefix  LED name's prefix | 
 | 129 |     # led_suffix  LED name's suffix | 
 | 130 |  | 
 | 131 |     ${led_list}=  Get LED List  ${led_prefix}  ${led_suffix} | 
 | 132 |  | 
 | 133 |     ${list_length}=  Get Length  ${led_list} | 
 | 134 |     Should Be True  ${list_length} > 0 | 
 | 135 |     ...  msg=No ${led_prefix} ${led_suffix} LED found | 
 | 136 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 137 |     FOR  ${led}  IN  @{led_list} | 
 | 138 |       Set LED State  On  ${led} | 
 | 139 |       ${resp}=  Get LED State XYZ  ${led} | 
 | 140 |       Should Be Equal  ${resp}  ${1} | 
 | 141 |       Set LED State  Off  ${led} | 
 | 142 |       ${resp}=  Get LED State XYZ  ${led} | 
 | 143 |       Should Be Equal  ${resp}  ${0} | 
 | 144 |     END | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 145 |  | 
 | 146 | Setup The Suite | 
 | 147 |     [Documentation]  Test setup before running this suite. | 
 | 148 |  | 
 | 149 |     ${resp}=  Read Properties  ${LED_GROUPS_URI} | 
 | 150 |     Set Suite Variable  ${LED_GROUPS}  ${resp} | 
 | 151 |  | 
 | 152 | Get LED List | 
 | 153 |     [Documentation]  Returns all LEDs with given name. | 
 | 154 |     [Arguments]  ${led_prefix}  ${led_suffix}=${EMPTY} | 
 | 155 |     # Description of arguments: | 
 | 156 |     # led_prefix  LED name's prefix | 
 | 157 |     # led_suffix  LED name's suffix | 
 | 158 |  | 
 | 159 |     ${list}=  Get Matches | 
 | 160 |     ...  ${LED_GROUPS}  regexp=^.*[0-9a-z_].${led_prefix}.*${led_suffix} | 
 | 161 |     ${led_list}=  Create List | 
 | 162 |  | 
| Sushil Singh | 5dbaf9d | 2020-06-19 05:43:20 -0500 | [diff] [blame] | 163 |     FOR  ${element}  IN  @{list} | 
 | 164 |       ${element}=  Remove String  ${element}  ${LED_GROUPS_URI} | 
 | 165 |       Append To List  ${led_list}  ${element} | 
 | 166 |     END | 
| Rahul Maheshwari | 7258aec | 2017-02-02 04:46:38 -0600 | [diff] [blame] | 167 |     Sort List  ${led_list} | 
 | 168 |  | 
 | 169 |     [Return]  ${led_list} |