Added some more test cases for testing IPMI SEL.

Test cases added:
    - Verify IPMI SEL Delete
    - Verify Empty SEL
    - Delete Non Existing SEL Entry
    - Delete Invalid SEL Entry

Resolves openbmc/openbmc-test-automation#515

Change-Id: Ia3cdb6dbb6c1dd582525356df5244c1981ede975
Signed-off-by: Rahul Maheshwari <rahulmaheshwari@in.ibm.com>
diff --git a/tests/test_error_log.robot b/tests/test_error_log.robot
index ba2d845..0a0bfbb 100644
--- a/tests/test_error_log.robot
+++ b/tests/test_error_log.robot
@@ -156,7 +156,7 @@
     ${setting_status}=  Evaluate  $setting_status.replace(' ','')
 
     Should Be True  ${setting_status} >= 1.5
-    Should Contain  ${version_info}  v2compliant  case_insensitive=True
+    Should Contain  ${version_info}  v2 compliant  case_insensitive=True
 
 
 Verify Watchdog Timedout Error
@@ -177,6 +177,62 @@
     Verify Watchdog Errorlog Content
 
 
+Verify IPMI SEL Delete
+    [Documentation]  Verify IPMI SEL delete operation.
+    [Tags]  Verify_IPMI_SEL_Delete
+
+    Delete Error Logs And Verify
+    Create Test Error Log
+
+    ${sel_list}=  Run IPMI Standard Command  sel list
+    # Example of SEL List:
+    # 4 | 04/21/2017 | 10:51:16 | System Event #0x01 | Undetermined system hardware failure | Asserted
+
+    ${sel_entry}=  Fetch from Left  ${sel_list}  |
+    ${sel_entry}=  Evaluate  $sel_entry.replace(' ','')
+    ${sel_entry}=  Convert To Integer  0x${sel_entry}
+
+    ${sel_delete}=  Run IPMI Standard Command  sel delete ${sel_entry}
+    Should Be Equal As Strings  ${sel_delete}  Deleted entry ${sel_entry}
+    ...  case_insensitive=True
+
+    ${sel_list}=  Run IPMI Standard Command  sel list
+    Should Be Equal As Strings  ${sel_list}  SEL has no entries
+    ...  case_insensitive=True
+
+
+Verify Empty SEL
+    [Documentation]  Verify empty SEL list.
+    [Tags]  Verify_Empty_SEL
+
+    Delete Error Logs And Verify
+
+    ${resp}=  Run IPMI Standard Command  sel list
+    Should Contain  ${resp}  SEL has no entries  case_insensitive=True
+
+
+Delete Non Existing SEL Entry
+    [Documentation]  Delete non existing SEL entry.
+    [Tags]  Delete_Non_Existing_SEL_Entry
+
+    Delete Error Logs And Verify
+    ${sel_delete}=  Run Keyword And Expect Error  *
+    ...  Run IPMI Standard Command  sel delete 100
+    Should Contain  ${sel_delete}  Unable to delete entry
+    ...  case_insensitive=True
+
+
+Delete Invalid SEL Entry
+    [Documentation]  Delete invalid SEL entry.
+    [Tags]  Delete_Invalid_SEL_Entry
+
+    ${sel_delete}=  Run Keyword And Expect Error  *
+    ...  Run IPMI Standard Command  sel delete abc
+    Should Contain  ${sel_delete}  Given SEL ID 'abc' is invalid
+    ...  case_insensitive=True
+
+
+
 *** Keywords ***
 
 Get IPMI SEL Setting
@@ -189,8 +245,7 @@
 
     ${setting_line}=  Get Lines Containing String  ${resp}  ${setting}
     ...  case-insensitive
-    ${setting_status}=  Fetch From Right  ${setting_line}  :
-    ${setting_status}=  Evaluate  $setting_status.replace(' ','')
+    ${setting_status}=  Fetch From Right  ${setting_line}  :${SPACE}
 
     [Return]  ${setting_status}