6e1a52fa | 15-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Fix setting gateways
There's a number of conditions in setting gateways that don't work properly. Specifically, one of the issues is setting a gateway on an address that already exists. It returns
Fix setting gateways
There's a number of conditions in setting gateways that don't work properly. Specifically, one of the issues is setting a gateway on an address that already exists. It returns a PropertyValueConflict error on Ipv4Addresses/1/Gateway with Ipv4Addresses/1/Gateway
Obviously an address can't conflict with itself, so this is wrong.
To address this, move the gateway setting and selection code into a routine outside of the main loop, after all the gateways are accounted for, and so we can treat them separately.
Tested; PATCH to an existing ip address works, and no longer returns the error.
More test cases likely needed.
Change-Id: I0339e02fc27164337416637153d0b0f744b64ad8 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
67b2e53b | 11-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Fix clang-tidy for gcc-14
We use these pragmas, that we must've been getting transitively through chrono in the past. Now we need to include them explicitly.
Change-Id: Iee4c0a8866981b91adaa17bee0
Fix clang-tidy for gcc-14
We use these pragmas, that we must've been getting transitively through chrono in the past. Now we need to include them explicitly.
Change-Id: Iee4c0a8866981b91adaa17bee0678b2c10e65ea9 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
6a37140a | 03-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Put simple update behind an option
4e338b2313f9f2a91aa1fb36693e36a328d58933 Removed tftp update support from the codebase, but left SimpleUpdate in a non functional state.
Given that a number of fo
Put simple update behind an option
4e338b2313f9f2a91aa1fb36693e36a328d58933 Removed tftp update support from the codebase, but left SimpleUpdate in a non functional state.
Given that a number of forks have implemented the HTTPS/SCP versions of simple update, we don't want to fully delete the code at this time, so for the moment put it behind an option flag.
Tested: WIP
Change-Id: Ibab1e3a48ff640787eabf8ed5f7a5c08e3381307 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
19ea2864 | 10-Dec-2024 |
Gunnar Mills <gmills@us.ibm.com> |
Always fall back to ChassisType RackMount
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/75914 added support for dynamic ChassisType. Before 75914, ChassisType was hardcoded to RackMount. If you impl
Always fall back to ChassisType RackMount
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/75914 added support for dynamic ChassisType. Before 75914, ChassisType was hardcoded to RackMount. If you implement Inventory.Item.Chassis the default Chassis Type is Unknown. Unknown in 75914 maps to Invalid and ChassisType is left off the Redfish Chassis resource. The Redfish Validator flags this as an error since ChassisType is a required property in the Chassis schema.
The implementations should be setting the ChassisType but let's get bmcweb bumps back on the rails and just set ChassisType = RackMount if there is an error or if the Chassis Type is something we can't map (like Unknown). This "your default ChassisType is RackMount" matches what we had before.
Tested: Inspection and unit tests only.
Change-Id: Id577be522be7c2d3463da9c497d9063a284a4d54 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
8274eb11 | 18-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Simplify journal paging
sd-journal has its own paging mechanisms for generating and seeking to unique ids. Ironically they look fairly similar to what we've implemented here, but they have more con
Simplify journal paging
sd-journal has its own paging mechanisms for generating and seeking to unique ids. Ironically they look fairly similar to what we've implemented here, but they have more content, presumably because they can use internal implementation details to do paging.
This commit switches all sd-journal paging to use cursors. Functionally this changes the odata.id from being a concatenated string into being a base64 encoded identifier that is much longer.
The end result is vastly simplified code.
Tested: check journal script [1] succeeds
[1] https://github.com/openbmc/openbmc-tools/blob/master/check_journal/check_journal
Script runs to completion and shows all tests passed.
Change-Id: Ia49fbfc272bef6dfbe1ea45a8d993dc785041659 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
e7bcf475 | 17-Nov-2024 |
Jayanth Othayoth <ojayanth@gmail.com> |
json utility: fixed core dump during sensor load
bmcweb replaces underscores with spaces in sensor names for better readability. The existing objectKeyCmp function did not handle this case, leading
json utility: fixed core dump during sensor load
bmcweb replaces underscores with spaces in sensor names for better readability. The existing objectKeyCmp function did not handle this case, leading to core dumps in the sensor load path.
Error details are provided below.
``` bmcwebd[1368]: [DEBUG sensors.hpp:507] Added sensor P0_NS_VR_FAN_2 bmcwebd[1368]: terminate called after throwing an instance of 'boost::detail::with_throw_location<boost::system::system_error>' bmcwebd[1368]: what(): leftover [boost.url.grammar:4] ```
Implemented a new algorithm that alphabetically sorts non-URL keys and retains the existing logic for URL-type keys.
Tested: Updated and verified the test cases.
Change-Id: I39c3f7cc54dec5e7cf9658977e1078acb827afb2 Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
340d74c8 | 12-Oct-2024 |
Myung Bae <myungbae@us.ibm.com> |
Handling of OutOfRange in ReadJson
Currently readJsonPatch returns `PropertValueNotInList` in case when an input integer is out of range. This change is to return `PropertyValueOutOfRange` for the
Handling of OutOfRange in ReadJson
Currently readJsonPatch returns `PropertValueNotInList` in case when an input integer is out of range. This change is to return `PropertyValueOutOfRange` for the case out-of-range integer input.
Tested:
- Verify PATCH with an out-of-value integer. e.g. ``` $ curl -k -X PATCH https://${bmc}/redfish/v1/EventService/ -H "Content-Type: application/json" -d '{ "DeliveryRetryIntervalSeconds" : 4294967296}' ```
Before the change, its `MessageId` is `PropertyValueNotInList`. ``` "Message": "The value '4294967296' for the property DeliveryRetryIntervalSeconds is not in the list of acceptable values.", "MessageId": "Base.1.19.0.PropertyValueNotInList", "MessageSeverity": "Warning", "Resolution": "Choose a value from the enumeration list that the implementation can support and resubmit the request if the operation failed." ```
After the change, its `MessageId` will be `PropertyValueOutOfRange`.
``` "Message": "The value '4294967296' for the property DeliveryRetryIntervalSeconds is not in the supported range of acceptable values.", "MessageId": "Base.1.19.0.PropertyValueOutOfRange", "MessageSeverity": "Warning", "Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed." ```
- Redfish Service Validator passes
Change-Id: I0d0c5ecbc9f416b68fa7c0e81a0ea896ec2e50af Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
6fe8751c | 20-Jul-2023 |
George Liu <liuxiwei@inspur.com> |
Implement TemperatureReadingsCelsius property for ThermalMetrics
The ThermalMetrics schema[1] provides for efficient thermal metric gathering for thermal sensors. The schema allows retrieving just t
Implement TemperatureReadingsCelsius property for ThermalMetrics
The ThermalMetrics schema[1] provides for efficient thermal metric gathering for thermal sensors. The schema allows retrieving just the thermal metrics with one Redfish URI. This prevents the additional work required when returning all the sensor data, or multiple Redfish URI calls to retrieve the properties for all of the thermal sensors.
This commit implements the TemperatureReadingsCelsius property of ThermalMetrics[1]. ThermalMetrics is a property of ThermalSubsystem[2]. TemperatureReadingsCelsius is a SensorArrayExcerpt[3].
[1] https://redfish.dmtf.org/schemas/v1/ThermalMetrics.v1_0_1.json [2] https://redfish.dmtf.org/schemas/v1/ThermalSubsystem.v1_3_2.json [3] http://redfish.dmtf.org/schemas/v1/Sensor.v1_9_0.json#/definitions/SensorArrayExcerpt
The temperature sensors are found by finding 'all_sensors' endpoints for specific chassis of D-Bus service /xyz/openbmc_project/sensors/temperature. An entry of SensorArrayExcerpt is built for each temperature sensor retrieved.
Implementation Notes: - Common function sensor_utils::objectPropertiesToJson() is used to fill in sensor excerpt properties. Currently the only excerpt ChassisSubNode is ThermalMetrics. However there are others excerpts defined by Redfish. Right now mostly this is just skipping things, but I'm expecting when other sensor excerpts are implemented that some of the other properties may be added for excerpts as well. I'm expecting the combination of the chassisSubNode and the sensorType will be used to determine which properties are included for a particular call to build a sensor Json representation. - New sensor_utils::objectExcerptToJson() function created. This wraps sensor_utils::objectPropertiesToJson() and builds DataSourceUri for a sensor excerpt. - New sensor_utils::getAllSensorObjects() function created. This builds list of 'all_sensors' association endpoints for specified D-Bus path with specified D-Bus interfaces. Callback function is called with list for handling sensors.
Tested: 1. Redfish Service Validator passed. 2. doGet method: ``` curl -k -H "X-Auth-Token: ${token}" -X GET https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/ThermalMetrics { "@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/ThermalMetrics", "@odata.type": "#ThermalMetrics.v1_0_1.ThermalMetrics", "Id": "ThermalMetrics", "Name": "Thermal Metrics", "TemperatureReadingsCelsius": [ { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps0_temp0", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps0_temp1", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps0_temp2", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp0", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp1", "Reading": -131072000.0 }, { "DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp2", "Reading": -131072000.0 } ], "TemperatureReadingsCelsius@odata.count": 6 } ```
3. Verification of DataSourceUri: ``` curl -k -H "X-Auth-Token: ${token}" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp0 { "@odata.id": "/redfish/v1/Chassis/chassis/Sensors/temperature_ps1_temp0", "@odata.type": "#Sensor.v1_2_0.Sensor", "Id": "temperature_ps1_temp0", "Name": "ps1 temp0", "Reading": -131072000.0, "ReadingType": "Temperature", "ReadingUnits": "Cel", "Status": { "Health": "OK", "State": "Enabled" } } ```
4. A bad chassis ID: ``` curl -k -H "X-Auth-Token: ${token}" -X GET https://${bmc}/redfish/v1/Chassis/chassisBAD/ThermalSubsystem/ThermalMetrics { "error": { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "The requested resource of type Chassis named 'chassisBAD' was not found.", "MessageArgs": [ "Chassis", "chassisBAD" ], "MessageId": "Base.1.18.1.ResourceNotFound", "MessageSeverity": "Critical", "Resolution": "Provide a valid resource identifier and resubmit the request." } ], "code": "Base.1.18.1.ResourceNotFound", "message": "The requested resource of type Chassis named 'chassisBAD' was not found." } } ```
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I6e4ed1f281fd5371c978983b6cc5666badd3752c Signed-off-by: Janet Adkins <janeta@us.ibm.com>
show more ...
|
d3a48a14 | 25-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Refactor eventMatchesFilter
eventMatchesFilter no longer needs to be a member of the Subscription class, because it no longer uses subscription data. Refactor so it can be in its own file, with its
Refactor eventMatchesFilter
eventMatchesFilter no longer needs to be a member of the Subscription class, because it no longer uses subscription data. Refactor so it can be in its own file, with its own set of unit tests.
Tested: Unit Tests pass.
Change-Id: I718fa36021078973609591c704cb717d31079df7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
4b712a29 | 02-Aug-2023 |
Ed Tanous <edtanous@google.com> |
Move UserSubscription to composition
This allows for two very important simplifying changes. First, we can use the default copy operators on the UserSubscription class, which is far less error pron
Move UserSubscription to composition
This allows for two very important simplifying changes. First, we can use the default copy operators on the UserSubscription class, which is far less error prone than writing it manually, which we have two copies of in code already.
Second, it allows the Subscription class to move to using values rather than shared_ptr everywhere, which cleans up a significant amount of code.
Tested: Ran Redfish-Event-Listener, subscription created and destroyed correctly. Calling POST SubmitTestEvent showed events propagating to server.
Change-Id: I6d258cfe3594edddf3960ae2d4559d70acca1bf8 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
e9f12014 | 08-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Add unit test for trailing slashes
Common error #9 requires that most urls end in a trailing slash. Given the redfish standard, we know that all redfish routes need to end in a trailing slash, so w
Add unit test for trailing slashes
Common error #9 requires that most urls end in a trailing slash. Given the redfish standard, we know that all redfish routes need to end in a trailing slash, so write a unit test that verifies that is true.
Despite code review, this appears to have snuck into the codebase in 4 different handlers. Fix those at the same time so the tests pass.
Tested: Unit tests pass.
Change-Id: I0299a7231662725a7100d5308b3977a549b49253 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
15b6f9f9 | 30-May-2024 |
Ed Tanous <ed@tanous.net> |
Write test to ensure that redfish validates
Dependent on configuration options, we might have overlapping paths, as what had to be fixed in: 36a59eafed32c0063d444fc0722f899c0024092d and 5ffd11f248f1
Write test to ensure that redfish validates
Dependent on configuration options, we might have overlapping paths, as what had to be fixed in: 36a59eafed32c0063d444fc0722f899c0024092d and 5ffd11f248f155614bf30b498cb01a4e2065094d
We should be able to catch these in a unit test, so this commit adds a test that initializes the Redfish tree, and ensures that the router validates. In theory this will catch any misconfigurations we might have.
Tested: Unit tests pass.
Change-Id: I8721380c96301b57e40819f5ae2e725057ea1bb7 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|