dbus_rest: return error response with not found when bad dbus request
Symptom:
Run automation test "Create Two User Initiated Dump And Delete One"
then we got ERROR as below.
Create Two User Initiated Dump And Delete One | FAIL |
Test Bmc Dump :: Test dump functionality of OpenBMC. | FAIL |
**ERROR** 200 != 404
Root cause:
handleGet() function of dbus_rest in bmcweb should be return setErrorResponse()
when doing get request after delete 1 bmc dump.
After checking code flow that will print "message 200 OK",
not "message 404 Not Found".
Due to /xyz/openbmc_project/dump/bmc/entry/1 object path already be deleted and not exist.
Thus when doing get request again with the deleted object path,
we will found that async_send() call return "Bad dbus request error".
But, code flow will keep to response with [200], not [404].
Response should be [404] not [200]. That's why auto test report "**ERROR** 200 != 404".
Solution:
Add setErrorResponse with not found error message return
when async_send return "Bad dbus request error".
Tested:
robot -t Create_Two_User_Initiated_Dump_And_Delete_One redfish/extended/test_bmc_dump.robot
Create Two User Initiated Dump And Delete One | PASS |
Test Bmc Dump :: Test dump functionality of OpenBMC. | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
Signed-off-by:
Tim Lee <timlee660101@gmail.com>
Change-Id: I81e4f22bc2a24f482a41b757835068ca81321437
Loading
Please register or sign in to comment