Enhance BMC error log utilities

  - Add keyword which obtains a dictionary containg the error logs.
  - Update the Error Logs Should Not Exist keyword to give a
     meaningful message other than 200 != 404.

Resolves openbmc/openbmc-test-automation#1306
Change-Id: I15582e64595c40537d92883675ca2c5e0b9074a3
Signed-off-by: Steven Sombar <ssombar@us.ibm.com>
diff --git a/lib/logging_utils.robot b/lib/logging_utils.robot
index 11eeb18..7d168e7 100644
--- a/lib/logging_utils.robot
+++ b/lib/logging_utils.robot
@@ -42,3 +42,22 @@
 
     Fail  No ${message_id} logging entry found.
 
+
+Get Error Logs
+    [Documentation]  Return a dictionary which contains the BMC error logs.
+    [Arguments]   ${quiet}=1
+
+    # Description of argument(s):
+    # quiet   Indicates whether this keyword should run without any output to
+    #         the console, 0 = verbose, 1 = quiet.
+
+    #  The length of the returned dictionary indicates how many logs there are.
+    #  Printing of error logs can be done with the keyword Print Error Logs,
+    #  for example, Print Error Logs  ${error_logs}  Message.
+
+    ${status}  ${error_logs}=  Run Keyword And Ignore Error  Read Properties
+    ...  /xyz/openbmc_project/logging/entry/enumerate  quiet=${quiet}
+
+    ${empty_dict}=  Create Dictionary
+    Return From Keyword If  '${status}' == 'FAIL'  ${empty_dict}
+    [Return]  ${error_logs}
diff --git a/lib/openbmc_ffdc_utils.robot b/lib/openbmc_ffdc_utils.robot
index 35e83fa..42066e3 100644
--- a/lib/openbmc_ffdc_utils.robot
+++ b/lib/openbmc_ffdc_utils.robot
@@ -122,6 +122,7 @@
 
     ${resp}=  OpenBMC Get Request  ${BMC_LOGGING_ENTRY}/list  quiet=${1}
     Should Be Equal As Strings  ${resp.status_code}  ${HTTP_NOT_FOUND}
+    ...  msg=Unexpected BMC error log(s) present.
 
 
 Error Logs Should Exist