summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
3 daysredfish: Refactor FabricAdapter lambdaHEADmasterYuvakumar Selvamani1-17/+19
getFabricAdapterLocation() registered its D-Bus LocationCode property response handler as an inline lambda, requiring an ast-grep-ignore suppression for the long-lambda rule. This commit extracts the body into a named function (afterGetFabricAdapterLocation) wired via std::bind_front into the safe dbus::utility::getProperty<std::string> API. This is a pure refactor: logic is unchanged. The ast-grep-ignore comment is removed since the code is no longer flagged by the rule. Tested: - Booted an AST2600 SoC platform and exercised the endpoint that actually invokes the refactored code live: GET /redfish/v1/Systems/system/FabricAdapters/<id>/ (single-adapter endpoint, not the collection) returned 200 OK with Location/PartLocation/ServiceLabel populated from the adapter's LocationCode D-Bus property, matching the value set on the test object. No errors logged for fabric_adapters.hpp for the full test session. - Redfish Service Validator: 5923 Pass, 353 Warn, 0 Fail. Change-Id: I1f6594f690b8131ac17d6d38502e5674f15e7cb6 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
4 daysRefactor chassis_utils getValidChassisPath lambdaYuvakumar Selvamani1-27/+40
The getValidChassisPath function contained an inline lambda that triggered the long-lambda ast-grep rule, requiring an inline suppression (// ast-grep-ignore: long-lambda). Since callback is a forwarding- reference template parameter, std::bind_front cannot be used directly here. This commit extracts the lambda body into a separate templated afterGetValidChassisPath function, leaving a short delegating lambda in getValidChassisPath that simply forwards to it. This follows the alternative pattern documented for forwarding-reference callbacks, improves readability, and allows the removal of the static analysis suppression. Tested on AST2600 SoC (live D-Bus tested). - `HEAD /redfish/v1/Chassis/<invalid-id>/ThermalSubsystem` (exercises getValidChassisPath()) Expected: HTTP 404 Base.1.19.ResourceNotFound Actual: HTTP 404 Base.1.19.ResourceNotFound - `HEAD /redfish/v1/Chassis/<valid-id>/ThermalSubsystem` (a Chassis object registered live on D-Bus for this test) Expected: HTTP 200 (chassis resolves) Actual: HTTP 200 with the correct Link header - confirms the templated afterGetValidChassisPath() match-found branch - RSV: 5845 Pass / 353 Warn / 0 Fail Change-Id: I76ed9cc42fa4e49e49e6dc7c3cfc85b75f0d2741 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
4 daysOWNERS: add myself as a reviewerVinothkumar Shanmugavel1-0/+1
Add myself to the bmcweb OWNERS file as a reviewer. Contributions: https://github.com/openbmc/bmcweb/commits?author=vinothkumarshanmugavel Change-Id: I50d5e704bbe3a3ea2d55f058c52dae8798e443a1 Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
4 daysredfish/processor: add tests for helpersJoel Pullokaran Jesin1-0/+165
Add unit coverage for processor helper paths that were previously untested. These tests focus on the logic that maps D-Bus data into the Redfish processor response and handles common error cases. These helpers directly populate processor response fields for throttle information and manufacturer-based architecture mapping. Adding unit tests here improves coverage for those paths and their error handling. Tested: - Built and verified, all tests passed. Change-Id: I78a588d43fe4459c1f6197dcc58646632490c041 Signed-off-by: Joel Pullokaran Jesin <joelpj@ami.com>
4 daysredfish: Refactor EventService GET handler lambdaYuvakumar Selvamani1-52/+53
requestRoutesEventService() registered its GET route as a long inline lambda building the static EventService resource JSON, requiring an ast-grep-ignore suppression for the long-lambda rule. This commit extracts the body into a named free function (handleEventServiceGet) registered via std::bind_front(handleEventServiceGet, std::ref(app)), matching the style already used for the POST subscriptions route in this same file (handleEventServiceSubscriptionsPost). This is a pure refactor: logic is unchanged. The ast-grep-ignore comment is removed since the code is no longer flagged by the rule. Tested: - Booted an AST2600 SoC platform with the new bmcweb and exercised the endpoint live: GET /redfish/v1/EventService/ returned 200 OK with the expected EventService JSON body (Id, Name, ServerSentEventUri, DeliveryRetryAttempts/IntervalSeconds, EventFormatTypes, RegistryPrefixes, ResourceTypes, SSEFilterPropertiesSupported, etc.) identical to the pre-refactor lambda's output. bmcweb.service was active and journalctl -u bmcweb showed only the normal startup line, no errors. - Redfish Service Validator: 5829 Pass, 353 Warn, 0 Fail. Change-Id: Iea6bb1c6366a9ead26cb5edb921f7eb5deec976c Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
5 daysAdd OpenSSL 4.0 supportTan Siewert3-47/+103
With OpenSSL 4.0, ASN1_STRING and several other types are now opaque [0] and cannot be reached like before, and X509_NAME is now constified [1], causing the build to fail. Given that Yocto has now migrated to OpenSSL 4.0, the code must be compatible with both 3.x and 4.0. Modify the accesses for ASN1_STRING to use the appropriate functions like ASN1_STRING_get0_data() and construct the type with all options directly, instead of assigning them afterwards. X509_NAME is now its own RAII object as it must be duped due to the constification. Methods like X509_NAME_add_entry_by_txt however require a non-constified pointer. The truncation to 255 bytes for the X509 common name is now gone since get_index_by_NID and get0_data made the fixed-size buffer unnecessary. Setting subject entries such as country, organization or the subject name now returns a boolean and certificate generation aborts on failure instead of silently continuing with an incomplete subject. The wrap file for OpenSSL can't be updated due to a missing dependency (wrapdb) that doesn't provide OpenSSL 4-compatible patches. Tested: Code compiles with both OpenSSL 3.6.3, as well as 4.0.2, and the unit tests pass. On an AST2600 platform with OpenSSL 3.6.3, as well as 4.0.2, the cert generation works like before, and mTLS authentication as described in [2] how to set it up works too. Adding the certificate to the trusted store works like before. References: [0] https://github.com/openssl/openssl/blob/5ce57ab932b70e030249190a4b5a02232c080eea/CHANGES.md?plain=1#L1523 [1] https://github.com/openssl/openssl/commit/b0f2107b44049805b39434d104c8bb0daf8ae079 [2] https://github.com/openbmc/docs/blob/93b1e07c59cd8bc11e7afaaba4172b21a0a5b552/security/TLS-configuration.md Change-Id: Iefe7d87ddda3dea1ca46929110dea06cff9079ad Signed-off-by: Tan Siewert <tan.siewert@9elements.com>
5 daysRedfish: Return correct EventDestination errorsJoel Pullokaran Jesin2-4/+5
Return a Redfish ResourceNotFound message when an EventDestination subscription cannot be found. Use EventDestination as the resource type in both the regular subscription lookup and the SNMP trap client lookup. This makes the error payload accurately describe the Redfish resource requested. GET /redfish/v1/EventService/Subscriptions/{SubscriptionId}/ now returns HTTP 404 with `Base.1.19.ResourceNotFound` and message arguments containing `EventDestination` and the requested ID. Tested: GET /redfish/v1/EventService/Subscriptions/{SubscriptionId}/ with a missing subscription ID returns HTTP 404 and `Base.1.19.ResourceNotFound`. DELETE /redfish/v1/EventService/Subscriptions/{SubscriptionId}/ now contains `EventDestination`. Redfish Service Validator passed. Change-Id: I17f19fef887b4cea736257a9bc1e1d7424eb24f3 Signed-off-by: Joel Pullokaran Jesin <joelpj@ami.com>
5 dayssensor: add ReadingTime to sensor responsesEnder Hsieh2-1/+12
Add ReadingTime so a client can tell how old a reading is instead of assuming it is current, which is what a consumer closing a control loop on power and thermal readings needs in order to notice a device that has stopped responding. The value comes from the UpdatedTime property defined in: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/84171 A service that has not obtained a reading leaves the property zero, which is skipped rather than published as a bogus date. ReadingTime is already in the installed Sensor schema and is not part of any sensor excerpt, so only Redfish.md needed updating. Tested: ``` curl -k -H "X-Auth-Token: $token" \ https://<bmc_ip>/redfish/v1/Chassis/Nvidia_*/Sensors/temperature_GPU_*_TEMP_0 { "@odata.id": "/redfish/v1/Chassis/Nvidia_*/Sensors/temperature_...", "@odata.type": "#Sensor.v1_11_1.Sensor", "Id": "temperature_...", "Name": "", "PhysicalContext": "Accelerator", "Reading": 26.19921875, "ReadingRangeMax": 127.0, "ReadingRangeMin": -128.0, "ReadingTime": "2026-08-17T15:54:30.392391+00:00", "ReadingType": "Temperature", "ReadingUnits": "Cel", "Status": { "Health": "OK", "State": "Enabled" } } Redfish Service Validator: Summary - PASS: 9453, WARN: 361, FAIL: 0, NOT TESTED: 12407 Validating /redfish/v1/Chassis/Nvidia_*/Sensors/temperature_... - Pass: 14, Warn: 0, Fail: 0, Skip: 54 ``` 1. ReadingTime carried the time the reading was acquired from the sensor, matching the clock to microsecond precision 2. All 58 sensor resources validated with no new failures 3. A service that does not publish UpdatedTime omits ReadingTime rather than reporting the Epoch Change-Id: Ib97dff91b19a7da4b3b99384dc9940333a92c3e1 Signed-off-by: Ender Hsieh <andhsieh@nvidia.com>
6 daysaccount-service: return proper error on deletionTan Siewert1-9/+42
phosphor-user-manager may return an error on deletion if userdel fails for arbitrary reasons (e.g. the user is still logged in and running processes). Previously, any D-Bus error was unconditionally mapped to 404 Not Found, which was misleading for users that existed but could not be removed. Inspect the D-Bus error name and return the most appropriate Redfish response: - ResourceNotFound for unknown objects - ResourceCannotBeDeleted for NotAllowed (e.g. removing the root user) - InternalError for anything else. Tested: Verified correct error responses when deleting a non-existent user, when attempting to delete root (prohibited by phosphor-user-manager), and on unknown errors. Ran all openbmc-test-automation AccountService tests with no unexpected regressions or, more precisely, it fixed non-included tests like the root user deletion test. Change-Id: I559a4081d992b424319ae243c176baae91b1c322 Signed-off-by: Tan Siewert <tan.siewert@9elements.com>
6 daysTest translateMemoryTypeToRedfish conversionsVinothkumar Shanmugavel2-0/+94
Add test/redfish-core/lib/memory_test.cpp and register it in test/meson.build. Cover translation of supported D-Bus DIMM device types to MemoryDeviceType enum values. Verify each supported device type maps to its corresponding Redfish enum. Also verify unknown D-Bus values return MemoryDeviceType::Invalid. Tested: - meson test -C builddir memory_test --print-errorlogs - memory_test passed Change-Id: Iff4f05a3005e9f202e3c9c27c1b308b6490c3afa Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
6 daysTest dbusToRfBootProgressVinothkumar Shanmugavel1-0/+56
Add coverage for dbusToRfBootProgress(), which translates D-Bus boot progress values into Redfish BootProgressTypes enum values. Verify all supported D-Bus progress stages map to their expected Redfish enum values. Also verify that an unknown D-Bus value returns BootProgressTypes::Invalid. Tested: - meson test -C builddir system_test -v - All system_test tests passed, including new tests Change-Id: Icd400128b210743ad276ffad1647fd3d2d6bf40c Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
6 daysUse enums for LogService propertiesVinothkumar Shanmugavel2-2/+5
Dump log services use string literals for the DiagnosticDataType property, and the manager journal LogService uses one for OverWritePolicy. This lacks compile-time type safety and can allow invalid values that are only caught at runtime. Convert these properties to the generated log_entry::LogDiagnosticDataTypes and log_service::OverWritePolicy enums. Both provide NLOHMANN JSON serialization mappings and type checking while preserving the existing response values. Tested: - Verified DiagnosticDataType and OverWritePolicy serialize to identical JSON values. - Redfish Service Validator: PASS: 5825, WARN: 347, FAIL: 0, NOT TESTED: 5227 Change-Id: I501ee26e64996d221fbbcaf4001489ad30fb8f3d Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
6 daysredfish: Use PrettyName for SubProcessorsJustin Nguyen1-1/+3
Subprocessors are using a generic Redfish Name "SubProcessor." Use PrettyName when available to provide a more descriptive, human-readable Name, while falling back to "SubProcessor" when PrettyName is not present. Tested: ``` curl -k -v https://${bmc}/redfish/v1/Systems/system/Processors/mcm/SubProcessors/core0 ``` - Results in ``` { "@odata.id": "/redfish/v1/Systems/system/Processors/mcm/SubProcessors/core0", "@odata.type": "#Processor.v1_18_0.Processor", ... "Id": "core0", "Name": "Node 0 processor module Core 0", "ProcessorType": "Core", "Status": { "Health": "OK", "State": "Enabled" } ``` - Where "Name" will fallback to "SubProcessor" if PrettyName is not present Change-Id: I190a4ab6d2d88086330055fb921e8ca2e0582476 Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
6 daysManagers: Fix ResetToDefaults missing parameterJoel Pullokaran Jesin1-10/+4
Manager.ResetToDefaults requires the ResetType action parameter. The previous implementation parsed ResetType as std::optional<std::string>, which prevented readJsonAction() from reporting a missing-property error for an omitted parameter. As a result, a request that omitted ResetType could fall through to the unsupported-value handling instead of failing during request parsing as a missing required parameter. Parse ResetType as std::string instead, so readJsonAction() handles the missing-parameter case automatically. Keep the existing unsupported value handling for ResetType values other than ResetAll. Tested: POST /redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults with `{}` now returns HTTP 400 and `Base.1.19.ActionParameterMissing`. POST /redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults with `{"ResetType":"ResetAll"}` continues to follow the existing success path. Signed-off-by: Joel Pullokaran Jesin <joelpj@ami.com> Change-Id: I907921e3dc1126aa88332b3777b3ba0a58c19583
6 daysredfish-core: Refactor EventService POST lambdaYuvakumar Selvamani1-436/+429
The POST /redfish/v1/EventService/Subscriptions/ route handler was registered as a 434-line inline lambda (the longest lambda in the bmcweb tree, per the long-lambda ast-grep rule), requiring an inline suppression (// ast-grep-ignore: long-lambda). This commit extracts the lambda body into a named function, handleEventServiceSubscriptionsPost(), and registers it via std::bind_front(), matching the handler style already used for the neighboring GET/DELETE routes in this file (e.g. handleEventDestinationDelete()). This is a pure refactor: the body of the function is unchanged other than dedenting it to its new scope. The ast-grep-ignore comment is removed since the code is no longer a lambda and is no longer flagged by the rule. Tested: - Booted an AST2600 SoC platform and exercised the endpoint live: - POST /redfish/v1/EventService/Subscriptions/ with a valid Redfish subscription body returned 201 Created with a Location header, and a subsequent GET on the created subscription returned the expected properties. - POST with an invalid Destination URL still correctly returned 400 Base.1.19.PropertyValueFormatError, confirming the validation logic behaves identically after extraction. - Redfish Service Validator: 5849 Pass, 353 Warn, 0 Fail. Change-Id: I36ac2d3fcf0383c250c3e7cc9d45e8294d376bfa Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
7 daysRemove Nan as a ReviewerGunnar Mills1-1/+0
Haven't seen any reviews by Nan in 3+ years. [1] [1]: https://gerrit.openbmc.org/q/reviewedby:nanzhoumails@gmail.com The bar to being a reviewer is low: interest in the repo, some commits, and some reviews. If Nan or others are interested in being a reviewer, happy to have that discussion but want to keep this file clean. Change-Id: Ica8ca5727710fc41ef1d7ab44bf9ffd30614a781 Signed-off-by: Gunnar Mills <gunnar@gmills.xyz>
10 daysAdd unit tests for dump_utilsOliver Brewka1-1/+82
Extend dump_utils unit testing. Tested: Code compiles. Introduced unit tests run through. Change-Id: I254e7b5f7318e847551055f352b70a87d07c5cda Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
10 daysMake dumpType an enum classOliver Brewka6-294/+459
In order to increase api safety for the dump log service, make dumpType an enum class. This makes the current unit test for dump logservice obsolete. Further unit tests will be added for the existing code in a follow-up patch. Tested: Code compiles. Added unit tests pass. Validator was run on romulus in qemu with phosphor-debug-collector ibm extension enabled to get access to /xyz/openbmc_project/dump/system. In order to create dumps for /xyz/openbmc_project/dump/system the machine has to be in either "Running", "Quiesced" or "TransitioningToOff" state ``` busctl set-property xyz.openbmc_project.State.Host \ /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Host \ CurrentHostState \ s "xyz.openbmc_project.State.Host.HostState.Quiesced" ``` Via the 'CollectDiagnosticData' action dump entries were manually created for: /xyz/openbmc_project/dump/system /xyz/openbmc_project/dump/bmc ``` curl -v -k POST 'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/ Managers/bmc/LogServices/Dump/Actions/ LogService.CollectDiagnosticData -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' -H "Content-Type: application/json" -d {"DiagnosticDataType":"Manager","OEMDiagnosticDataType":"Manager"} curl -v -k POST 'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/ Systems/system/LogServices/Dump/Actions/ LogService.CollectDiagnosticData -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' -H "Content-Type: application/json" -d {"DiagnosticDataType":"OEM","OEMDiagnosticDataType":"System"} ``` Set system dump entries to Completed: ``` busctl set-property xyz.openbmc_project.Dump.Manager \ /xyz/openbmc_project/dump/system/entry/1 \ xyz.openbmc_project.Common.Progress Status \ s "xyz.openbmc_project.Common.Progress.OperationStatus.Completed" ``` For FaultLog via CreateDump dbus method: ``` busctl call xyz.openbmc_project.Dump.Manager \ /xyz/openbmc_project/dump/faultlog \ xyz.openbmc_project.Dump.Create \ CreateDump a{sv} 0 > o "/xyz/openbmc_project/dump/faultlog/entry/1" busctl tree xyz.openbmc_project.Dump.Manager `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc | `- /xyz/openbmc_project/dump/bmc/entry | |- /xyz/openbmc_project/dump/bmc/entry/1 | |- /xyz/openbmc_project/dump/bmc/entry/2 | |- /xyz/openbmc_project/dump/bmc/entry/3 | `- /xyz/openbmc_project/dump/bmc/entry/4 |- /xyz/openbmc_project/dump/faultlog | `- /xyz/openbmc_project/dump/faultlog/entry | |- /xyz/openbmc_project/dump/faultlog/entry/1 | `- /xyz/openbmc_project/dump/faultlog/entry/2 |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system `- /xyz/openbmc_project/dump/system/entry |- /xyz/openbmc_project/dump/system/entry/1 `- /xyz/openbmc_project/dump/system/entry/2 ``` Validator runs for Manager/Dump, Manager/FaultLog and System/Dump ``` rf_service_validator --schema_directory \ /home/mox/ci/bmcweb/redfish-core/schema/dmtf/csdl \ -u root -p 0penBmc -r https://127.0.0.1:44443 \ --payload Tree /redfish/v1/Managers/bmc/LogServices/Dump Validating /redfish/v1/Managers/bmc/LogServices/Dump... - Pass: 14, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries... - Pass: 50, Warn: 0, Fail: 0, Skip: 108 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/1... - Pass: 11, Warn: 0, Fail: 0, Skip: 25 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/2... - Pass: 11, Warn: 0, Fail: 0, Skip: 25 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/3... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/4... - Pass: 9, Warn: 0, Fail: 0, Skip: 27 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 104 | 0 | 0 | 221 | +--------------+--------------+--------------+--------------+ Validating /redfish/v1/Managers/bmc/LogServices/FaultLog... - Pass: 12, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries... - Pass: 20, Warn: 0, Fail: 0, Skip: 64 Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1... - Pass: 6, Warn: 0, Fail: 0, Skip: 30 Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/2... - Pass: 6, Warn: 0, Fail: 0, Skip: 30 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 44 | 0 | 0 | 133 | +--------------+--------------+--------------+--------------+ Validating /redfish/v1/Systems/system/LogServices/Dump... - Pass: 14, Warn: 0, Fail: 0, Skip: 9 Validating /redfish/v1/Systems/system/LogServices/Dump/Entries... - Pass: 32, Warn: 0, Fail: 0, Skip: 52 Validating /redfish/v1/Systems/system/LogServices/Dump/Entries/1... - Pass: 12, Warn: 0, Fail: 0, Skip: 24 Validating /redfish/v1/Systems/system/LogServices/Dump/Entries/2... - Pass: 12, Warn: 0, Fail: 0, Skip: 24 +--------------+--------------+--------------+--------------+ | PASS | WARN | FAIL | NOT TESTED | +--------------+--------------+--------------+--------------+ | 70 | 0 | 0 | 109 | +--------------+--------------+--------------+--------------+ ``` Download Managers/Dump and Systems/Dump ``` curl -w "@curl-format.txt" -c cjar -b cjar -k -X GET 'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/Managers/bmc/ LogServices/Dump/Entries/1/attachment' -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' --output $OUT % Total % Received % Xferd Average Speed Time Time Time Dload Upload Total Spent Left 100 81588 100 81588 0 0 633.5k 0 curl -w "@curl-format.txt" -c cjar -b cjar -k -X GET 'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/Systems/system/ LogServices/Dump/Entries/1/attachment' -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' --output $OUT % Total % Received % Xferd Average Speed Time Time Time Dload Upload Total Spent Left 100 596 100 596 0 0 3307 0 ``` ClearLog action Managers/Dump/, Managers/FaultLog and Systems/Dump ``` curl -v -k POST 'https://'"${BMC}"':'"${BMC_WEBPORT}"'/redfish/v1/ Managers/bmc/LogServices/Dump/Actions/ LogService.ClearLog -H 'X-Auth-Token: '"$BMCWEB_SESSION_TOKEN_ROML"'' -H "Content-Type: application/json" -d {} { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The request completed successfully.", "MessageArgs": [], "MessageId": "Base.1.19.Success", "MessageSeverity": "OK", "Resolution": "None." } ] * Connection #1 to host localhost:44443 left intact } busctl tree xyz.openbmc_project.Dump.Manager `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/dump |- /xyz/openbmc_project/dump/bmc |- /xyz/openbmc_project/dump/faultlog |- /xyz/openbmc_project/dump/resource `- /xyz/openbmc_project/dump/system ``` Change-Id: Ic85c61854624b525cc0b83d6fce393b0007f5b9a Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
10 daysRedfish: Fix resource type in FabricAdapter not-found errorShivraj Toravi1-2/+2
The Port collection handlers reported a 404 with resource type "Adapter", which is not a Redfish schema name. fabric_adapters.hpp already uses "FabricAdapter" for the same condition, so the ResourceNotFound ExtendedInfo was inconsistent between GET /redfish/v1/Systems/system/FabricAdapters/<bad> and GET /redfish/v1/Systems/system/FabricAdapters/<bad>/Ports. Tested: GET on a non-existent adapter's Ports collection returns ResourceNotFound with "FabricAdapter" as the resource type. Change-Id: I3994610d9f2c61cb59a28182479df7c9398e23ff Signed-off-by: Shivraj Toravi <shivrajnt@ami.com>
12 daysstorage: use PrettyName for Drive Name fieldAKash A0071-1/+3
The Redfish Name field for drives currently defaults to the D-Bus object path filename (e.g. "drive0"). The D-Bus xyz.openbmc_project.Inventory.Item interface provides a PrettyName property for human-readable labels (e.g. "NVMe Drive Bay 0"). Map PrettyName to the Redfish Name field when available, falling back to the object ID when PrettyName is absent or empty. Tested: - Built bmcweb with meson/ninja successfully - Verified PrettyName appears in drive response when available - Falls back to default name when PrettyName is empty Relates-to: https://github.com/openbmc/bmcweb/issues/204 Change-Id: I90510d8633392c4fcadcee3bb94b87fbcf2ae006 Signed-off-by: Akash Arunkumar <mirrorghost007@gmail.com> Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
12 daysredfish: Use PrettyName for hardware resourcesJustin Nguyen9-9/+31
Hardware resources are using a generic Redfish Name such as "PCIe Device." Pass PrettyName instead for a more descriptive and human-readable Name with it defaulting to what the resource was originally This preserves existing fallbacks such that if PrettyName is not present, nothing changes Tested: - Unit tests pass - Redfish Service Validator passes - Request to resources show `Name` field as PrettyName value otherwise defaulting to resource's original `Name` - For example ``` curl -k -v https://${bmc}/redfish/v1/Systems/system/PCIeDevices/pcie_card0 ``` Results in ``` { "@odata.id": "/redfish/v1/Systems/system/PCIeDevices/pcie_card0", "@odata.type": "#PCIeDevice.v1_19_0.PCIeDevice", "Id": "pcie_card0", ... "Name": "PCIe4 x16 or PCIe5 x8 adapter", ... } ``` and defaults to ``` "Name": "PCIe Device", ``` Change-Id: I95ef77027311d18eb9f85295f359b2d9fbc31b2f Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
12 daysutils: add PrettyName utility functionAkash Arunkumar3-0/+242
Create a reusable utility function getPrettyName() in utils/name_utils.hpp that can retrieve the PrettyName property from the D-Bus xyz.openbmc_project.Inventory.Item interface. The function accepts a JSON pointer parameter, allowing it to set the PrettyName at any location in the response (e.g. within arrays or nested objects). This makes it reusable across multiple components (Drives, Processors, Memory, Chassis, etc.). Relates-to: https://github.com/openbmc/bmcweb/issues/204 Tested: - Built bmcweb with meson/ninja successfully - Tested with https://gerrit.openbmc.org/c/openbmc/bmcweb/+/90364 and verified that PrettyName appears in the response - Falls back to default name when PrettyName is empty Change-Id: Iebd31b523797152b0e8e7ea8852f86b292fb5f55 Signed-off-by: Akash Arunkumar <mirrorghost007@gmail.com> Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
12 daysredfish-core: Refactor getSnmpTrapClient lambdaYuvakumar Selvamani1-38/+40
Extract the long D-Bus GetManagedObjects callback lambda in getSnmpTrapClient() into a named function, afterGetSnmpTrapClient(), per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. Call it via dbus::utility::getManagedObjects() and std::bind_front(), matching the pattern used by other GetManagedObjects call sites in the codebase. afterGetSnmpTrapClient() takes the GetManagedObjects result by const reference (const dbus::utility::ManagedObjectType& resp), since the callback only reads it. Tested on AST2600 SoC (live D-Bus tested, phosphor-snmp installed). - `GET /redfish/v1/EventService/Subscriptions/snmpbogus` (no matching D-Bus object) Expected: HTTP 404 Base.1.19.ResourceNotFound Actual: HTTP 404 Base.1.19.ResourceNotFound - `POST /redfish/v1/EventService/Subscriptions` with `{"Destination": "snmp://192.168.1.77:162", "Protocol": "SNMPv2c", "SubscriptionType": "SNMPTrap"}`, creating a real SNMP trap client on D-Bus (id snmp1) Expected: HTTP 201 Base.1.19.Created Actual: HTTP 201 Base.1.19.Created - `GET /redfish/v1/EventService/Subscriptions/snmp1` Expected: HTTP 200 with Destination matching the created client Actual: HTTP 200, "Destination": "snmp://192.168.1.77:162" - confirms afterGetSnmpTrapClient() correctly walks the real GetManagedObjects result (now via const&) and matches the id. - Redfish Service Validator: 5840 Pass / 353 Warn / 0 Fail Change-Id: I661d147f4639b05b87b586d3b1322a9ad3912958 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-28OWNERS: add myself as a reviewerJoel Pullokaran Jesin1-1/+1
Add myself to the bmcweb OWNERS file as a reviewer. I have been actively contributing to and reviewing bmcweb changes for more than two months. Contributions: [1] Reviews: [2] [1] https://github.com/openbmc/bmcweb/commits?author=joel-pj [2] https://gerrit.openbmc.org/q/reviewer:joelpj@ami.com Change-Id: Ibf0b3dac335aa4f76ed44b94e2fba25b75f68b04 Signed-off-by: Joel Pullokaran Jesin <joelpj@ami.com>
2026-09-26OWNERS: add myself as a reviewerYuvakumar Selvamani1-0/+1
Add myself to the bmcweb OWNERS file as a reviewer. Contributions: [1][2] [1] https://github.com/openbmc/bmcweb/commits?author=Yuvakumar-Selvamani [2] https://gerrit.openbmc.org/q/owner:yuvakumars@ami.com Change-Id: Ic5f82102d6883d7de2e5725e410ab62f45fb77e7 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-25eventservice: Return Redfish 404 on PATCHJoel Pullokaran Jesin1-2/+2
Return a Redfish ResourceNotFound error for PATCH requests to an EventDestination that does not exist. Before this change, PATCH on a missing subscription returned only HTTP 404 with no Redfish error payload. That left clients without the standard error body used to identify the failing resource and the expected message registry code. After this change, PATCH /redfish/v1/EventService/Subscriptions/{Id}/ returns HTTP 404 with Base.1.19.ResourceNotFound when the requested EventDestination is not present. Tested: PATCH /redfish/v1/EventService/Subscriptions/does-not-exist/ with {} returns HTTP 404 and Base.1.19.ResourceNotFound. Redfish Service Validator for /redfish/v1/EventService/Subscriptions/ reports PASS 5, WARN 0, FAIL 0, SKIP 5. Change-Id: I84eeabc91a3b75e8a47173b99217b128506f5e8a Signed-off-by: Joel Pullokaran Jesin <joelpj@ami.com>
2026-09-25ssl_key_handler: Avoid redundant c_str() callYuvakumar Selvamani1-1/+1
std::filesystem::remove() already accepts a std::filesystem::path directly. Calling certPath.c_str() first converts the path to a const char*, which is then implicitly re-converted back into a temporary path object - an unnecessary round-trip. Pass certPath directly instead. Found during review of Ia8cfbbc8eeefa6f6cc3bd8d291d93876cc869d47c (https://gerrit.openbmc.org/c/openbmc/bmcweb/+/94314), raised as a separate change per reviewer request since that change is a pure refactor already approved. Tested: - Tested on AST2600 SoC. Triggered a real hostname-change D-Bus signal (busctl set-property .../network/config xyz.openbmc_project.Network.SystemConfiguration HostName s "<NEW_HOSTNAME>") to exercise installCertificate() end-to-end. journalctl -u bmcweb confirmed the fixed remove(certPath, ec2) call ran and logged "Replace HTTPs Certificate Success", and the temp file (/tmp/hostname_cert.tmp) was removed as expected. - Verified the new cert was actually installed and served: $ curl -sk -v https://BMC_IP/redfish/v1/ -o /dev/null 2>&1 | \ grep subject: * subject: C=US; O=OpenBMC; CN=<NEW_HOSTNAME> - Verified Redfish still healthy post-reload: $ curl -sk -u BMC_USER:BMC_PASS \ -o /dev/null -w "HTTP %{http_code}\n" \ https://BMC_IP/redfish/v1/Managers/bmc HTTP 200 - Redfish Service Validator: 5830 Pass / 353 Warn / 0 Fail. Change-Id: If60533899dbbc84bb151e282e83f22ef636eb119 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-25Use enum for watchdog timeout action propertyVinothkumar Shanmugavel1-10/+13
The dbusToRfWatchdogAction() function returns the watchdog timeout action as std::string literals, which lacks compile-time type safety. This can lead to typos or invalid values that are only caught at runtime. Convert this function to return computer_system::WatchdogTimeoutActions enum instead. This enum is already defined in computer_system.hpp with NLOHMANN_JSON_SERIALIZE_ENUM mapping and provides proper type checking. The enum automatically serializes to the same JSON strings, so there is no functional change to the Redfish API. This provides compile-time type checking and better error handling through the Invalid enum value. Tested: - Verified HostWatchdogTimer TimeoutAction property serializes to identical JSON values. - RSV: PASS: 5803, WARN: 353, FAIL: 0, NOT TESTED: 4894 Change-Id: I9aa667796a5bda7eddabd7d37a211d304b39796f Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
2026-09-24redfish-core: Refactor TelemetryService lambdaYuvakumar Selvamani1-52/+57
Extract the long D-Bus GetAllProperties callback lambda in handleTelemetryServiceGet() into a named function, afterGetTelemetryServiceProperties(), bound via std::bind_front(), per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. Also updates the DBus error log message from "respHandler DBus error {}" to "afterGetTelemetryServiceProperties DBus error {}" to include the function name, per review feedback. Tested: - Verified GET /redfish/v1/TelemetryService returns identical values (MaxReports, MinCollectionInterval, Status, SupportedCollectionFunctions) to the pre-refactor lambda, with a live phosphor-telemetry backend. - Redfish Service Validator passed with a real MetricReportDefinition and MetricReport present: 0 Fail on all TelemetryService endpoints (5451 Pass / 353 Warn / 9 Fail overall; the 9 failures are pre-existing, unrelated Managers/bmc errors). Change-Id: I97733e7bedf5868625f32f2008c39b9a9b69abdd Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-24Refactor startAsyncWaitForSignal lambdaYuvakumar Selvamani1-21/+22
Extract the long signal handler lambda in startAsyncWaitForSignal() into a named member function, afterWaitForSignal(), bound via std::bind_front(), per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. Tested on AST2600 SoC: - `kill -HUP <bmcweb pid>`, then `GET /redfish/v1/` Expected: cert reload, service stays active, 200 OK Actual: bmcweb.service remained active, GET returned HTTP 200 - `kill -TERM <bmcweb pid>` Expected: clean shutdown Actual: journalctl confirmed "bmcweb.service: Deactivated successfully" - RSV: 5845 Pass / 353 Warn / 0 Fail Change-Id: Id02f26fd680ae34639b521962b0f4e3d67c534bc Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-21Use the privilege entry that matches the routeBill Chan5-6/+6
Five routes are registered with a privilege registry entry that names a different resource, or a different method, than the route serves: - certificate_service: the Truststore certificate collection GET uses getCertificate. The POST on the same URL already uses postCertificateCollection, and the LDAP and HTTPS certificate collections use getCertificateCollection. - storage_chassis: the chassis drive GET uses getChassis, although the handler serves a Drive resource and the collection above it uses getDriveCollection. - redfish_v1: the JsonSchemas collection and a single JsonSchemaFile hold each other's entry. - metric_report_definition and aggregation_service: two HEAD routes use the get* entry where the head* entry exists. Every one of these pairs resolves to the same privilege set today, so no client sees a change. They are corrected so the routes stay right if the registry ever distinguishes a pair, and so the next reader can trust the entry name. Tested: Redfish Service Validator against a cypress BMC image carrying this change, and again against one without it: both pass, with no failures and identical warning and error counts. The routes this touches were traversed in both runs, bar AggregationSources, which that build does not register. Verified that each replacement entry exists in redfish-core/include/registries/privilege_registry.hpp, that the resource type matches what the handler serves, for example storage_chassis emits #Drive.v1_7_0.Drive, and that every changed pair resolves to the same privilege set as before: getCertificate and getCertificateCollection are both privilegeSetConfigureManager, while the JsonSchemaFile pair and both HEAD pairs are privilegeSetLogin. No client-visible behavior changes as a result. Change-Id: Ib06a2f0e0a43dcfe1fbc7127f6345e40c5202c5f Signed-off-by: Bill Chan <bill_chan@jabil.com>
2026-09-21Report rejected action values with ValueNotInListBill Chan3-8/+10
Manager.Reset, Manager.ResetToDefaults, Chassis.Reset and UpdateService.SimpleUpdate reject an unsupported parameter value with Base.1.19.ActionParameterNotSupported. That message reads "The parameter %1 for the action %2 is not supported on the target resource", and its resolution tells the client to remove the parameter and resubmit. ResetType and TransferProtocol are required parameters of those actions, so the client cannot act on that advice. The arguments were also passed in the wrong order, putting the submitted value where the parameter name belongs. All four parameters are published enumerations: ResetType through the ResetActionInfo resources and the ResetType@Redfish.AllowableValues annotation, TransferProtocol through TransferProtocol@Redfish.AllowableValues. A value outside those lists is Base.1.19.ActionParameterValueNotInList, which names the parameter, the value and the action, and tells the client to choose a supported value. This is the same correction commit 191526da made for ComputerSystem.Reset. The action argument carries the qualified action name, as it appears in the action's target URI and in the existing UpdateService.SimpleUpdate calls in update_service.hpp. Tested: Verified on a QEMU BMC, machine cypress, running a downstream OpenBMC build carrying this change. POST /redfish/v1/Managers/bmc/Actions/Manager.Reset with {"ResetType":"Nope"} returns HTTP 400 and Base.1.19.ActionParameterValueNotInList with MessageArgs ["Nope", "ResetType", "Manager.Reset"]. POST /redfish/v1/Managers/bmc/Actions/Manager.ResetToDefaults with the same body returns HTTP 400 and the same MessageId with MessageArgs ["Nope", "ResetType", "Manager.ResetToDefaults"]. POST /redfish/v1/Chassis/<id>/Actions/Chassis.Reset with the same body returns HTTP 400 and MessageArgs ["Nope", "ResetType", "Chassis.Reset"]. The UpdateService.SimpleUpdate site was not exercised: that build has redfish-allow-simple-update disabled, so the action is not registered. Change-Id: I2db0ddd1cec4d7efe512fe43d8ac7d85d112ab52 Signed-off-by: Bill Chan <bill_chan@jabil.com>
2026-09-21Report the property the request actually failed onBill Chan3-5/+6
Three error paths name a property or condition that has nothing to do with the failure, so a client cannot tell what to correct. - account_service: a RoleId that maps to no privilege reports PropertyValueNotInList for Locked with the value true. RoleId is the property that was rejected, and its submitted value is what the client needs to see. - systems: a PATCH of TrustedModuleRequiredToBoot on a system with no TPM.Policy object reports PropertyValueNotInList with the value "ComputerSystem", which is neither a submitted value nor an enumeration member. Nothing is wrong with the value; the property cannot be written on this system, which is PropertyNotWritable. - openbmc_managers: Direction is checked against the enumeration {Ceiling, Floor}, so a rejected value is PropertyValueNotInList, not PropertyValueTypeError. The arguments were also reversed, since PropertyValueTypeError takes the value first. Tested: Verified on a QEMU BMC, machine cypress, running a downstream OpenBMC build carrying this change. PATCH /redfish/v1/AccountService/Accounts/root with {"RoleId":"Bogus"} returns HTTP 400 and Base.1.19.PropertyValueNotInList with MessageArgs ["\"Bogus\"", "RoleId"], where the same request previously reported Locked with the value true. Not exercised on that build: the TrustedModuleRequiredToBoot site, because that platform has a TPM.Policy object so the empty-subtree branch never runs; and the OEM fan Direction site, because the machine exposes no PID or stepwise fan controllers to PATCH. Change-Id: I408456a7040f095b43a952532f761ec197c24146 Signed-off-by: Bill Chan <bill_chan@jabil.com>
2026-09-19include,http: Extract getUserInfo/onRequestRecvYuvakumar Selvamani2-22/+34
Move long lambdas in getUserInfo() and onRequestRecv() into named functions, afterGetUserInfo() and afterCompleteRequest(), per the <10 line lambda rule in docs/COMMON_ERRORS.md. No functional change. Tested: - Tested on AST2600 SoC. - getUserInfo/afterGetUserInfo: sent an authenticated Basic-auth Redfish GET and confirmed a 200 response with no "Failed to populate user information" error in journalctl, proving populateUserInfo() succeeded via the extracted callback. - onRequestRecv/afterCompleteRequest: RSV's client uses HTTP/1.1, so it does not exercise this HTTP/2-only code path. Instead, used "curl --http2" and confirmed ALPN negotiated h2 and the request completed as HTTP/2 200. journalctl -u bmcweb confirmed both "onRequestRecv streamId:1" and the extracted callback's "res.completeRequestHandler called" fired for that stream. - Redfish Service Validator: 5830 Pass / 353 Warn / 0 Fail. Change-Id: I0e6365c682f6acc8d39510ad5f1fe239d747154f Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-19Refactor eventlog_utils respHandler lambdasYuvakumar Selvamani1-42/+50
The dBusEventLogEntryDelete and dBusLogServiceActionsClear functions each contained an inline respHandler lambda that triggered the long-lambda ast-grep rule, requiring an inline suppression (// ast-grep-ignore: long-lambda). This commit extracts each lambda into a separate named function, afterDBusEventLogEntryDelete and afterDBusLogServiceActionsClear respectively, and uses std::bind_front to handle the asynchronous callback. This aligns the code with the preferred bmcweb pattern for D-Bus callbacks, improves readability, and allows the removal of the static analysis suppressions. Tested on AST2600 SoC (with PACKAGECONFIG `redfish-dbus-log` enabled; disabled by default). - `DELETE .../EventLog/Entries/1` (real entry) Expected: HTTP 200 Base.1.19.Success, entry removed Actual: HTTP 200 Base.1.19.Success, entry removed - `DELETE .../EventLog/Entries/999` (nonexistent) Expected: HTTP 404 Base.1.19.ResourceNotFound Actual: HTTP 404 Base.1.19.ResourceNotFound - `POST .../EventLog/Actions/LogService.ClearLog` Expected: HTTP 200 Base.1.19.Success, all entries cleared Actual: HTTP 200 Base.1.19.Success, all entries cleared - RSV: 5845 Pass / 353 Warn / 0 Fail Change-Id: I323a0813fef4f04622a71f27258fe9b1930ec6cd Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-19redfish-core: Refactor ThermalSubsystem HeadYuvakumar Selvamani1-14/+19
Extract the long respHandler lambda in handleThermalSubsystemCollectionHead() into a named function, doThermalSubsystemCollectionHead(), bound via std::bind_front(), matching the pattern used elsewhere in the file, per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. Tested on AST2600 SoC: - `HEAD /redfish/v1/Chassis/<invalid-id>/ThermalSubsystem` Expected: HTTP 404 Base.1.19.ResourceNotFound Actual: HTTP 404 Base.1.19.ResourceNotFound - `HEAD /redfish/v1/Chassis/<valid-id>/ThermalSubsystem` Expected: HTTP 200 with Link: </redfish/v1/JsonSchemas/ThermalSubsystem/ThermalSubsystem.json> Actual: HTTP 200 with the identical Link header - confirms the extracted doThermalSubsystemCollectionHead() success branch - Redfish Service Validator: 5845 Pass / 353 Warn / 0 Fail Change-Id: I9ae5884bf207f79527bc83f1655a7cee9c0b88bb Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-19Test dbusToRfBootType and dbusToRfBootModeVinothkumar Shanmugavel1-0/+33
Add coverage for dbusToRfBootType() and dbusToRfBootMode(), which translate D-Bus boot configuration values into Redfish enum values. Verify the supported boot type values Legacy and EFI map to BootSourceOverrideMode::Legacy and BootSourceOverrideMode::UEFI. Verify the supported boot mode values Regular, Safe, and Setup map to BootSource::None, BootSource::Diags, and BootSource::BiosSetup. Also verify that unknown D-Bus values return the corresponding Invalid enum value instead of being silently interpreted as a valid setting. Tested: - meson test -C builddir system_test -v - All 6 system_test tests passed, including both new tests Change-Id: I926187c3e87abc4baf2af22a6ca6f689c03dcd77 Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
2026-09-18redfish-core: Refactor AggregationSource lambdaYuvakumar Selvamani1-17/+20
Extract the long getSatelliteConfigs() callback lambda in handleAggregationSourcePatch() into a named function, afterGetSatelliteConfigsForPatch(), bound via std::bind_front(), per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. Tested: - Sent PATCH /redfish/v1/AggregationService/AggregationSources/<id> for an AggregationSourceId that exists in Entity Manager sources and confirmed PropertyNotWritable is returned for UserName, same as before the refactor. - Sent PATCH for an AggregationSourceId that doesn't exist anywhere and confirmed ResourceNotFound is returned, same as before. - Redfish Service Validator passed with no new errors or warnings introduced. Change-Id: I995b97730b5a2b224f30e7afceb3e2c3c3c2e6ff Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-18Refactor installCertificate lambdaYuvakumar Selvamani1-23/+24
Extract the long D-Bus async_method_call callback lambda in the former installCertificate() into a named function, afterInstallCertificate(), bound via std::bind_front() and wrapped in std::function, per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. installCertificate() was a static, single-caller wrapper, so its body is now inlined directly into its only caller, regenerateCertificateIfHostnameChanged(), removing the redundant indirection. Tested: - Tested on AST2600 SoC. Triggered a real hostname-change D-Bus signal (busctl set-property .../network/config xyz.openbmc_project.Network.SystemConfiguration HostName s "bmc-test") to exercise regenerateCertificateIfHostnameChanged() end-to-end. journalctl -u bmcweb confirmed the new afterInstallCertificate() callback ran and logged "Replace HTTPs Certificate Success" after the real Certs.Replace D-Bus call, and the temp file (/tmp/hostname_cert.tmp) was removed as expected. - Verified the new cert was actually installed and served: $ curl -sk -v https://BMC_IP/redfish/v1/ -o /dev/null 2>&1 | grep \ subject: * subject: C=US; O=OpenBMC; CN=bmc-test - Verified Redfish still healthy post-reload: $ curl -sk -u BMC_USER:BMC_PASS -o /dev/null -w "HTTP %{http_code}\n"\ https://BMC_IP/redfish/v1/Managers/bmc HTTP 200 - Redfish Service Validator: 5830 Pass / 353 Warn / 0 Fail. Change-Id: I8cfbbc8eeefa6f6cc3bd8d291d93876cc869d47c Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-18subprocessor: Add Status.State/Health to coresGeorge Liu3-9/+79
Populate Redfish Status.Health and Status.State for processor core resources resource_utils::getResourceState() and getResourceHealth() are extended to accept MapperServiceMap and use the first service implementing the required interface. This avoids duplicate requests when multiple services advertise the same interface for a core object This commit also changes the iterator name in HEAD and GET path from `it` to `coreIt` for better readability as well as passing coreId by reference to avoid copies Tested: ``` curl -k -X GET https://${bmc}/redfish/v1/Systems/system/Processors/cpu0/SubProcessors/core0 { ... "Status": { "Health": "OK", "State": "Enabled" } } ``` - Where "State" can be "Present", "Available", "Enabled" - Redfish Validator Passed Change-Id: I5833541dceb9627b56b96e8235afcde78a09081f Signed-off-by: Myung Bae <myungbae@us.ibm.com> Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
2026-09-17redfish-core: Refactor getDimmDataByService lambdaYuvakumar Selvamani1-13/+17
Extract the long D-Bus GetAllProperties callback lambda in getDimmDataByService() into a named function, afterGetDimmDataByService(), bound via std::bind_front(). This follows the <10-line lambda coding standard in docs/COMMON_ERRORS.md. Tested on a live platform against a real D-Bus Dimm object: - GET /redfish/v1/Systems/system/Memory/<id> returns all expected Memory properties (CapacityMiB, MemoryType, MemoryDeviceType, OperatingSpeedMhz, MemoryLocation, ProductionDate, etc.) correctly populated from the DBus GetAllProperties response. - Redfish Service Validator passed with 0 failures overall (5853 Pass / 353 Warn / 0 Fail), including 0 Fail on /redfish/v1/Systems/system/Memory and /redfish/v1/Systems/system/Memory/<id>. Change-Id: I3898dd21a7a55ac1f51c6aaf6bac298c6644f7e5 Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-17webserver_cli: Refactor setLogLevel lambdaYuvakumar Selvamani1-12/+18
Extract the long D-Bus async_method_call callback lambda in setLogLevel() into a named function, afterSetLogLevel(), bound via std::bind_front() and wrapped in std::function, per the <10 line lambda coding standard in docs/COMMON_ERRORS.md. Also take the D-Bus error_code callback parameter by const reference instead of a mutable reference, per review comment. Tested: - Ran `bmcweb loglevel debug` on a running BMC against the live bmcweb daemon's xyz.openbmc_project.bmcweb SetLogLevel D-Bus method. The async_method_call completed through the new afterSetLogLevel() callback, printed "logging level changed to: DEBUG", and the CLI process exited 0. - Confirmed the level change actually took effect on the daemon: a subsequent Redfish GET request produced verbose DEBUG-level trace lines in `journalctl -u bmcweb` (e.g. http2_connection.hpp, http_body.hpp entries) that are suppressed at the default INFO level. - Redfish Service Validator passed with 0 failures (5822 Pass / 353 Warn / 0 Fail). Change-Id: I7ee42c25996cc6da98eab4af4535de0f95e110cd Signed-off-by: Yuvakumar Selvamani <yuvakumars@ami.com>
2026-09-17Use enum for BootProgressTypes propertyVinothkumar Shanmugavel1-48/+51
The dbusToRfBootProgress() function returns boot progress states as std::string literals, lacking compile-time type safety. This can lead to typos or invalid values that are only caught at runtime. Convert this function to return computer_system::BootProgressTypes enum instead. This enum is already defined in generated/enums/computer_system.hpp with NLOHMANN_JSON_SERIALIZE_ENUM mapping and provides proper type checking. Tested: - Verified BootProgress LastState property serializes to identical JSON values. - Redfish Service Validator: PASS: 5923, WARN: 356, FAIL: 0, NOT TESTED: 4594 Change-Id: Ida8d4c71c6cea02193b037a3dcc9670feeb1eced Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
2026-09-17Report JSON values in errors, not quoted stringsBill Chan3-5/+6
The value argument of PropertyValueTypeError, PropertyValueNotInList and PropertyValueIncorrect is a nlohmann::json that the message formatter dumps. Passing a string literal therefore renders the JSON string "null", "true" or "false" rather than the JSON null, true or false the client actually sent, so the error text does not match the request body. Pass the JSON value instead: - account_service: JSON null for a deleted RemoteRoleMapping entry, and the boolean *params.locked for a rejected Locked request - network_protocol: JSON null for a deleted NTP server - ethernet: JSON false for VLAN/VLANEnable Tested: Verified on a QEMU BMC, machine cypress, running a downstream OpenBMC build carrying this change. Each value below now renders as the JSON literal the client sent rather than as a quoted string. PATCH /redfish/v1/AccountService with {"LDAP":{"RemoteRoleMapping":[null]}} reports Base.1.19.PropertyValueTypeError with MessageArgs ["null", "RemoteRoleMapping/0"]. PATCH /redfish/v1/AccountService/Accounts/root with {"Locked":true} returns HTTP 400 and Base.1.19.PropertyValueNotInList with MessageArgs ["true", "Locked"]. PATCH /redfish/v1/Managers/bmc/NetworkProtocol with {"NTP":{"NTPServers":[null]}} returns HTTP 400 and Base.1.19.PropertyValueNotInList with MessageArgs ["null", "NTP/NTPServers/0"]. POST /redfish/v1/Managers/bmc/EthernetInterfaces with a VLAN whose VLANEnable is false returns HTTP 400 and Base.1.19.PropertyValueIncorrect with MessageArgs ["VLAN/VLANEnable", "false"]. For contrast, on the same build a genuine string value still renders quoted: a rejected RoleId reports ["\"Bogus\"", "RoleId"]. Change-Id: I8b747a17eacb77687f526d4603876446287974b2 Signed-off-by: Bill Chan <bill_chan@jabil.com>
2026-09-17Fix argument order in Redfish error messagesBill Chan6-12/+13
Several error message calls pass their arguments in the order the message text reads rather than the order the function declares, so the rendered message names the value as the property, or names the resource instance as its type. The declarations in redfish-core/include/error_messages.hpp are: - propertyValueFormatError(value, property) - propertyValueIncorrect(property, value) - resourceNotFound(type, name) - actionParameterNotSupported(parameter, action) Swap the arguments at the affected call sites: - certificate_service: ChallengePassword is the parameter of the GenerateCSR action, matching the five sibling calls in the file - processor: report the rejected URI as the value of AppliedOperatingConfig - aggregation_service: report HostName as the property and the submitted hostname as the value - metric_report_definition: report the MetricProperties index as the property and the offending URI as the value - hypervisor_system: the missing resource is an ActionInfo named ResetActionInfo, not a resource of type hypervisor - sensors: report the type Sensor and the requested sensor as the name Tested: Verified on a QEMU BMC, machine cypress, running a downstream OpenBMC build carrying this change. GET /redfish/v1/Chassis/<id>/Sensors/nosuchsensor returns HTTP 404 and Base.1.19.ResourceNotFound with MessageArgs ["Sensor", "nosuchsensor"], naming the resource type first and the requested sensor second. The second lookup path, GET .../Sensors/temperature_NoSuchSensor, returns the same message with ["Sensor", "temperature_NoSuchSensor"]. PATCH /redfish/v1/Systems/system/Processors/P0 with {"AppliedOperatingConfig":{"@odata.id":"not a uri"}} returns HTTP 400 and Base.1.19.PropertyValueFormatError with MessageArgs ["\"not a uri\"", "AppliedOperatingConfig"]. POST /redfish/v1/TelemetryService/MetricReportDefinitions with a MetricProperties entry of /redfish/v1/Managers/bmc returns HTTP 400 and Base.1.19.PropertyValueIncorrect with MessageArgs ["MetricProperties/0", "\"/redfish/v1/Managers/bmc\""]. PATCH of a MetricReportDefinition created beforehand with a valid MetricProperties entry, carrying that same /redfish/v1/Managers/bmc URI, returns HTTP 400 and the same Base.1.19.PropertyValueIncorrect with MessageArgs ["MetricProperties/0", "\"/redfish/v1/Managers/bmc\""], covering the second call site. A CertificateService.GenerateCSR request carrying a ChallengePassword returns HTTP 400 and Base.1.19.ActionParameterNotSupported with MessageArgs ["ChallengePassword", "GenerateCSR"]. Redfish Service Validator 3.1.3 passing against the same QEMU BMC: PASS 21948, WARN 789, FAIL 0. docs/TESTING.md asks for that run on real hardware, where the resource tree is more complete; no hardware was available for this change, so the run and its tree are QEMU's. Not exercised on that build: the two AggregationSource sites, since redfish-aggregation is disabled there, and the hypervisor ResetActionInfo site, since hypervisor-computer-system is disabled. Change-Id: Ia0b405bc7fc5993fe9b9ac81735b9e605f3eee01 Signed-off-by: Bill Chan <bill_chan@jabil.com>
2026-09-16Use enums for boot override propertiesVinothkumar Shanmugavel1-21/+22
The dbusToRfBootType() and dbusToRfBootMode() functions return boot configuration values as std::string literals, which lacks compile-time type safety. This can lead to typos or invalid values that are only caught at runtime. Convert these functions to return computer_system::BootSourceOverrideMode and computer_system::BootSource enums instead. These enums are already defined in generated/enums/computer_system.hpp with NLOHMANN_JSON_SERIALIZE_ENUM mappings and provide proper type checking. For unrecognized D-Bus values, omit the corresponding optional boot property instead of returning internalError. This allows clients to receive the remaining ComputerSystem properties. Tested: - Verified BootSourceOverrideMode property serializes to identical JSON values. - Verified BootSourceOverrideTarget property serializes to identical JSON values. - Redfish Service Validator: PASS: 5923, WARN: 356, FAIL: 0, NOT TESTED: 4594 Change-Id: I4ee40e94ccaa3f925ea3aadb5b70ba3fe03124e6 Signed-off-by: Vinothkumar Shanmugavel <vinothkumars@ami.com>
2026-09-15led: refactor setSystemLocationIndicatorActiveEric Liu1-13/+19
The callback is over the 10 line lambda limit and carried an ast-grep-ignore comment. Move it into afterSetLocationIndicatorBlink(). std::bind_front() does not work with sdbusplus::asio::setProperty, so a short lambda forwards to it. Tested: unit-test CI passes. No functional change. Change-Id: I86c37af5c15cb153149c3b9fefb6ac97345f3c19 Signed-off-by: Eric Liu <liuer@nvidia.com>
2026-09-15processor: refactor OperatingConfig lambdasEric Liu1-163/+170
The three D-Bus response callbacks in this file are over the 10 line lambda limit and carried an ast-grep-ignore comment. Move them into the named functions afterGetOperatingConfigData(), afterGetOperatingConfigCollection() and afterGetOperatingConfig(). Tested: unit-test CI passes. No functional change. Change-Id: I99ea43da39ff4a3cdcfc84b09e2bedb7cbb00e78 Signed-off-by: Eric Liu <liuer@nvidia.com>
2026-09-15led: refactor getSystemLocationIndicatorActiveEric Liu1-42/+49
Both callbacks are over the 10 line lambda limit and carried an ast-grep-ignore comment. Move them into afterGetLocationIndicatorBlink() and afterGetLocationIndicatorEnclosure(), named after the LED group each one reads. Tested: unit-test CI passes. No functional change. Change-Id: Ie23b20cc774b84188f2c887decad6b59e7f790aa Signed-off-by: Eric Liu <liuer@nvidia.com>
2026-09-12meson: fallback to boost shared libraryPatrick Williams1-1/+22
Commit 5e2f0997 forced linking against static boost libraries, but not all distributions supply them. Add some code to detect if we successfully can link against the static libraries for modules, boost url in this case, and fallback to shared libraries if not. Tested: bmcweb builds and links on Gentoo now. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ie0041b872be1f40f7a76081bf0a673d9bf96be2c