Test LED and error log callout association.
Resolves openbmc/openbmc-test-automation#444
Change-Id: Ia8b0bbc8533986e593465c070c6c58c0e20dab6f
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 5994a11..b25c40b 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -970,3 +970,13 @@
${data}= Create Dictionary data=@{EMPTY}
${resp}= Openbmc Delete Request ${entry_path} data=${data}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
+
+
+Get LED State XYZ
+ [Documentation] Returns state of given LED.
+ [Arguments] ${led_name}
+ # Description of argument(s):
+ # led_name Name of LED
+
+ ${state}= Read Attribute ${LED_GROUPS_URI}${led_name} Asserted
+ [Return] ${state}
diff --git a/tests/test_association.robot b/tests/test_association.robot
index 5bb44f2..52b7011 100755
--- a/tests/test_association.robot
+++ b/tests/test_association.robot
@@ -9,7 +9,7 @@
Suite Setup Run Keywords Verify callout-test AND
... Boot Host AND
... Clear Existing Error Logs
-Test Setup Open Connection And Log In
+Test Setup Pre Test Case Execution
Test Teardown Close All Connections
Suite Teardown Clear Existing Error Logs
@@ -23,8 +23,25 @@
Verify Test Error Log And Callout
+Create Test Error Callout And Verify LED
+ [Documentation] Create an error log callout and verify respective
+ ... LED state.
+ [Tags] Create_Test_Error_Callout_And_Verify_LED
+
+ Create Test Error With Callout
+
+ ${resp}= Get LED State XYZ cpu0_fault
+ Should Be Equal ${resp} ${1}
+
+
*** Keywords ***
+Pre Test Case Execution
+ [Documentation] Do the initial test setup.
+
+ Open Connection And Log In
+ Delete Error logs
+
Verify callout-test
[Documentation] Verify existence of prerequisite callout-test.
@@ -37,6 +54,7 @@
[Documentation] If error log isn't empty, restart the logging service on
... the BMC
+ Open Connection And Log In
${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND}
Execute Command On BMC
@@ -45,7 +63,6 @@
${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}${1}
Should Be Equal As Strings ${resp.status_code} ${HTTP_NOT_FOUND}
-
Create Test Error With Callout
[Documentation] Generate test error log with callout for CPU0.
diff --git a/tests/test_ledgroup.robot b/tests/test_ledgroup.robot
index c602f42..2ac2bf7 100644
--- a/tests/test_ledgroup.robot
+++ b/tests/test_ledgroup.robot
@@ -81,15 +81,6 @@
*** Keywords ***
-Get LED State XYZ
- [Documentation] Returns state of given LED.
- [Arguments] ${led_name}
- # Description of arguments:
- # led_name Name of LED
-
- ${state}= Read Attribute ${LED_GROUPS_URI}${led_name} Asserted
- [Return] ${state}
-
Set LED State
[Documentation] Set state of given LED to on or off.
[Arguments] ${state} ${led_name}