Added indicator led asserted test case for the fans

Signed-off-by: Marissa Garza <garzam@us.ibm.com>
Change-Id: Ic484fdbf4045402ce508a130e516ed23086a1fba
diff --git a/redfish/systems/test_led_indicator_asserted.robot b/redfish/systems/test_led_indicator_asserted.robot
index f0bfa8a..33d9a4a 100755
--- a/redfish/systems/test_led_indicator_asserted.robot
+++ b/redfish/systems/test_led_indicator_asserted.robot
@@ -59,6 +59,26 @@
     On                  "xyz.openbmc_project.Led.Physical.Action.Off"   Off
 
 
+Verify LED Fans Asserted At Standby
+    [Documentation]  Verify the fans are asserted at standby to lit or off.
+    [Tags]  Verify_LED_Fans_Asserted_At_Standby
+    [Template]  Set and Verify Fan LED Indicators
+
+    # pre_req_state     asserted                                        expected_indicator_led
+    Off                 "xyz.openbmc_project.Led.Physical.Action.On"    Lit
+    Off                 "xyz.openbmc_project.Led.Physical.Action.Off"   Off
+
+
+Verify LED Fans Asserted At Runtime
+    [Documentation]  Verify the fans are asserted at runtime to lit or off.
+    [Tags]  Verify_LED_Fans_Asserted_At_Runtime
+    [Template]  Set and Verify Fan LED Indicators
+
+    # pre_req_state     asserted                                        expected_indicator_led
+    On                  "xyz.openbmc_project.Led.Physical.Action.On"    Lit
+    On                  "xyz.openbmc_project.Led.Physical.Action.Off"   Off
+
+
 *** Keywords ***
 
 Set and Verify Lamp LED Indicator
@@ -140,6 +160,42 @@
     END
 
 
+Set and Verify Fan LED Indicators
+    [Documentation]  Verify the indicator LED for the fans are asserted.
+    [Arguments]  ${pre_req_state}  ${asserted}  ${expected_indicator_led}
+
+    # Description of Arguments(s):
+    # pre_req_state           The pre-requisite state of the host to perform the test (e.g. "On")
+    # asserted                The assert property that sets the value (e.g. "xyz.openbmc_project.Led.Physical.Action.On")
+    # expected_indicator_led  The expected value of the IndicatorLED attribute for all the fans are initiated (e.g. "Lit")
+
+    Run Key U  Redfish Power ${pre_req_state} \ stack_mode=skip \ quiet=1
+    Redfish.Login
+
+    # Put all the fan LEDs On/Off to check all are asserted
+    Redfish.Put  ${LED_PHYSICAL_FAN0_URI}attr/State  body={"data":${asserted}}
+    Redfish.Put  ${LED_PHYSICAL_FAN2_URI}attr/State  body={"data":${asserted}}
+    Redfish.Put  ${LED_PHYSICAL_FAN3_URI}attr/State  body={"data":${asserted}}
+
+    # Example output:
+    # fans:
+    #   [0]:
+    #     [@odata.id]:                                  /redfish/v1/Chassis/chassis/Thermal#/Fans/0
+    #     [@odata.type]:                                #Thermal.v1_3_0.Fan
+    #     [IndicatorLED]:                               Lit
+    #     [MemberId]:                                   fan0_0
+    #     [Name]:                                       fan0 0
+    #     [Status]:
+    #       [Health]:                                   OK
+    #       [State]:                                    Enabled
+
+    ${fans}=  Redfish.Get Attribute  ${REDFISH_CHASSIS_THERMAL_URI}  Fans
+    Rprint Vars  fans
+    FOR  ${fan_leds}  IN  @{fans}
+        Valid Value  fan_leds['IndicatorLED']  [${expected_indicator_led}]
+    END
+
+
 Suite Teardown Execution
     [Documentation]  Do the post suite teardown.