Journald persistency check on BMC reset

Changes:
     - Added changes to lookup for "-- Reboot --" footprint from
       the journald log post reset.
     - Added new keyword to parse and check for error type user
       specified.

Resolves  openbmc/openbmc-test-automation#1418

Change-Id: I1ddfd19f719c1be7c1756d1f4ca1bbf6c545afb0
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index fc6a488..2586e6b 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -1535,3 +1535,15 @@
 
     [Return]  ${boot_side}
 
+
+Check For Regex In Journald
+    [Documentation]  Parse the journal log and check for regex string.
+    [Arguments]  ${regex}=${ERROR_REGEX}  ${error_check}=${0}
+
+    ${journal_log}  ${stderr}  ${rc}=  BMC Execute Command
+    ...  journalctl --no-pager | egrep '${regex}'  ignore_err=1
+
+    Run Keyword If  ${error_check} == ${0}
+    ...    Should Be Empty  ${journal_log}
+    ...  ELSE
+    ...    Should Not Be Empty  ${journal_log}