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/lib/utils.robot b/lib/utils.robot
index a306dc5..0c572c2 100755
--- a/lib/utils.robot
+++ b/lib/utils.robot
@@ -396,7 +396,7 @@
log to console "Triggering warm reset"
${data}= create dictionary data=@{EMPTY}
- ${resp}= openbmc post request
+ ${resp}= Openbmc Post Request
... ${OPENBMC_BASE_URI}control/bmc0/action/warmReset data=${data}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
${session_active}= Check If warmReset is Initiated
@@ -421,9 +421,8 @@
${resp}= Call Method ${OPENBMC_BASE_URI}control/chassis0/ getPowerState
... data=${args} quiet=${quiet}
Should be equal as strings ${resp.status_code} ${HTTP_OK}
- ${content}= to json ${resp.content}
- [Return] ${content["data"]}
+ [Return] ${resp.json()["data"]}
Clear BMC Gard Record
@@ -567,9 +566,9 @@
Delete All Error Logs
[Documentation] Delete all error log entries using "DeleteAll" interface.
- ${data}= Create Dictionary data=@{EMPTY}
+ ${args}= Set Variable {"data": []}
${resp}= Openbmc Post Request ${BMC_LOGGING_URI}action/DeleteAll
- ... data=${data}
+ ... data=${args}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
@@ -803,7 +802,7 @@
${data}= Create Dictionary data=@{password}
${headers}= Create Dictionary Content-Type=application/json X-Auth-Token=${XAUTH_TOKEN}
- ${resp}= Post Request openbmc ${BMC_USER_URI}root/action/SetPassword
+ ${resp}= POST On Session openbmc ${BMC_USER_URI}root/action/SetPassword
... data=${data} headers=${headers}
Valid Value resp.status_code [${HTTP_OK}]