blob: 86446ee40116f0b0154d09f0822febabf2137ecd [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
Rahul Maheshwari5158d4b2017-04-26 09:45:07 -050046Test Power LED And Verify Via REST
47 [Documentation] Turn On/Off power LED and verify via REST.
48 # LED Name LED State
George Keishingf537e632017-06-15 05:02:07 -050049 rear_power On
50 rear_power Off
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050051 front_power On
52 front_power Off
Rahul Maheshwari5158d4b2017-04-26 09:45:07 -050053
54 [Tags] Test_Power_LED_And_Verify_Via_REST
55 [Template] Set System LED State
56
57Test Fault LED And Verify Via REST
58 [Documentation] Turn On/Off fault LED and verify via REST.
59 # LED Name LED State
Sweta Potthuribf19dbe2017-06-14 03:25:01 -050060 rear_fault On
61 rear_fault Off
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050062 front_fault On
63 front_fault Off
Rahul Maheshwari5158d4b2017-04-26 09:45:07 -050064
65 [Tags] Test_Fault_LED_And_Verify_Via_REST
66 [Template] Set System LED State
George Keishingf7226162016-07-08 06:25:07 -050067
Rahul Maheshwari7bfc0c92017-07-07 00:50:47 -050068Test Rear Identify LED And Verify Via REST
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050069 [Documentation] Turn On/Off identify LED and verify via REST.
Rahul Maheshwari7bfc0c92017-07-07 00:50:47 -050070 #LED Name LED State
71 rear_id On
72 rear_id Off
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050073 front_id On
74 front_id Off
Rahul Maheshwari7bfc0c92017-07-07 00:50:47 -050075
76 [Tags] Test_Rear_Identify_LED_And_Verify_Via_REST
77 [Template] Set System LED State
78
79
Rahul Maheshwarie33ac382017-07-24 02:15:39 -050080Verify Rear Power LED With Host Power Off
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050081 [Documentation] Verify power LED state with host power off.
Rahul Maheshwarie33ac382017-07-24 02:15:39 -050082 [Tags] Verify_Rear_Power_LED_With_Host_Power_Off
83
84 Initiate Host PowerOff
85 ${resp}= Get System LED State rear_power
Sweta Potthuridef9b812017-08-31 05:45:22 -050086 Should Be Equal ${resp} Blink
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050087 ${resp}= Get System LED State front_power
Sweta Potthuridef9b812017-08-31 05:45:22 -050088 Should Be Equal ${resp} Blink
Rahul Maheshwarie33ac382017-07-24 02:15:39 -050089
90
91Verify Rear Power LED With Host Power On
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050092 [Documentation] Verify power LED state with host power on.
Rahul Maheshwarie33ac382017-07-24 02:15:39 -050093 [Tags] Verify_Rear_Power_LED_With_Host_Power_On
94
95 Initiate Host Boot
96 ${resp}= Get System LED State rear_power
97 Should Be Equal ${resp} On
Sweta Potthuri8faf9d82017-08-23 04:25:56 -050098 ${resp}= Get System LED State front_power
99 Should Be Equal ${resp} On
Rahul Maheshwarie33ac382017-07-24 02:15:39 -0500100
George Keishingf7226162016-07-08 06:25:07 -0500101*** Keywords ***
102
Rahul Maheshwaric8898e12017-03-30 23:30:01 -0500103Set System LED State
104 [Documentation] Set given system LED via REST.
105 [Arguments] ${led_name} ${led_state}
106 # Description of arguments:
107 # led_name System LED name (e.g. heartbeat, identify, beep).
108 # led_state LED state to be set (e.g. On, Off).
George Keishingf7226162016-07-08 06:25:07 -0500109
Rahul Maheshwaric8898e12017-03-30 23:30:01 -0500110 ${args}= Create Dictionary data=xyz.openbmc_project.Led.Physical.Action.${led_state}
111 Write Attribute ${LED_PHYSICAL_URI}${led_name} State data=${args}
Chris Austenb29d2e82016-06-07 12:25:35 -0500112
Rahul Maheshwaric8898e12017-03-30 23:30:01 -0500113 Verify LED State ${led_name} ${led_state}
Chris Austenb29d2e82016-06-07 12:25:35 -0500114
Rahul Maheshwaric8898e12017-03-30 23:30:01 -0500115Verify LED State
116 [Documentation] Checks if LED is in given state.
117 [Arguments] ${led_name} ${led_state}
118 # Description of arguments:
119 # led_name System LED name (e.g. heartbeat, identify, beep).
120 # led_state LED state to be verified (e.g. On, Off).
Chris Austenb29d2e82016-06-07 12:25:35 -0500121
Rahul Maheshwaric8898e12017-03-30 23:30:01 -0500122 ${state}= Get System LED State ${led_name}
123 Should Be Equal ${state} ${led_state}