#
d0a341b9
|
| 18-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove is_object
is_object doesn't throw, but generally is_object is used in some kind of pattern of.
if (x.is_object()){ x["thing"]; }
operator[] technically throws if it's the wrong type, whi
Remove is_object
is_object doesn't throw, but generally is_object is used in some kind of pattern of.
if (x.is_object()){ x["thing"]; }
operator[] technically throws if it's the wrong type, which bloats binary sizes.
Replace these with the equivalent get_ptr<object_t>
Change-Id: If3734d7920f0a6f81efa10b3a2d91595e9e0af5a Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
84aad24d
|
| 27-Jan-2025 |
rohitpai <rohitpai77@gmail.com> |
Redfish OEM Patch Route Handling
Extension of OEM route infra to support registration of handlers for OEM patch requests. When patch request is made on a redfish resource, first the main route handl
Redfish OEM Patch Route Handling
Extension of OEM route infra to support registration of handlers for OEM patch requests. When patch request is made on a redfish resource, first the main route handler will be called and if request patch payload contains any OEM fragments then, registered OEM patch handler will be called.
Tested 1. UT passes with new test cases added for OEM patch handling 2. Patch on FAN OEM property works as expected
``` Step 1: Creating new fan controller... Create PATCH data: { "Oem": { "OpenBmc": { "Fan": { "FanControllers": { "Fan_TEST_391715": { "FFGainCoefficient": 2.0, "Zones": [ { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone_1" } ] } } } } } }
HTTP Response Code (PATCH /redfish/v1/Managers/bmc): 200
HTTP Response Code (GET /redfish/v1/Managers/bmc): 200 ✓ Fan controller created successfully
Step 2: Updating the fan controller... Update PATCH data: { "Oem": { "OpenBmc": { "Fan": { "FanControllers": { "Fan_TEST_391715": { "FFGainCoefficient": 3.0 } } } } } }
HTTP Response Code (PATCH /redfish/v1/Managers/bmc): 200
HTTP Response Code (GET /redfish/v1/Managers/bmc): 200
Final Configuration: { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanControllers/Fan_TEST_391715", "@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanController", "FFGainCoefficient": 3.0, "Zones": [ { "@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone_1" } ] } ✓ Fan controller updated successfully ```
Test Summary ``` [+] Tests DateTime update after NTP disable. Payload: {DateTime: <date-string>}. Expects: 204 success, validates date matches update.: PASSED [-] Tests invalid property in request. Payload: {InvalidProperty: 'value', DateTime: <date-string>}. Expects: 400 PropertyUnknown error, validates DateTime unchanged.: PASSED [-] Tests fan controller with invalid property. Payload: Oem/OpenBmc/Fan/FanControllers with InvalidProperty. Expects: 400 PropertyUnknown error, fan not created.: PASSED [-] Tests empty PATCH request. Payload: {}. Expects: 400 MalformedJSON error.: PASSED [-] Tests malformed fan controller JSON. Payload: Fan property as string instead of object. Expects: 400 PropertyValueTypeError error.: PASSED [-] Tests DateTime with wrong type. Payload: {DateTime: 12345}. Expects: 400 PropertyValueTypeError error, DateTime unchanged.: PASSED [-] Tests PATCH to invalid manager path. Payload: Valid DateTime and fan update to /invalid_bmc. Expects: 404 ResourceNotFound error.: PASSED [+] Tests fan controller creation. Payload: Oem/OpenBmc/Fan/FanControllers with FFGainCoefficient and Zones. Expects: 200 success with success message.: PASSED [-] Tests fan controller without required Zones. Payload: Oem/OpenBmc/Fan/FanControllers with only FFGainCoefficient. Expects: 500 InternalError, fan not created.: PASSED [+] Tests combined DateTime and fan update. Payload: DateTime and Oem/OpenBmc/Fan/FanControllers. Expects: 200 success with success message.: PASSED [-] Tests PATCH with wrong Content-Type header. Payload: Valid DateTime update with text/plain content-type. Expects: 400 UnrecognizedRequestBody error.: PASSED [+] Tests fan controller creation and update. Payload: Create with FFGainCoefficient=2.0, then update to 3.0. Expects: 200 success for both operations, verifies all properties.: PASSED ```
Change-Id: Ib2498b6a4db0343d5d4a405a5a8e4d78f615bed8 Signed-off-by: Rohit PAI <rohitpai77@gmail.com>
show more ...
|
#
fdf51f5c
|
| 04-Apr-2025 |
Rohit PAI <ropai@nvidia.com> |
Avoid http request copy in OEM handler
Initial copy was done to avoid request object going out of scope before OEM handler are invoked. The MR avoids the whole copy of the request object and create
Avoid http request copy in OEM handler
Initial copy was done to avoid request object going out of scope before OEM handler are invoked. The MR avoids the whole copy of the request object and create a sub route object which contains elements required for OEM route handling.
Tested - Service Validator Passes - OpenBMC OEM properties and rendered well.
Change-Id: I3ef80a130afe6ab764a13704a8b672f5b0635126 Signed-off-by: Rohit PAI <ropai@nvidia.com>
show more ...
|