Enable REST logging for HW CI runs
We noticed that during HW CI there are intermittent REST
request failures. FFDC collected didn't show if the request
was served or dropped due to NW issues. With logging enabled,
we can identify a REST vs NW failures via REST footprint.
Change-Id: I6718956e6b194f6de83dd1c18890c38393556e56
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/utils.robot b/lib/utils.robot
index 05898f4..053e8ea 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -1553,9 +1553,24 @@
Get Service Attribute
[Documentation] Get service attribute policy output.
[Arguments] ${option} ${servicename}
+
+ # Description of argument(s):
# option systemctl supported options
# servicename Qualified service name
${cmd}= Set Variable
... systemctl -p ${option} show ${servicename} | cut -d = -f2
${attr} ${stderr} ${rc}= BMC Execute Command ${cmd}
[Return] ${attr}
+
+
+Set REST Logging Policy
+ [Documentation] Enable or disable REST logging setting.
+ [Arguments] ${policy_setting}=${True}
+
+ # Description of argument(s):
+ # policy_setting The policy setting value which can be either True or False.
+
+ ${log_dict}= Create Dictionary data=${policy_setting}
+ Write Attribute ${BMC_LOGGING_URI}${/}rest_api_logs Enabled
+ ... data=${log_dict} verify=${1} expected_value=${policy_setting}
+
diff --git a/tests/test_basic_poweron.robot b/tests/test_basic_poweron.robot
index 1102fd7..2abdbb3 100644
--- a/tests/test_basic_poweron.robot
+++ b/tests/test_basic_poweron.robot
@@ -11,7 +11,9 @@
Resource ../lib/boot_utils.robot
Resource ../lib/remote_logging_utils.robot
+Suite Setup Set REST Logging Policy ${True}
Test Teardown FFDC On Test Case Fail
+Suite Teardown Set REST Logging Policy ${False}
Force Tags chassisboot