REST post response compliant test
Changes:
- Replace older logic with new "Post" gard clear.
Resolves openbmc/openbmc-test-automation#1330
Change-Id: I35925900c726f8ad1bf027b4967df68377d1f104
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/tests/test_rest_interfaces.robot b/tests/test_rest_interfaces.robot
index 92dba38..2ef3e49 100644
--- a/tests/test_rest_interfaces.robot
+++ b/tests/test_rest_interfaces.robot
@@ -162,29 +162,15 @@
# "status": "ok"
# }
- # Generate 1KB file size
- Run dd if=/dev/zero of=dummyfile bs=1 count=0 seek=1KB
- OperatingSystem.File Should Exist dummyfile
-
- # Get the content of the file and upload to BMC
- ${image_data}= OperatingSystem.Get Binary File dummyfile
-
- # Get REST session to BMC
- Initialize OpenBMC
-
- # Create the REST payload headers and data
- ${data}= Create Dictionary data ${image_data}
- ${headers}= Create Dictionary Content-Type=application/octet-stream
- ... Accept=application/octet-stream
- Set To Dictionary ${data} headers ${headers}
-
- ${resp}= Post Request openbmc /upload/image &{data}
+ # Clear existing gard records, if any.
+ ${data}= Create Dictionary data=@{EMPTY}
+ ${resp}= Openbmc Post Request ${OPENPOWER_CONTROL}gard/action/Reset
+ ... data=${data}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
${jsondata}= To JSON ${resp.content}
Should Be Equal ${jsondata["data"]} ${None}
Should Be Equal As Strings ${jsondata["message"]} 200 OK
Should Be Equal As Strings ${jsondata["status"]} ok
- Delete All Error Logs
Verify REST Put Message JSON Compliant