Convert eSEL data file to Elog Format

Resolves openbmc/openbmc-test-automation#477

Change-Id: Ic8b6b12e889071ec180c0ca69fe783c0ec5df9fd
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/openbmc_ffdc_methods.robot b/lib/openbmc_ffdc_methods.robot
index 202d5ba..b7fc413 100755
--- a/lib/openbmc_ffdc_methods.robot
+++ b/lib/openbmc_ffdc_methods.robot
@@ -256,7 +256,8 @@
 
 ##############################################################################
 Collect eSEL Log
-    [Documentation]  Collect eSEL log from logging entry.
+    [Documentation]  Collect eSEL log from logging entry and convert eSEL data
+    ...              to elog formated string text file.
     ${resp}=  OpenBMC Get Request  ${BMC_LOGGING_ENTRY}/enumerate  quiet=${1}
     ${status}=  Run Keyword And Return Status
     ...  Should Be Equal As Strings  ${resp.status_code}  ${HTTP_OK}
@@ -293,4 +294,22 @@
     \  Write Data To File  "${esel_data[0]}"  ${logpath}
     \  Write Data To File  ${\n}  ${logpath}
 
+    ${out}=  Run  which eSEL.pl
+    ${status}=  Run Keyword And Return Status
+    ...  Should Contain  ${out}  eSEL.pl
+    Return From Keyword If  '${status}' == '${False}'
+
+    Convert eSEL To Elog Format  ${logpath}
+
+
+##############################################################################
+Convert eSEL To Elog Format
+    [Documentation]  Execute parser tool on the eSEL data file to generate
+    ...              formated error log.
+    [Arguments]  ${esel_file_path}
+    # Desription of arguments:
+    # ${esel_file_path}  Absoulte path of the eSEL data.
+
+    Run  eSEL.pl -l ${esel_file_path}
+
 ##############################################################################