Robotframework request package upgrade changes
Current working package version
robotframework-requests 0.7.2
To Test:
pip3 install robotframework-requests -U
or
# Once this commit is merged.
pip3 install -r requirements.txt
Version latest:
robotframework-requests 0.9.3
Refer Documentation:
https://marketsquare.github.io/robotframework-requests/doc/RequestsLibrary.html
What is not changed:
- The test cases under directory tests/ is not modified and is
deprecated but you can continue using it with older package
and configuration using
git clone -b v3.0-stable https://github.com/openbmc/openbmc-test-automation
Tested:
Upstream HW_CI test list, firmware code update and few other
test suite like ipmi, certificate, dumps, ffdc and redfish
test suites.
Note: I have not tested end to end, so it is likely there could be
grey areas where it could fail but should be minor w.r.t
response data format.
Resolves: openbmc/openbmc-test-automation#2105
Change-Id: Ie03b25ff88948bcccb09e9d82f8da86e28c92697
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/redfish/service_root/test_service_root.robot b/redfish/service_root/test_service_root.robot
index 5c378c5..f5c03ce 100644
--- a/redfish/service_root/test_service_root.robot
+++ b/redfish/service_root/test_service_root.robot
@@ -64,8 +64,9 @@
${headers}= Create Dictionary Content-Type=application/json
... X-Auth-Token=deadbeef
- ${resp}= Get Request
+ ${resp}= GET On Session
... openbmc /redfish/v1/SessionService/Sessions headers=${headers}
+ ... expected_status=${HTTP_UNAUTHORIZED}
Should Be Equal As Strings ${resp.status_code} ${HTTP_UNAUTHORIZED}
@@ -106,15 +107,14 @@
Create Session openbmc https://${OPENBMC_HOST}
${headers}= Create Dictionary Content-Type=application/json
- ${data}= Create Dictionary UserName=${OPENBMC_USERNAME} Password=${OPENBMC_PASSWORD}
+ ${data}= Set Variable {"UserName":"${OPENBMC_USERNAME}", "Password":"${OPENBMC_PASSWORD}"}
- ${resp}= Post Request openbmc /redfish/v1/SessionService/Sessions data=${data} headers=${headers}
+ ${resp}= POST On Session openbmc /redfish/v1/SessionService/Sessions data=${data} headers=${headers}
Should Be Equal As Strings ${resp.status_code} ${HTTP_CREATED}
- ${content}= To JSON ${resp.content}
${headers}= Create Dictionary Content-Type=application/json
... X-Auth-Token=${resp.headers["X-Auth-Token"]}
- ${resp}= Delete Request openbmc ${REDFISH_SESSION}${/}${content["Id"]} headers=${headers}
+ ${resp}= DELETE On Session openbmc ${REDFISH_SESSION}${/}${resp.json()["Id"]} headers=${headers}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
diff --git a/redfish/service_root/test_service_root_security.robot b/redfish/service_root/test_service_root_security.robot
index c0a8d89..0686d6f 100644
--- a/redfish/service_root/test_service_root_security.robot
+++ b/redfish/service_root/test_service_root_security.robot
@@ -46,7 +46,7 @@
${headers}= Create Dictionary Content-Type=application/json
Run Keyword And Expect Error *Connection refused*
- ... Post Request openbmc /redfish/v1/SessionService/Sessions
+ ... POST On Session openbmc /redfish/v1/SessionService/Sessions
... data=${data} headers=${headers}
@@ -61,7 +61,7 @@
${headers}= Create Dictionary Content-Type=application/json
Run Keyword And Expect Error *Connection refused*
- ... Post Request openbmc /redfish/v1/SessionService/Sessions
+ ... POST On Session openbmc /redfish/v1/SessionService/Sessions
... data=${data} headers=${headers}