commit | c7a6d66054deb891a224aac5c4ae0e66ddeb6769 | [log] [tgz] |
---|---|---|
author | Claire Weinan <cweinan@google.com> | Mon Jun 13 16:36:39 2022 -0700 |
committer | Claire Weinan <cweinan@google.com> | Mon Jun 13 17:50:43 2022 -0700 |
tree | 0141997237c46f227e8304b964b97d17c3c1a705 | |
parent | a85afbe1960b015865db775c3e0a53df2a769f44 [diff] |
LogService: Fix setUpRedfishRoute() for dumps There's an inconsistency between how setUpRedfishRoute() is called for BMC dump vs. System dump. In requestRoutesSystemDumpEntry(), setUpRedfishRoute() is called within getDumpEntryById, while in requestRoutesBMCDumpEntry() setUpRedfishRoute() is called before getDumpEntryById() as well as within getDumpEntryById(). The inconsistency was introduced in https://gerrit.openbmc.org/c/openbmc/bmcweb/+/52393/20/redfish-core/lib/log_services.hpp and seems to be accidental. This change removes setUpRedfishRoute() from getDumpEntryById() and makes requestRoutesSystemDumpEntry() call setUpRedfishRoute() before calling getDumpEntryById(). In addition to fixing the inconsistency, this change prevents setUpRedfishRoute() from being called twice for BMC dump. Tested: After creating System dump entry, retrieved it successfully with ./curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1 Saw “setup redfish route” message in journalctl: bmcweb[19717]: (2022-06-13 16:42:52) [DEBUG "routing.hpp":1294] Matched rule '/redfish/v1/Systems/system/LogServices/Dump/Entries/<str>/' 2 / 4 bmcweb[19717]: (2022-06-13 16:42:52) [DEBUG "query.hpp":19] setup redfish route Received the expected error when adding a query parameter for a non-collection resource, which indicates setUpRedfishRoute() had been called: ./curl -k -H "X-Auth-Token: $token" -X GET http://${bmc}/redfish/v1/Systems/system/LogServices/Dump/Entries/1?\$skip=1 { "@odata.id": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1", "@odata.type": "#LogEntry.v1_8_0.LogEntry", "AdditionalDataSizeBytes": 0, "AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/Dump/Entries/1/attachment", "Created": "1970-01-01T00:27:35.135000+00:00", "DiagnosticDataType": "OEM", "EntryType": "Event", "Id": "1", "Name": "System Dump Entry", "OEMDiagnosticDataType": "System", "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "Querying is not supported on the requested resource.", "MessageArgs": [], "MessageId": "Base.1.11.0.QueryNotSupportedOnResource", "MessageSeverity": "Warning", "Resolution": "Remove the query parameters and resubmit the request if the operation failed." } ], "code": "Base.1.11.0.QueryNotSupportedOnResource", "message": "Querying is not supported on the requested resource." } } Repeated the same testing for a BMC dump entry. Signed-off-by: Claire Weinan <cweinan@google.com> Change-Id: I41ea93bfc6971a775241a368491e4615295cc4db
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/meson_options.txt
and then compiling. For example, meson <builddir> -Dkvm=disabled ...
followed by ninja
in build directory. The option names become C++ preprocessor symbols that control which code is compiled into the program.
meson builddir ninja -C builddir
meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled ninja -C buildir
If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in bmcweb/subprojects
.
meson builddir -Dwrap_mode=nofallback ninja -C builddir
meson builddir -Dbuildtype=debug ninja -C builddir
meson builddir -Db_coverage=true -Dtests=enabled ninja -C builddir test ninja -C builddir coverage
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the secp384r1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.