Test enclosure fault led after assertion on CPU LED.

This change includes:
   - Added test case to verify enclosure fault LED on assertion.
   - Moved "Get System LED State" keyword from led.robot into utils.robot.
   - Added the test case in skip list of barrelye and palmetto as it is NA.

Resolves openbmc/openbmc-test-automation#432

Change-Id: Ic57b488a2087e18fd5e690d800ab4ac2e08eac2b
Signed-off-by: Sweta Potthuri <spotthur@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 569edb3..ce51f2e 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -931,6 +931,16 @@
     # Set BOOT_TIME variable to current boot time.
     Set Global Variable  ${BOOT_COUNT}  ${count}
 
+Get System LED State
+    [Documentation]  Return the state of given system LED.
+    [Arguments]  ${led_name}
+
+    # Description of argument(s):
+    # led_name     System LED name (e.g. heartbeat, identify, beep).
+
+    ${state}=  Read Attribute  ${LED_PHYSICAL_URI}${led_name}  State
+    [Return]  ${state.rsplit('.', 1)[1]}
+
 ###############################################################################
 Delete Error logs
     [Documentation]  Delete error logs.
diff --git a/test_lists/skip_test_barreleye b/test_lists/skip_test_barreleye
index d93bba4..8699afc 100644
--- a/test_lists/skip_test_barreleye
+++ b/test_lists/skip_test_barreleye
@@ -41,3 +41,4 @@
 # System LED test cases which are NA for Barreleye system.
 -e Test_Power_LED_And_Verify_Via_REST
 -e Test_Fault_LED_And_Verify_Via_REST
+-e Verify_Enclosure_Fault_LED_On_Assertion
diff --git a/test_lists/skip_test_palmetto b/test_lists/skip_test_palmetto
index 48edf3d..f5fccb2 100644
--- a/test_lists/skip_test_palmetto
+++ b/test_lists/skip_test_palmetto
@@ -48,3 +48,4 @@
 # System LED test cases which are NA for Palmetto system.
 -e Test_Beep_LED_And_Verify_Via_REST
 -e Test_Fault_LED_And_Verify_Via_REST
+-e Verify_Enclosure_Fault_LED_On_Assertion
diff --git a/tests/test_led.robot b/tests/test_led.robot
index ca20788..bbd86c7 100644
--- a/tests/test_led.robot
+++ b/tests/test_led.robot
@@ -63,15 +63,6 @@
 
 *** Keywords ***
 
-Get System LED State
-    [Documentation]  Returns the state of given system LED.
-    [Arguments]  ${led_name}
-    # Description of arguments:
-    # led_name     System LED name (e.g. heartbeat, identify, beep).
-
-    ${state}=  Read Attribute  ${LED_PHYSICAL_URI}${led_name}  State
-    [Return]  ${state.rsplit('.', 1)[1]}
-
 Set System LED State
     [Documentation]  Set given system LED via REST.
     [Arguments]  ${led_name}  ${led_state}
diff --git a/tests/test_ledgroup.robot b/tests/test_ledgroup.robot
index 2ac2bf7..54697a8 100644
--- a/tests/test_ledgroup.robot
+++ b/tests/test_ledgroup.robot
@@ -79,7 +79,15 @@
     Verify LED Group  bmc_fault
     Verify LED Group  motherboard_fault
 
-*** Keywords ***
+Verify Enclosure Fault LED On Assertion
+    [Documentation]  Verify enclosure fault LED on assertion.
+    [Tags]  Verify_Enclosure_Fault_LED_On_Assertion
+
+    Set LED State  On  cpu0_fault
+    ${resp}=  Get System LED State  rear_fault
+    Should Be Equal  ${resp}  On
+
+***Keywords***
 
 Set LED State
     [Documentation]  Set state of given LED to on or off.