ab8cbe45 | 05-Mar-2025 |
Myung Bae <myungbae@us.ibm.com> |
Refactor Cable code
It is refactoring Cable code for the future incoming codes into the area. It includes the following to reduce the body size via the smaller functions. - getCableProperties - req
Refactor Cable code
It is refactoring Cable code for the future incoming codes into the area. It includes the following to reduce the body size via the smaller functions. - getCableProperties - requestRoutesCable
Tested: - GET Cable gives the same result as before
Change-Id: I67d17da4acd09080cbacead07678d24119c4c2b5 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
f90af522 | 18-Mar-2025 |
Abiola Asojo <abiola.asojo@ibm.com> |
Fix getting a response for wrong URI
Resolve getting a response for wrong URI in Update Service URI (/redfish/v1/UpdateService/FirmwareInventory/)
- After the fix a wrong URI that partially matches
Fix getting a response for wrong URI
Resolve getting a response for wrong URI in Update Service URI (/redfish/v1/UpdateService/FirmwareInventory/)
- After the fix a wrong URI that partially matches the last characters in a valid URI now gets a 404 as shown in the example below :
$ curl -k -H "X-Auth-Token: $bmc_token" -X GET https://$bmc/redfish/v1/UpdateService/FirmwareInventory/5e { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The resource at the URI '/redfish/v1/ UpdateService/FirmwareInventory/5e' was not found.", "MessageArgs": [ "/redfish/v1/UpdateService/FirmwareInventory/5e" ], "MessageId": "Base.1.19.ResourceMissingAtURI", "MessageSeverity": "Critical", "Resolution": "Place a valid resource at the URI or correct the URI and resubmit the request." } ], "code": "Base.1.19.ResourceMissingAtURI", "message": "The resource at the URI '/redfish/v1/ UpdateService/FirmwareInventory/5e' was not found." }
- Two common errors were fixed with the changes - imprecise-matching - not-responding-to-404
- The fix also includes changes to the software images to only look under /xyz/openbmc_project/software/.
Tested: No longer getting a response for wrong URI in Update Service URI.
Change-Id: I72d8452b8ca1ef095d093a57bc14fade380be617 Signed-off-by: Abiola Asojo <abiola.asojo@ibm.com>
show more ...
|
9f03894e | 10-Mar-2025 |
Rohit PAI <ropai@nvidia.com> |
Enhance Task removal when queue is full
Bmcweb operates with fixed queue length for tasks. The current code removes the oldest task when queue is full. This makes task status unavailable if the firs
Enhance Task removal when queue is full
Bmcweb operates with fixed queue length for tasks. The current code removes the oldest task when queue is full. This makes task status unavailable if the first task was still running and was not yet completed.
The MR brings enhancement to remove the oldest completed/aborted task. If all tasks are in running state then it removes the oldest task.
Tested - UT passes - Created long running task after boot-up followed by 100 short running tasks which completed fast. Long running task status was still available after task queue become full.
Change-Id: Ida5d4a84c2b51a4797c50677ce5c4ef2607f09a3 Signed-off-by: Rohit PAI <ropai@nvidia.com>
show more ...
|
4d7b5ddb | 26-Feb-2025 |
Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com> |
mtls: implement UPN parse mode
This commit is intended to implement the UserPrincipalName (UPN) parse mode on mutual TLS (MTLS). By implementing this we can use the X509 certificate extension Subjec
mtls: implement UPN parse mode
This commit is intended to implement the UserPrincipalName (UPN) parse mode on mutual TLS (MTLS). By implementing this we can use the X509 certificate extension Subject Alternative Name (SAN), specifically UPN to be used as the username
In our case, this feature is needed because we have a specific format on our Subject CN of X509 certificate. This format cannot directly mapped to the username of bmcweb because it contains special characters (`/` and `:`), which cannot exist in the username. Changing the format of our Subject CN is very risky. By enabling this feature we can use other field, which is the SAN extension to be used as the username and do not change our Subject CN on the X509 certificate
In general, by implementing this feature, we can enable multiple options for the system. There might be other cases where we want to have the username of the bmcweb is not equal to the Subject CN of the certificate, instead the username is added as the UserPrincipalName field in the certificate
The format of the UPN is `<username>@<domain>` [1][2]. The format is similar to email format. The domain name identifies the domain in which the user is located [3] and it should match the device name's domain (domain forest).
Tested - Test using `generate_auth_certificate.py` (extended on patch [4]) - Manual testing (please see the script mentioned above for more detail) - Setup certificate with UPN inside SAN extension - Change the CertificateMappingAttribute to use UPN - Get request to `/SessionService/Sessions` - Run unit tests
[1] UPN Format: https://learn.microsoft.com/en-us/windows/win32/secauthn/user-name-formats#user-principal-name [2] UPN Properties: https://learn.microsoft.com/en-us/windows/win32/ad/naming-properties#userprincipalname [3] UPN Glossary: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-wcce/719b890d-62e6-4322-b9b1-1f34d11535b4#gt_9d606f55-b798-4def-bf96-97b878bb92c6 [4] Patch Testing Script: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/78837
Change-Id: I490da8b95aee9579546971e58ab2c4afd64c5997 Signed-off-by: Malik Akbar Hashemi Rafsanjani <malikrafsan@meta.com>
show more ...
|
1940677a | 04-Mar-2025 |
Gunnar Mills <gmills@us.ibm.com> |
Up the default code update timeout
This timer is the time to write the image to /tmp/images/, the code update app to untar and create a xyz.openbmc_project.Software.Activation interface.
We have se
Up the default code update timeout
This timer is the time to write the image to /tmp/images/, the code update app to untar and create a xyz.openbmc_project.Software.Activation interface.
We have seen this take just over 25 seconds a few times, in one case it took 30 seconds, and this times out. We are using a large image, 150MB+, and other requests are going on but believe our use case is valid, so bump the default timeout to 50 seconds.
In the times it has timed out, the time appears split between 1 and 2. With 1) writing the image to /tmp/images and inotify firing and 2) phosphor-version-software-manager untarring the image and creating the interface.
In the future this code should go away with the new code update, this commit is more to note code updates can be slow due to the BMC's limited resources and larger code update images exist.
``` // Can conclude the timer was set at 13:55:27... Wed Feb 5 13:55:42 2025 xxx phosphor-version-software-manager: Untaring /tmp/images/f285ea12-b506-4182-86bc-b9706f09bc1f to /tmp/images/imagek9D7Iu Wed Feb 5 13:55:52 2025 xxx bmcweb: [ERROR update_service.hpp:427] FW image may has already been uploaded to server Wed Feb 5 13:55:52 2025 xxx bmcweb: [ERROR update_service.hpp:426] Timed out waiting for firmware object being created Wed Feb 5 13:55:52 2025 xxx bmcweb: [CRITICAL error_messages.cpp:287] Internal Error /usr/src/debug/bmcweb/1.0+git/redfish-core/lib/update_service.hpp(438:41) `void redfish::afterAvailbleTimerAsyncWait(const std::shared_ptr<bmcweb::AsyncResp>&, const boost::system::error_code&)`: ```
Tested: Since bumping this timeout haven't hit this timeout.
Change-Id: I9f2ce9a24a55d72484113b3fbe226dc76b0bd2a5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
cc67d0a0 | 01-Feb-2025 |
rohitpai <rohitpai77@gmail.com> |
Migration of OpenBMC Manager OEM schema
With the support of OEM route infrastructure each OEM implementation can be separated into an OEM route handler. The MR migrates OEM resource of manager resou
Migration of OpenBMC Manager OEM schema
With the support of OEM route infrastructure each OEM implementation can be separated into an OEM route handler. The MR migrates OEM resource of manager resource into new files and route handlers
Tested - All unit tests are passing - GET request on /redfish/v1/Managers/<bmcid> has OpenBMC OEM properties
Change-Id: I935524dcdad6a6cc38a5532b6e7e7ffa1cb0369f Signed-off-by: rohitpai <rohitpai77@gmail.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
d98a2f93 | 06-Feb-2025 |
Ed Tanous <etanous@nvidia.com> |
Remove getIoContext from Request object
At one point it was thought that we could pass the io_context object through the request object, and have the potential to run multiple io_context instances (
Remove getIoContext from Request object
At one point it was thought that we could pass the io_context object through the request object, and have the potential to run multiple io_context instances (one per connection).
Given the safety refactoring we had to do in 9838eb20341568971b9543c2187372d20daf64aa that idea is on ice for the moment, and would need a major rethink of code to be viable. For the moment, and in prep for https://gerrit.openbmc.org/c/openbmc/bmcweb/+/75668
make sure all calls are pulling from the same io object.
Tested: Unit tests pass. Redfish service validator passes.
Change-Id: I877752005c4ce94efbc13ce815f3cd0d99cc3d51 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
46f780f7 | 09-Feb-2025 |
Ed Tanous <etanous@nvidia.com> |
Move chassis and trigger to dbus utility
Using the utility classes reduces compile times and reduces the number of template specializations that get generated. These are the last two left in the co
Move chassis and trigger to dbus utility
Using the utility classes reduces compile times and reduces the number of template specializations that get generated. These are the last two left in the codebase for getProperty, so fix them.
Tested: On Last commit.
Change-Id: I0ca8411b74b58dbeb42587b88cfd66c0e674b8c8 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
4a19a7b5 | 27-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Deduplicate event ids
Redfish specification states: ``` The value of the id field shall be the same as the Id property in the event payload. The value of the Id property in the event payload should
Deduplicate event ids
Redfish specification states: ``` The value of the id field shall be the same as the Id property in the event payload. The value of the Id property in the event payload should be the same as the EventId property of the last event record in the Events array. The value of the EventId property for an event record should be a positive integer value and should be generated in a sequential manner. ```
The event service code did not implement that correctly. So: 1. Add ID fields for all events. 2. Remove the per-sse connection id field and rely solely on EventServiceManager. 3. Make sure all paths, (including metric report) are generating an event id that's based on the eventservice event id
Tested: Redfish event listener now sees events populated. LastEventId when sent to the SSE socket now sees a contiguous id.
``` uri=$(curl -s --user "root:0penBmc" -k "https://192.168.7.2/redfish/v1/EventService" | jq -r .ServerSentEventUri) curl -u root:0penBmc -vvv -k -N -H "Accept: text/event-stream" -H "Last-Event-Id: 0" "https://192.168.7.2$uri" ```
Change-Id: Ic32e036f40a53a9b2715639ae384d7891c768260 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
504af5a0 | 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
92e11bf8 | 31-Jan-2025 |
Myung Bae <myungbae@us.ibm.com> |
Use specific misc-include-cleaner statement
There are a few places that which clang-tidy seems reporting false-positives and which can be suppressed either via using `modernize-deprecated-headers`
Use specific misc-include-cleaner statement
There are a few places that which clang-tidy seems reporting false-positives and which can be suppressed either via using `modernize-deprecated-headers` or more targeted inline `misc-include-cleaner` statement.
Tested: Compiles
Change-Id: Ib609adbe8619f4b9a84e08388eea1e7cee58aa54 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
9838eb20 | 29-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Move io context to singleton
The way we pass around io contexts is somewhat odd. Boost maintainers in slack recommended that we just have a method that returns an io context, and from there we can
Move io context to singleton
The way we pass around io contexts is somewhat odd. Boost maintainers in slack recommended that we just have a method that returns an io context, and from there we can control this (context link lost years ago).
The new version of clang claims the singleton pattern of passing in an io_context pattern is a potential nullptr dereference. It's technically correct, as calling the singleton without immediately initializing the io context will lead to a crash.
This commit implements what the boost maintainers suggested, having a single method that returns "the context" that should be used. This also helps to maintain isolation, as some pieces are no longer tied directly to dbus to get their reactor.
Tested: WIP
Change-Id: Ifaa11335ae00a3d092ecfdfb26a38380227e8576 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
d7857201 | 28-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is largely just taking the clang-recommended fixes and checking them in. Subsequent patches will fix the more unique issues.
Note, that a number of new ignores are added into the .clang-tidy file. These can be cleaned up over time as they're understood. The majority are places where boost includes a impl/x.hpp and x.hpp, but expects you to use the later. include-cleaner opts for the impl, but it isn't clear why.
Change-Id: Id3fdd7ee6df6c33b2fd35626898523048dd51bfb Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
3d66430a | 29-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Move hostlogger utilities
clang-tidy misc-include-fixer tries to remove the log_services.hpp include from systems_logsevices_hostlogger.hpp file. This causes these two helper functions to go missin
Move hostlogger utilities
clang-tidy misc-include-fixer tries to remove the log_services.hpp include from systems_logsevices_hostlogger.hpp file. This causes these two helper functions to go missing.
These arguably should've been moved in 7945eeed0fe8f9c7bf07669294499ae0108da1d3 where we created this file, but the second best time to plant a tree is now, so move them.
Tested: Code compiles. No test harnesses for hostlogger.
Change-Id: Ic0693472deb6c3bd355f042a0105661fa0873dfe Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
cf91c8c4 | 24-Jan-2025 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
Fix crash when modifying static v6 default gateway
When modifying a static default gateway, the existing entry is deleted, and a new D-Bus object is created with the updated gateway.
Currently, thi
Fix crash when modifying static v6 default gateway
When modifying a static default gateway, the existing entry is deleted, and a new D-Bus object is created with the updated gateway.
Currently, this operation fails with an Internal Server Error and causes a bmcweb crash because the gateway value is passed as a std::string_view. Debugging revealed that the data's lifetime ends before it is accessed.
This commit resolves the issue by replacing std::string_view with const std::string&.
Tested By: Assuming there are currently three IPv6StaticDefaultGateways configured, the following command modifies the second entry:
''' PATCH -D patch.txt -d '{"IPv6StaticDefaultGateways": [{},{"Address": "<new modified gateway>"},{}]}' https://${bmc}/redfish/v1/Managers/bmc/EthernetInterfaces/eth1 '''
Change-Id: I1bd18005fb71a1567b1844b04c4cc4cd322cdf6e Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
show more ...
|
6e78b680 | 13-Dec-2024 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
network: fix dhcp values in redfish response
Whenever IPv6 SLAAC is enabled and DHCPv4 is enabled, the "DHCPEnabled" value in the backend will be "v4v6stateless". Currently in bmcweb, the check to t
network: fix dhcp values in redfish response
Whenever IPv6 SLAAC is enabled and DHCPv4 is enabled, the "DHCPEnabled" value in the backend will be "v4v6stateless". Currently in bmcweb, the check to translate this value to bool for ipv4 is not present and will return false. That means, "DHCPEnabled" is wrongly displayed 'false' while the correct value is 'true'.
Change-Id: I8713d73727c6a382f06b7bf0d598ab61a757e1e3 Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
show more ...
|
40e9b92e | 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This pa
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This patchset does not intend to modify any intent on any existing copyrights or licenses, only to standardize their inclusion.
[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects
Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
60e995cd | 09-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Break out journal utils
A number of the journald utilities are distinct from Redfish, and could be reused. Functions moved are copy/paste with no modifications.
Tested: Journald LogService GET sti
Break out journal utils
A number of the journald utilities are distinct from Redfish, and could be reused. Functions moved are copy/paste with no modifications.
Tested: Journald LogService GET still functions correctly Redfish service validator fails no new checks.
Change-Id: Icf1c28152e14f3e0c1c5203aac50c40d56bb272e Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
f1137a9d | 06-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Remove base from journal calls
Base from the journal helper function. This is only ever used for base10, and is only used in one spot. There's no need need to have this as an argument. Just use d
Remove base from journal calls
Base from the journal helper function. This is only ever used for base10, and is only used in one spot. There's no need need to have this as an argument. Just use defaults.
Tested: Redfish service validator passes. Journal entries at /redfish/v1/Managers/LogService/Journal/Entries look correct
Change-Id: I427ddde1c1fc89cb8116fd9cb30b8fd799ba58b5 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
a6bd55b0 | 13-Jan-2025 |
Gunnar Mills <gmills@us.ibm.com> |
Add path of problem device to trace
Needed this to debug a problem. Makes this trace a lot more useful.
Tested: This now printed the devices causing the problems.
Change-Id: I0cb1529cfa9fec4334730
Add path of problem device to trace
Needed this to debug a problem. Makes this trace a lot more useful.
Tested: This now printed the devices causing the problems.
Change-Id: I0cb1529cfa9fec4334730cab1cf2010a00218b6e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
7da633f0 | 02-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Clang-tidy updates for 19
Update to add new checks that are now available to us. Fix the minor issues we have. A few of our checks that we previously had enabled have been renamed, so remove those
Clang-tidy updates for 19
Update to add new checks that are now available to us. Fix the minor issues we have. A few of our checks that we previously had enabled have been renamed, so remove those from the file as well.
Change-Id: Idbbfc3cb7ba42ac780e557554d7ae8ab190e7551 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
492ec93a | 09-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Refactor large lambda
Similar to other patches, refactor this large lambda into a normal function.
Tested: Redfish service validator passes
Change-Id: I45e0b421f04ad8351de367bfdc7b8512bf10ca45 Sig
Refactor large lambda
Similar to other patches, refactor this large lambda into a normal function.
Tested: Redfish service validator passes
Change-Id: I45e0b421f04ad8351de367bfdc7b8512bf10ca45 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
58c71488 | 19-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Transition to simpler trigger interface
Using this simpler interface allows us to simplify the unpacking code, and remove the use of a variant containing a variant, which has caused bugs in the past
Transition to simpler trigger interface
Using this simpler interface allows us to simplify the unpacking code, and remove the use of a variant containing a variant, which has caused bugs in the past. Splitting these apart allows us to replicate the Redfish interfaces with less code.
Tested:
Discrete and Numeric triggers both create correctly ``` curl -k --user "root:0penBmc" -H "Content-Type: application/json" -X POST https://192.168.7.2/redfish/v1/TelemetryService/Triggers -d '{"Name": "eds", "NumericThresholds": {"LowerCritical": {"Reading": 1.0, "Activation": "Increasing", "DwellTime": "P1S"}}}' curl -k --user "root:0penBmc" -H "Content-Type: application/json" -X POST https://192.168.7.2/redfish/v1/TelemetryService/Triggers -d '{"Name": "eds", "DiscreteTriggers": [{"DwellTime": "P1S", "Severity": "OK", "Value": "1234"}]}
```
Change-Id: If898e2285f90f78b22e47cc670e4206ba4368665 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
e3648032 | 16-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Make trigger use common types
Trigger having its own variant causes us to duplicate code. This was left out of the original refactoring because it was complex given the variant of a variant status.
Make trigger use common types
Trigger having its own variant causes us to duplicate code. This was left out of the original refactoring because it was complex given the variant of a variant status.
This commit finally does the port.
Tested: Unclear what tests exist for triggers that would use this code ``` curl -k --user "root:0penBmc" -H "Content-Type: application/json" -X POST https://192.168.7.2/redfish/v1/TelemetryService/Triggers -d '{"Name": "eds", "NumericThresholds": {"LowerCritical": {"Reading": 1.0, "Activation": "Increasing", "DwellTime": "P1S"}}}' ```
Succeeds. GET on the resource results in: { "@odata.id": "/redfish/v1/TelemetryService/Triggers/eds", "@odata.type": "#Triggers.v1_2_0.Triggers", "Id": "eds", "Links": { "MetricReportDefinitions": [] }, "MetricProperties": [], "MetricType": "Numeric", "Name": "eds", "NumericThresholds": { "LowerCritical": { "Activation": "Increasing", "DwellTime": "PT1.000S", "Reading": 1.0 } }, "TriggerActions": [] }
Change-Id: I8f683cc9423ee2ba111d3ca1889e78f7d33433c9 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
dac07cad | 31-Dec-2024 |
Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com> |
Fix MRD patch request with overwriting metrics
Follow-up for [1] Patch request with body:
{"Metrics": [{"MetricProperties": ["<path_to_sensor>"]}]}
updates metric properly, without appending to ol
Fix MRD patch request with overwriting metrics
Follow-up for [1] Patch request with body:
{"Metrics": [{"MetricProperties": ["<path_to_sensor>"]}]}
updates metric properly, without appending to old "MetricProperties" values
[1]: https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76532
Change-Id: I9e2bbea28f3b17adeb61c7f3e54eec87c103ef54 Signed-off-by: Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com>
show more ...
|