Fix Redfish GET and PATCH request calls in the test suite
When the test is run individually works however when run as a
suite the previous teardown flushes out the session causing
it to fail.
By default -v REDFISH_DELETE_SESSIONS:1 however when we run
with -v REDFISH_DELETE_SESSIONS:0 that's when we are hitting
this session HTTP 401 error
ValueError: The HTTP status code was not valid:
status: 401
valid_status_codes:
[0]: 200
The changes will handle now irrespective of what options
user input w.r.t sessions deletion.
Changes:
- Add login for the keywords in the test suite performing
GET and PATCH requests.
Tested:
Ran full test suite redfish/managers/test_managers_bmc.robot
Change-Id: Id50d56ec7aa34e16d9bbe53efec55eddbe1391d5
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/managers/test_managers_bmc.robot b/redfish/managers/test_managers_bmc.robot
index 4ac9e5e..a19a12b 100644
--- a/redfish/managers/test_managers_bmc.robot
+++ b/redfish/managers/test_managers_bmc.robot
@@ -204,6 +204,7 @@
Update NTP Test Initial Status
[Documentation] Update the initial status of NTP.
+ Redfish.Login
${original_ntp}= Redfish.Get Attribute ${REDFISH_NW_PROTOCOL_URI} NTP
Set Suite Variable ${original_ntp}
@@ -212,6 +213,7 @@
[Documentation] Set NTP service inactive.
[Arguments] ${state}
+ Redfish.Login
Redfish.Patch ${REDFISH_NW_PROTOCOL_URI} body={'NTP':{'ProtocolEnabled': ${state}}}
... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}]