blob: 24a2a24ee4d29c07b0dde1cf39d7719929e9c7e4 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2
Rahul Maheshwaric8898e12017-03-30 23:30:01 -05003Documentation Test the functions of system LEDs.
Chris Austenb29d2e82016-06-07 12:25:35 -05004
5Resource ../lib/rest_client.robot
Rahul Maheshwaric8898e12017-03-30 23:30:01 -05006Resource ../lib/state_manager.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05007Resource ../lib/resource.txt
George Keishingd55a4be2016-08-26 03:28:17 -05008Resource ../lib/openbmc_ffdc.robot
Rahul Maheshwaric8898e12017-03-30 23:30:01 -05009
Gunnar Millseac1af22016-11-14 15:30:09 -060010Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050011
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050012Force Tags System_LED
13
Chris Austenb29d2e82016-06-07 12:25:35 -050014*** Variables ***
15
George Keishingab1bd922016-12-05 05:29:59 -060016
Chris Austenb29d2e82016-06-07 12:25:35 -050017*** Test Cases ***
18
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050019Test 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 Keishingf7226162016-07-08 06:25:07 -050024
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050025 [Tags] Test_Heartbeat_LED_And_Verify_Via_REST
26 [Template] Set System LED State
George Keishingf7226162016-07-08 06:25:07 -050027
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050028Test 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
37Test 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 Keishingf7226162016-07-08 06:25:07 -050046
47*** Keywords ***
48
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050049Get 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 Keishingf7226162016-07-08 06:25:07 -050054
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050055 ${state}= Read Attribute ${LED_PHYSICAL_URI}${led_name} State
56 [Return] ${state.rsplit('.', 1)[1]}
George Keishingf7226162016-07-08 06:25:07 -050057
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050058Set 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 Keishingf7226162016-07-08 06:25:07 -050064
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050065 ${args}= Create Dictionary data=xyz.openbmc_project.Led.Physical.Action.${led_state}
66 Write Attribute ${LED_PHYSICAL_URI}${led_name} State data=${args}
Chris Austenb29d2e82016-06-07 12:25:35 -050067
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050068 Verify LED State ${led_name} ${led_state}
Chris Austenb29d2e82016-06-07 12:25:35 -050069
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050070Verify 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 Austenb29d2e82016-06-07 12:25:35 -050076
Rahul Maheshwaric8898e12017-03-30 23:30:01 -050077 ${state}= Get System LED State ${led_name}
78 Should Be Equal ${state} ${led_state}