Add quiet arg to Delete Error Logs
Signed-off-by: Michael Shepos <shepos@us.ibm.com>
Change-Id: I2aaf3dcebd98a9f3101bc379dd1dee95c08fbb4d
diff --git a/lib/common_utils.robot b/lib/common_utils.robot
index bf076ea..daaf139 100755
--- a/lib/common_utils.robot
+++ b/lib/common_utils.robot
@@ -792,9 +792,10 @@
Delete Error Log Entry
[Documentation] Delete error log entry.
- [Arguments] ${entry_path}
+ [Arguments] ${entry_path} ${quiet}=${0}
# Description of argument(s):
+ # quiet If enabled, turns off logging to console.
# entry_path Delete an error log entry.
# Ex. /xyz/openbmc_project/logging/entry/1
@@ -807,7 +808,7 @@
Return From Keyword If ${callout_entry}
${data}= Create Dictionary data=@{EMPTY}
- ${resp}= Openbmc Delete Request ${entry_path} data=${data}
+ ${resp}= Openbmc Delete Request ${entry_path} data=${data} quiet=${quiet}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
diff --git a/lib/obmc_boot_test.py b/lib/obmc_boot_test.py
index 936855d..878a602 100755
--- a/lib/obmc_boot_test.py
+++ b/lib/obmc_boot_test.py
@@ -71,7 +71,7 @@
default_power_on = "Redfish Power On"
default_power_off = "Redfish Power Off"
if redfish_rest_supported:
- delete_errlogs_cmd = "Delete Error Logs"
+ delete_errlogs_cmd = "Delete Error Logs ${quiet}=${1}"
default_set_power_policy = "Set BMC Power Policy ALWAYS_POWER_OFF"
else:
delete_errlogs_cmd = "Redfish Purge Event Log"
@@ -79,7 +79,7 @@
else:
default_power_on = "REST Power On"
default_power_off = "REST Power Off"
- delete_errlogs_cmd = "Delete Error Logs"
+ delete_errlogs_cmd = "Delete Error Logs ${quiet}=${1}"
default_set_power_policy = "Set BMC Power Policy ALWAYS_POWER_OFF"
boot_count = 0
diff --git a/lib/rest_client.robot b/lib/rest_client.robot
index d7fde91..572a73f 100644
--- a/lib/rest_client.robot
+++ b/lib/rest_client.robot
@@ -107,11 +107,12 @@
OpenBMC Delete Request
[Documentation] Do REST request to delete the resource identified by the
... URI.
- [Arguments] ${uri} ${timeout}=10 &{kwargs}
+ [Arguments] ${uri} ${timeout}=10 ${quiet}=${QUIET} &{kwargs}
# Description of argument(s):
# uri The URI to establish connection with
# (e.g. '/xyz/openbmc_project/software/').
# timeout Timeout in seconds to establish connection with URI.
+ # quiet If enabled, turns off logging to console.
# kwargs Any additional arguments to be passed directly to the
# Delete Request call. For example, the caller might
# set kwargs as follows:
@@ -122,9 +123,10 @@
${headers}= Create Dictionary Content-Type=application/json
... X-Auth-Token=${XAUTH_TOKEN}
Set To Dictionary ${kwargs} headers ${headers}
- Log Request method=Delete base_uri=${base_uri} args=&{kwargs}
+ Run Keyword If '${quiet}' == '${0}' Log Request method=Delete
+ ... base_uri=${base_uri} args=&{kwargs}
${ret}= Delete Request openbmc ${base_uri} &{kwargs} timeout=${timeout}
- Log Response ${ret}
+ Run Keyword If '${quiet}' == '${0}' Log Response ${ret}
Delete All Sessions
[Return] ${ret}
diff --git a/lib/utils.robot b/lib/utils.robot
index d37803e..6db5861 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -532,6 +532,9 @@
Delete Error Logs
[Documentation] Delete error logs.
+ [Arguments] ${quiet}=${0}
+ # Description of argument(s):
+ # quiet If enabled, turns off logging to console.
# Check if error logs entries exist, if not return.
${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}list quiet=${1}
@@ -540,7 +543,7 @@
# Get the list of error logs entries and delete them all.
${elog_entries}= Get URL List ${BMC_LOGGING_ENTRY}
FOR ${entry} IN @{elog_entries}
- Delete Error Log Entry ${entry}
+ Delete Error Log Entry ${entry} quiet=${quiet}
END