DMTF / Redfish-Mockup-Server

A simple Python 3.4 program that can be copied into a folder at the top of any Redfish mockup and can serve Redfish requests on the specified IP/port.
Other
87 stars 38 forks source link

Missing ETag support in AccountService #79

Closed MoshiBin closed 3 years ago

MoshiBin commented 4 years ago

Real server returns an ETag for accounts, and later expects the current ETag in PATCH request headers. The mock server does not return such a header at all.

>>> real_resp = real_server.get("/redfish/v1/AccountService/Accounts/0")
>>> print(real_resp.getheader("ETag"))
W/"F42F8DCB"

>>> mock_resp = mock.server.get("/redfish/v1/AccountService/Accounts/0")
>>> print(mock_resp.getheader("ETag"))
None
mraineri commented 4 years ago

Is there a particular reason we need this in the mockup server? Usually when we start getting to this level of detail, it's better suited for the Redfish Interface Emulator, which is really a "more functional" mockup than this tool.

mraineri commented 4 years ago

The other thing that's used today for headers in general is when you capture a mockup, you can specify the -H argument, which will capture HTTP headers for each resource in headers.json. If this file is present in the mockup, the mockup server will send those headers back as is.

mraineri commented 3 years ago

Discussion from the call: The group thinks active ETag management is better suited for the Interface Emulator, or using the existing -H option to leverage the headers captured from the service. The scope of this tool is to allow a client to perform simple GETs on resources in order to view sets of data.