blob: 11eeb1817e624c1730432a436b03e0081a9a59c6 [file] [log] [blame]
*** Settings ***
Documentation Error logging utility keywords.
Resource rest_client.robot
Variables ../data/variables.py
*** Keywords ***
Get Logging Entry List
[Documentation] Get logging entry and return the object list.
${entry_list}= Create List
${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}list quiet=${1}
Return From Keyword If ${resp.status_code} == ${HTTP_NOT_FOUND}
${jsondata}= To JSON ${resp.content}
:FOR ${entry} IN @{jsondata["data"]}
\ Continue For Loop If '${entry.rsplit('/', 1)[1]}' == 'callout'
\ Append To List ${entry_list} ${entry}
# Logging entries list.
# ['/xyz/openbmc_project/logging/entry/14',
# '/xyz/openbmc_project/logging/entry/15']
[Return] ${entry_list}
Logging Entry Should Exist
[Documentation] Find the matching message id and return the entry id.
[Arguments] ${message_id}
# Description of argument(s):
# message_id Logging message string.
# Example: "xyz.openbmc_project.Common.Error.InternalFailure"
${elog_entries}= Get Logging Entry List
:FOR ${entry} IN @{elog_entries}
\ ${resp}= Read Properties ${entry}
\ ${status}= Run Keyword And Return Status
... Should Be Equal As Strings ${message_id} ${resp["Message"]}
\ Return From Keyword If ${status} == ${TRUE} ${entry}
Fail No ${message_id} logging entry found.