Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 3 | Documentation Test the functions of system LEDs. |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | |
| 5 | Resource ../lib/rest_client.robot |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 6 | Resource ../lib/state_manager.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 7 | Resource ../lib/resource.txt |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 8 | Resource ../lib/openbmc_ffdc.robot |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 9 | |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 10 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 12 | Force Tags System_LED |
| 13 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 14 | *** Variables *** |
| 15 | |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 16 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | *** Test Cases *** |
| 18 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 19 | Test Heartbeat LED And Verify Via REST |
| 20 | [Documentation] Turn On Off heartbeat LED and verify via REST. |
| 21 | #LED Name LED State |
| 22 | heartbeat On |
| 23 | heartbeat Off |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 24 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 25 | [Tags] Test_Heartbeat_LED_And_Verify_Via_REST |
| 26 | [Template] Set System LED State |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 27 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 28 | Test Beep LED And Verify Via REST |
| 29 | [Documentation] Turn On Off beep LED and verify via REST. |
| 30 | #LED Name LED State |
| 31 | beep On |
| 32 | beep Off |
| 33 | |
| 34 | [Tags] Test_Beep_LED_And_Verify_Via_REST |
| 35 | [Template] Set System LED State |
| 36 | |
| 37 | Test Identify LED And Verify Via REST |
| 38 | [Documentation] Turn On Off identify LED and verify via REST. |
| 39 | #LED Name LED State |
| 40 | identify On |
| 41 | identify Off |
| 42 | |
| 43 | [Tags] Test_Identify_LED_And_Verify_Via_REST |
| 44 | [Template] Set System LED State |
| 45 | |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 46 | |
| 47 | *** Keywords *** |
| 48 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 49 | Get System LED State |
| 50 | [Documentation] Returns the state of given system LED. |
| 51 | [Arguments] ${led_name} |
| 52 | # Description of arguments: |
| 53 | # led_name System LED name (e.g. heartbeat, identify, beep). |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 54 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 55 | ${state}= Read Attribute ${LED_PHYSICAL_URI}${led_name} State |
| 56 | [Return] ${state.rsplit('.', 1)[1]} |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 57 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 58 | Set System LED State |
| 59 | [Documentation] Set given system LED via REST. |
| 60 | [Arguments] ${led_name} ${led_state} |
| 61 | # Description of arguments: |
| 62 | # led_name System LED name (e.g. heartbeat, identify, beep). |
| 63 | # led_state LED state to be set (e.g. On, Off). |
George Keishing | f722616 | 2016-07-08 06:25:07 -0500 | [diff] [blame] | 64 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 65 | ${args}= Create Dictionary data=xyz.openbmc_project.Led.Physical.Action.${led_state} |
| 66 | Write Attribute ${LED_PHYSICAL_URI}${led_name} State data=${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 67 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 68 | Verify LED State ${led_name} ${led_state} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 69 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 70 | Verify LED State |
| 71 | [Documentation] Checks if LED is in given state. |
| 72 | [Arguments] ${led_name} ${led_state} |
| 73 | # Description of arguments: |
| 74 | # led_name System LED name (e.g. heartbeat, identify, beep). |
| 75 | # led_state LED state to be verified (e.g. On, Off). |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 76 | |
Rahul Maheshwari | c8898e1 | 2017-03-30 23:30:01 -0500 | [diff] [blame] | 77 | ${state}= Get System LED State ${led_name} |
| 78 | Should Be Equal ${state} ${led_state} |