Fixes esel test cases.

Made changes in:
- Verify Multiple eSEL Using REST
- Verify eSEL Entries Using REST
- Verify eSEL Using REST

Resolves openbmc/openbmc-test-automation#738

Change-Id: I703cf1f05deae055bfcb1442a88f3ec1e423f131
Signed-off-by: Sweta Potthuri <spotthur@in.ibm.com>
diff --git a/extended/test_esel.robot b/extended/test_esel.robot
index ec54604..1c0018a 100644
--- a/extended/test_esel.robot
+++ b/extended/test_esel.robot
@@ -37,15 +37,11 @@
     [Documentation]  Generate eSEL log and verify using REST.
     [Tags]  Verify_eSEL_Using_REST
 
-    # Prior eSEL log shouldn't exist.
-    ${resp}=   OpenBMC Get Request  ${BMC_LOGGING_ENTRY}${1}
-    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_NOT_FOUND}
     Create eSEL
     # New eSEL log should exist
-    ${resp}=   OpenBMC Get Request  ${BMC_LOGGING_ENTRY}${1}
+    ${resp}=  OpenBMC Get Request  ${BMC_LOGGING_ENTRY}/list
     Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
 
-
 Verify eSEL Entries Using REST
     [Documentation]  Verify that eSEL entries have data.
     [Tags]  Verify_eSEL_Entries_Using_REST
@@ -63,14 +59,14 @@
     ${entries}=  Count eSEL Entries
     Should Be Equal As Integers  ${entries}  ${2}
 
-
 Check eSEL AdditionalData
     [Documentation]  Generate eSEL log and verify AdditionalData is
     ...              not empty.
     [Tags]  Check_eSEL_AdditionalData
 
     Create eSEL
-    ${resp}=  OpenBMC Get Request  ${BMC_LOGGING_ENTRY}${1}
+    ${elog_entry}=  Get URL List  ${BMC_LOGGING_ENTRY}
+    ${resp}=  OpenBMC Get Request  ${elog_entry[0]}
     Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
     ${jsondata}=  To JSON  ${resp.content}
     # "/xyz/openbmc_project/logging/entry/1": {
@@ -128,7 +124,6 @@
     Run Inband IPMI Standard Command  ${cmd}
     Run Inband IPMI Standard Command  ${RAW_SEL_COMMIT}
 
-
 Count eSEL Entries
     [Documentation]  Count eSEL entries logged.
     ${resp}=  OpenBMC Get Request  ${BMC_LOGGING_ENTRY}
@@ -137,12 +132,10 @@
     ${count}=  Get Length  ${jsondata["data"]}
     [Return]  ${count}
 
-
 Verify eSEL Entries
     [Documentation]  Verify eSEL entries logged.
-    ${resp}=  OpenBMC Get Request  ${BMC_LOGGING_ENTRY}${1}
-    Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
-    ${jsondata}=  To JSON  ${resp.content}
+    ${elog_entry}=  Get URL List  ${BMC_LOGGING_ENTRY}
+    ${resp}=  OpenBMC Get Request  ${elog_entry[0]}
     #  "data": {
     #       "AdditionalData": [
     #           "ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00 "
@@ -152,11 +145,12 @@
     #       "Severity": "xyz.openbmc_project.Logging.Entry.Level.Emergency",
     #       "Timestamp": 1485904869061
     # }
-
-    Should Be Equal As Integers  ${jsondata["data"]["Id"]}  ${1}
-    Should Be Equal As Strings
-    ...  ${jsondata["data"]["AdditionalData"][0].rstrip()}  ${ESEL_DATA}
-
+    ${entry_id}=  Read Attribute  ${elog_entry[0]}  message
+    Should Be Equal  ${entry_id}
+    ...  org.open_power.Error.Host.Event.Event
+    ${entry_id}=  Read Attribute  ${elog_entry[0]}  Severity
+    Should Be Equal  ${entry_id}
+    ...  xyz.openbmc_project.Logging.Entry.Level.Error
 
 Test Cleanup On Exit
     [Documentation]  Cleanup test logs and connection.