| Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
Similar to how other log services got broken out into own header files,
do the same for dump / faultlog.
A new dump utility header has been created, request handler and route
register function went into manager / systems log service header files
respectively.
Code logic stays untouched in this patch.
Tested: Code compiles. Unit test runs through.
Validator was run on romulus in qemu with phosphor-debug-collector ibm
extension enabled to get access to /xyz/openbmc_project/dump/system.
Via the 'CreateDump' method empty dump entries were manually created
for:
/xyz/openbmc_project/dump/system
/xyz/openbmc_project/dump/bmc
/xyz/openbmc_project/dump/faultlog
```
busctl call xyz.openbmc_project.Dump.Manager \
/xyz/openbmc_project/dump/bmc \
xyz.openbmc_project.Dump.Create \
CreateDump a{sv} 0
> o "/xyz/openbmc_project/dump/bmc/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/bmc/entry/5
| `- /xyz/openbmc_project/dump/bmc/entry/6
|- /xyz/openbmc_project/dump/faultlog
| `- /xyz/openbmc_project/dump/faultlog/entry
| `- /xyz/openbmc_project/dump/faultlog/entry/1
|- /xyz/openbmc_project/dump/resource
`- /xyz/openbmc_project/dump/system
`- /xyz/openbmc_project/dump/system/entry
`- /xyz/openbmc_project/dump/system/entry/1
```
Overwrite OperationStatus of /xyz/openbmc_project/dump/system/entry/1
for the entry to be added to the collection:
```
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 \
```
Systems/Dump
Validating /redfish/v1/Systems/system/LogServices/Dump...
- Pass: 14, Warn: 0, Fail: 0, Skip: 9
Validating /redfish/v1/Systems/system/LogServices/Dump/Entries...
- Pass: 17, Warn: 0, Fail: 0, Skip: 30
Validating /redfish/v1/Systems/system/LogServices/Dump/Entries/1...
- Pass: 10, Warn: 0, Fail: 0, Skip: 26
+--------------+--------------+--------------+--------------+
| PASS | WARN | FAIL | NOT TESTED |
+--------------+--------------+--------------+--------------+
| 41 | 0 | 0 | 65 |
+--------------+--------------+--------------+--------------+
Managers/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: 70, Warn: 0, Fail: 0, Skip: 162
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
Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/5...
- Pass: 9, Warn: 0, Fail: 0, Skip: 27
Validating /redfish/v1/Managers/bmc/LogServices/Dump/Entries/6...
- Pass: 9, Warn: 0, Fail: 0, Skip: 27
+--------------+--------------+--------------+--------------+
| PASS | WARN | FAIL | NOT TESTED |
+--------------+--------------+--------------+--------------+
| 142 | 0 | 0 | 329 |
+--------------+--------------+--------------+--------------+
Managers/FaultLog
Validating /redfish/v1/Managers/bmc/LogServices/FaultLog...
- Pass: 12, Warn: 0, Fail: 0, Skip: 9
Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries...
- Pass: 13, Warn: 0, Fail: 0, Skip: 34
Validating /redfish/v1/Managers/bmc/LogServices/FaultLog/Entries/1...
- Pass: 6, Warn: 0, Fail: 0, Skip: 30
+--------------+--------------+--------------+--------------+
| PASS | WARN | FAIL | NOT TESTED |
+--------------+--------------+--------------+--------------+
| 31 | 0 | 0 | 73 |
+--------------+--------------+--------------+--------------+
Change-Id: I6379f877149c545b3b3bfcda8510c6ee1085dcf9
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
Cover dbusToRfPowerState() and the callbacks introduced by the Fabric
Switch PowerState change: afterGetSwitchPowerState and
afterGetSwitchPowerStateService. The tests assert each branch's
externally visible behavior: known PowerState decorator values map to
the matching resource::PowerState and unmapped values yield nullopt; a
property read error or an unmapped value leaves PowerState omitted
without failing the request; EBADR, io_error and an empty mapper
object leave PowerState omitted; any other mapper error sets an
internal server error.
Change-Id: Id488f88b8d7784a4f195fcf7c832fbecfdb0b513
Signed-off-by: JY Voon <jvoon@nvidia.com>
|
|
Add optional support for UUID property for PCIeDevice.
Tested: Build an image for nvl32-obmc machine with the following patch
cherry picked.
```
1. Align with upstream u-boot dts tree:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89932
2. mctpd configuration:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/87390
3. Enable nvidia-gpu sensor:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89933
```
PCIeDevice with Common.UUID published (GPU path):
$ busctl get-property xyz.openbmc_project.GpuSensor \
/xyz/openbmc_project/inventory/Nvidia_GPU_10 \
xyz.openbmc_project.Common.UUID UUID
s "68174e99-daf4-02d1-ba39-4ed2bf8a0f21"
$ curl -sk https://{BMC_IP}/redfish/v1/Systems/system/\
PCIeDevices/Nvidia_GPU_10
{
"@odata.id": "/redfish/v1/Systems/system/PCIeDevices/Nvidia_GPU_10",
"@odata.type": "#PCIeDevice.v1_19_0.PCIeDevice",
"Id": "Nvidia_GPU_10",
"Manufacturer": "NVIDIA",
"Model": "RTXPRO6000BlackwellDC",
"Name": "PCIe Device",
"PartNumber": "900-2G153-0000-000",
"SerialNumber": "1792425045093",
"Status": {
"Health": "OK",
"State": "Enabled"
},
"UUID": "68174e99-daf4-02d1-ba39-4ed2bf8a0f21"
}
PCIeDevice without Common.UUID published (ConnectX path):
$ busctl get-property xyz.openbmc_project.GpuSensor \
/xyz/openbmc_project/inventory/Nvidia_ConnectX_24_PCIe \
xyz.openbmc_project.Common.UUID UUID
Failed to get property UUID on interface
xyz.openbmc_project.Common.UUID: Unknown interface
xyz.openbmc_project.Common.UUID or property UUID.
$ curl -sk https://{BMC_IP}/redfish/v1/Systems/system/\
PCIeDevices/Nvidia_ConnectX_24_PCIe | jq 'has("UUID")'
false
Change-Id: I38cf972f03f0dd0299b708ea8203872c73c8e224
Signed-off-by: JY Voon <jvoon@nvidia.com>
|
|
- State `Available` will be mapped to `UnavailableOffline` for
Status.State for resources that are present but unavailable
- Added a utility function to reduce code duplication for retrieving
resource's Status.State (`getResourceState`) and Status.Health
(`getResourceHealth`)
Tested:
- Compiles and builds
- Unit tests pass
Change-Id: I1164a9412cbd4e1ab8938366ffc7ea9c7fe58786
Signed-off-by: Justin Nguyen <justinnanguyen@gmail.com>
|
|
The xyz.openbmc_project.Software.Version interface marks the Purpose
property as deprecated in favor of Compatible strings and inventory
associations, so a conforming object may publish only Version. The
FirmwareInventory handler treated a missing Purpose as an internal
error and returned HTTP 500 for every such object. Added this patch\
to skip the optional Description and RelatedItem links rather
than failing the resource. Objects that publish Purpose keep their
existing output.
Tested: Build an image for nvl32-obmc machine with the following
patches cherry-picked:
1. Align with upstream u-boot dts tree:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89932
2. mctpd configuration:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/87390
3. Enable nvidia-gpu sensor:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89933
4. dbus-sensors expose GPU inventory interfaces:
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/88990
$ curl -sk https://{BMC_IP}/redfish/v1/UpdateService/\
FirmwareInventory/Nvidia_GPU_10_Firmware
{
"@odata.id":
"/redfish/v1/UpdateService/FirmwareInventory/\
Nvidia_GPU_10_Firmware",
"@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
"Id": "Nvidia_GPU_10_Firmware",
"Name": "Software Inventory",
"Status": {
"HealthRollup": "OK",
"State": "Enabled"
},
"Updateable": false,
"Version": "98.02.AF.00.01"
}
Depends-On: Id0c09f4ced40dbe505ca7cbd99f6de0e847afe3b
Change-Id: I2a9562e461ffd39fcbdc176413a1bf2cb6fdbc22
Signed-off-by: JY Voon <jvoon@nvidia.com>
|
|
Cover the callbacks introduced by the GPU Processor FirmwareVersion
change. The tests assert each branch's externally visible behavior:
unexpected D-Bus errors, an ambiguous subtree, and a missing owning
service set an internal server error, while EBADR, an empty subtree,
and an empty version leave FirmwareVersion omitted.
Change-Id: Ic00549fe7513651a139ebb8a4e7b36c95b3f453c
Signed-off-by: JY Voon <jvoon@nvidia.com>
|
|
Long lambdas have been documented as an anti-pattern for some time.[1]
Despite this being generally understood, bmcweb has a long ways to go
cleaning these up, and routinely code is submitted in violation of this
anti-pattern.
Invent an ast-grep rule that can identify when new examples of this
anti-pattern are added, and ignore the existing 200+ examples that are
in the codebase already using ast-grep ignore. These flags will give us
something to search for as we clean this up, and will help to prevent
new instances from being added unintentionally.
[1] https://github.com/openbmc/docs/blob/master/anti-patterns.md#very-long-lambda-callbacks
Tested: Comment only change. ast-grep passes. Manually removing an
ast-grep ignore flag shows as a failure in ast-grep scan
Change-Id: I77d634a393884969f184d2c39c02cc08288d5a29
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
This change adds user password expiration date time mgmt via REST
API provided by bmcweb. Password expiration date time is managed as
string in 'YYYY-MM-DDTHH:MM:SS±hh:mm' format and internally operates as
Epoch time. When set password expiration date time can be specified in
any format supported by 'dateStringToEpoch' function in
'redfish::time_utils'. Value 'null' is used to make password not to
expire.
Unit tests checking correct password expiration value conversion were
added.
This change depends on corresponding change in phosphor-dbus-interfaces
[1] and in phospor-user-manager [2].
Password expiration management:
- create user with password expiration
```
curl -k -X POST -H 'Content-Type: application/json' \
"https://<bmc>/redfish/v1/AccountService/Accounts" \
-d '{"UserName":"<user>", "Password":"<password>", "RoleId":"<role>", "PasswordExpiration": "<YYYY-MM-DDTHH:MM:SS>"}'
```
- modify user password expiration
```
curl -k -X PATCH -H 'Content-Type: application/json' \
https://<bmc>/redfish/v1/AccountService/Accounts/<user> \
-d '{"PasswordExpiration": "<YYYY-MM-DDTHH:MM:SS>"}'
```
- get user password expiration
```
curl -k -X GET https://<bmc>/redfish/v1/AccountService/Accounts/<user>
```
- modify user password not to expire
```
curl -k -X PATCH -H 'Content-Type: application/json' \
https://<bmc>/redfish/v1/AccountService/Accounts/<user> \
-d '{"PasswordExpiration": null}'
```
Tested:
Functionality of this change was tested via curl utility. Also, it was
checked that proper value was set on dbus for'PasswordExpiration'
attribute of the specified user.
- create user account without password expiration, verify that password
expiration is not set
- create user account with password expiration specified, verify that it
is correct
- create user account with null password expiration which makes password
not to expire, verify that it is correct
- try to create user account with various invalid password expiration
values(incorrect type, invalid format), verify that user is not
created and appropriate error is returned in response
- modify user password expiration to specific time, verify that is is
correct
- make user password not to expiry, verify that it is correct
- try to set password expiration to an invalid value (incorrect type,
invalid format), verify that is does not change and appropriate error
is returned in response
Redfish service validation on /redfish/v1/AccountService/Accounts tree
containing both user accounts with and without password expiration has
passed successfully.
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/75236
[2] https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/75237
Change-Id: Idf5e4356eaa8866dd4a10664996117e2cdba0684
Signed-off-by: Ivan Moiseev <moiseev.ivan4w@yandex.com>
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
|
|
`redfish-core/schema/oem/openbmc/` oem schema defines 'Chassis' property
for fan zones but the implementation forms invalid chassis links.
Affected options: redfish-oem-manager-fan-data=enabled (default)
Using following configuration, plus a few fans and pid controller
(a typical single-host 2U server with 3 fans, Tyan S8030 board)
```
{
"FailSafePercent": 100,
"MinThermalOutput": 10,
"Name": "Zone0",
"Type": "Pid.Zone"
},
```
It is straightforward to get a response like below
```
...
"FanZones": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones",
"@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZones",
"Zone0": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0",
"@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZone",
"Chassis": {
"@odata.id": "/redfish/v1/Chassis/Zone0"
},
"FailSafePercent": 100.0,
"MinThermalOutput": 10.0
}
},
...
```
when querying
```
curl --insecure --user root:root https://${bmc}/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan
```
For reference, the chassis collection
```
{
"@odata.id": "/redfish/v1/Chassis",
"@odata.type": "#ChassisCollection.ChassisCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Chassis/MBX_1_57_Chassis"
},
{
"@odata.id": "/redfish/v1/Chassis/Tyan_S8030_Baseboard"
}
],
"Members@odata.count": 2,
"Name": "Chassis Collection"
}
```
Since that configuration is representative of various boards and the bug
has been seen by others before [1] (in terms of a fan zone and chassis
sharing the same name, suggesting ill-formed link), fix the
implementation to use the result of GetManagedObjects call and find
valid chassis path there.
This is to allow redfish validator to pass with default meson options
and a common system configuration. Since it's a config dependent failure
it would be great for others to test and share their result.
Inspection of the code causing validation failure:
```
auto pids = std::make_shared<GetPIDValues>(asyncResp);
pids->run();
then run(); returns and `~GetPIDValues()` is called
which calls processingComplete
which calls asyncPopulatePid
```
Inside `asyncPopulatePid` it does `dbus::utility::getManagedObjects`
and iterates over the results
```
112 for (const auto& pathPair : managedObj)
113 {
114 for (const auto& intfPair : pathPair.second)
```
then checks for an interface
```
180 if (intfPair.first == pidZoneConfigurationIface)
181 {
182 sdbusplus::message::object_path pidPath(
183 pathPair.first.str);
184 std::string chassis = pidPath.filename();
185 if (chassis.empty())
186 {
187 chassis = "#IllegalValue";
188 }
```
and simply uses the object path from PID Zone config interface to
extract the leaf and insert that as the chassis link.
It can only work in case the Board/Chassis interface is on the same
object path which is unlikely.
Tested: on Tyan S8030.
Result after the change, the optional property now contains the correct
chassis link.
```
...
"FanZones": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones",
"@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZones",
"Zone0": {
"@odata.id": "/redfish/v1/Managers/bmc#/Oem/OpenBmc/Fan/FanZones/Zone0",
"@odata.type": "#OpenBMCManager.v1_0_0.Manager.FanZone",
"Chassis": {
"@odata.id": "/redfish/v1/Chassis/MBX_1_57_Chassis"
},
"FailSafePercent": 100.0,
"MinThermalOutput": 10.0
}
},
...
```
```
/tmp/rsv-venv/bin/rf_service_validator \
--auth Session -i https://${bmc}:443 \
-u ${username} -p ${password} --payload 'Tree' /redfish/v1/Managers/bmc
...
Elapsed time: 0:00:32
Listing any warnings and errors:
Results Summary:
Pass: 766, Fail: 0, Warning: 0
Validation has succeeded.
```
RF validator Tree validation errors are reduced compared to previous.
References:
[1] https://discordapp.com/channels/775381525260664832/1449737223493910559/1450273124804333598
Change-Id: I2a2db456f42c5dafa451f69362b1d9c8a094e86e
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
Some of messages are not currently reported as errors, although they
are the results as Redfish request errors. Those include
- PropertyDuplicate
- ResourceAlreadyExists
- CreateFailedMissingReqProperties
- PropertyValueFormatError
- PropertyValueNotInList
- PropertyValueTypeError
- PropertyValueError
- PropertyNotWritable
- PropertyValueModified
- PropertyMissing
For example, PropertyValueFormatError is currently not treated as an
error. It shows like
```
curl -k -X PATCH "${bmc}/redfish/v1/AccountService/Accounts/admin" \
-H "Content-Type: application/json" \
-d '{ "Password": "" }'
"Password@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The value 'null' for the property Password is not a format that the property can accept.",
"MessageArgs": [
"null",
"Password"
],
"MessageId": "Base.1.19.PropertyValueFormatError",
"MessageSeverity": "Warning",
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed."
}
]
```
After making it as an error, it will be like
```
{
"error": {
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The value 'null' for the property Password is not a format that the property can accept.",
"MessageArgs": [
"null",
"Password"
],
"MessageId": "Base.1.19.PropertyValueFormatError",
"MessageSeverity": "Warning",
"Resolution": "Correct the value for the property in the request body and resubmit the request if the operation failed."
}
],
"code": "Base.1.19.PropertyValueFormatError",
"message": "The value 'null' for the property Password is not a format that the property can accept."
}
}
```
Tested:
- Check those response messages
Change-Id: I746c55e42e8f0cde205a3800e3da17cd78cf7e34
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
|
|
Add test case for handleTelemetryServiceGet function to verify the
static attributes returned by the TelemetryService endpoint
The test validates the following response fields:
- @odata.type and @odata.id
- Id and Name
- Navigation properties: MetricReportDefinitions, MetricReports and
Triggers
Tested
- All assertions passed
Change-Id: Ibc71ad9ff1796b90fed19d25be1525204919fa04
Signed-off-by: Ramya Sivakumar <sramya@ami.com>
|
|
The comment from 'getEventLogParams()' says:
The redfish log format is "<Timestamp> <MessageId>,<MessageArgs>"
And in the OpenBMC main tree, the 'rsyslog.conf' from vendor defines:
# Template for Redfish messages
# "<timestamp> <MessageId>,<MessageArgs>"
template(name="RedfishTemplate" type="list") {
property(name="timereported" dateFormat="rfc3339")
constant(value=" ")
property(name="$!REDFISH_MESSAGE_ID")
constant(value=",")
property(name="$!REDFISH_MESSAGE_ARGS")
constant(value="\n")
}
# If the journal entry has a Redfish MessageId, save as a Redfish
# event
if ($!REDFISH_MESSAGE_ID != "") then {
action(type="omfile"
file="/var/log/redfish"
template="RedfishTemplate")
}
The commit aa2dfd26a514 ("Remove static variables") removed extraction
of timestamp data from the whole event log entry, 'dateStringToEpoch()'
will reject this kind of timestamp with trailing text.
Fixes: aa2dfd26a514 ("Remove static variables")
Change-Id: Id59af476e56a913a02a9f56a8c5f38c4ada7ccbf
Signed-off-by: Haiyue Wang <haiyuewa@163.com>
|
|
The aggregator forwards every method (GET, POST, PATCH, DELETE) to a
singular satellite resource, as described in the "Aggregating a
Resource" section of docs/AGGREGATION.md. createNewRequest() builds
the request that is forwarded, so it must preserve the original
method, target, and body -- otherwise Actions (e.g.
ComputerSystem.Reset) and PATCH updates would not reach the owning
satellite intact. It must also drop the client's X-Auth-Token while
keeping Host/Content-Type and setting Accept.
createNewRequest() had no unit-test coverage. Add tests that pin down
this contract:
- a non-GET (POST) request preserves method, target, and body
- a PATCH request preserves its body
- the client X-Auth-Token is filtered out while Host and
Content-Type are forwarded and Accept is set
No functional change.
Tested: clean build + full unit-test suite pass in the official
openbmc/ubuntu-unit-test container; the createNewRequest tests added
here pass (3/3).
Signed-off-by: Gary Beihl <garybeihl@microsoft.com>
Change-Id: If82cffe0f47523fc05af8e36892629e273ba865e
|
|
Extend the OpenBMCManager OEM fan configuration to cover the two
additional PID parameters already supported by phosphor-pid-control:
* DCoefficient (derivative term of the PID loop)
* CheckHysteresisWithSetpoint (boolean indicating whether input
hysteresis is applied around the setpoint)
These fields are now exposed through the Oem/OpenBmc/Fan/PidControllers
Redfish interface and correctly mapped to the underlying D-Bus
PidConfiguration objects.
To keep the OEM schema backwards compatible, introduce a new
version OpenBMCManager.v1_1_0 that adds the two properties to the
PidController definition, and update bmcweb to reference the new
schema version.
Test(qemu evb-ast2600):
Load Fantable via entity-manager
/var/configuration/system.json content:
https://github.com/YouPengWu/ToReviewer/blob/main/85785
/Test_case/Bmcweb(my_commit)/system.txt
Verify OEM properties in Manager resource
GET /redfish/v1/Managers/bmc:
https://github.com/YouPengWu/ToReviewer/blob/main/85785
/Test_case/Bmcweb(my_commit)/Managers-bmc-oem.png
Verify OpenBMCManager OEM schema exposure
GET /redfish/v1/JsonSchemas/OpenBMCManager:
https://github.com/YouPengWu/ToReviewer/blob/main/85785
/Test_case/Bmcweb(my_commit)/redfish-oem-schema.png
Run Redfish Service Validator (RSV)
Summary:
https://github.com/YouPengWu/ToReviewer/blob/main/85785
/Test_case/Bmcweb(my_commit)/redfish-validator-summary.png
Details:
https://github.com/YouPengWu/ToReviewer/blob/main/85785
/Test_case/Bmcweb(my_commit)/redfish-validator-details.png
Full log:
https://github.com/YouPengWu/ToReviewer/blob/main/85785
/Test_case/Bmcweb(my_commit)/ConformanceLog_12_14_2025_180449.txt
Baseline (community/original) RSV log
for comparison (no new failures introduced):
https://github.com/YouPengWu/ToReviewer/blob/main/85785
/Test_case/Bmcweb(57d41)/ConformanceLog_12_14_2025_174610.txt
Change-Id: Ide1a118f9fd27eb94e911997d99e5934fe3e1095
Signed-off-by: You Peng Wu <twpeng50606@gmail.com>
|
|
This lambda needs to go away. There's no way it should've been accepted
in the first place, but it was written in a different time.
Tested: Functional in next commit. Unit tests in patch.
Change-Id: I81360460c23329169f441b6bea02d28a8b410eca
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Add ChargeAh ReadingType and Ah units mapping for
charge sensors exposed under /sensors/charge/ D-Bus
path. This enables battery backup unit remaining and
full charge sensors to appear in Redfish. Unit test
added for charge sensor type.
Tested:
1. Sensor Query using curl -
```
{
"@odata.id": "/redfish/v1/Chassis/BBU_SHELF_1/Sensors/charge_BBU_SHELF_1_BBU5_REMAINING_CHARGE_AH",
"@odata.type": "#Sensor.v1_11_1.Sensor",
"Id": "charge_BBU_SHELF_1_BBU5_REMAINING_CHARGE_AH",
"Name": "BBU SHELF 1 BBU5 REMAINING CHARGE AH",
"Reading": 10477.0,
"ReadingType": "ChargeAh",
"ReadingUnits": "Ah",
"Status": {
"Health": "OK",
"State": "Enabled"
},
...
}
```
2. Redfish Validation passed using Redfish Validator.
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
Change-Id: I9b7180cb8597378a1b42f9da73335ca96b20d55a
|
|
Move the LocationCode D-Bus callback out of getCpuLocationCode() and
rename the request helper to getProcessorLocationCode(), because the
helper handles all processor inventory types and not only CPUs.
This is a no-functional-change cleanup. Processor GET responses continue
to expose Location/PartLocation/ServiceLabel from the existing
xyz.openbmc_project.Inventory.Decorator.LocationCode interface.
Redfish.md is unchanged because this refactor does not add or remove any
Redfish schema fields. No phosphor-dbus-interfaces change is required;
the patch continues to use the existing Decorator.LocationCode API.
The D-Bus to Redfish mapping remains:
- Inventory.Decorator.LocationCode/LocationCode
-> Location/PartLocation/ServiceLabel
Key changes:
- redfish-core/lib/processor.hpp: add afterGetProcessorLocationCode();
rename getCpuLocationCode() to getProcessorLocationCode(); switch the
getProperty callback to std::bind_front; log LocationCode D-Bus errors
with the ec value
- test/redfish-core/lib/processor_test.cpp: add unit tests for the
success and error paths in afterGetProcessorLocationCode()
- test/meson.build: register processor_test.cpp in the unit-test source
list
Tested: Built an image for nvl32-obmc machine with the following
patches cherry-picked:
1. Align with upstream u-boot dts tree:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89932
2. U-Boot change phy mode (in-flight on mailing list):
```
https://lore.kernel.org/openbmc/20260504044702.2613879-1-andhsieh@nvidia.com/T/#t
```
3. Kernel device tree add mac mode (in-flight on mailing list):
```
https://lore.kernel.org/linux-aspeed/20260505050541.3031447-1-andhsieh@nvidia.com/T/#t
```
4. platform-init enable LCLK and espiCLK:
https://gerrit.openbmc.org/c/openbmc/platform-init/+/89900
5. mctpd configuration:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/87390
6. Enable nvidia-gpu sensor:
https://gerrit.openbmc.org/c/openbmc/openbmc/+/89933
$ curl -sk https://{BMC_IP}/redfish/v1/Systems/system/Processors/GPU_0_0
{
"@odata.id": "/redfish/v1/Systems/system/Processors/GPU_0_0",
"@odata.type": "#Processor.v1_18_0.Processor",
"Id": "GPU_0_0",
"Manufacturer": "NVIDIA",
"Model": "RTXPRO6000BlackwellDC",
"Name": "Processor",
"PartNumber": "900-2G153-0000-000",
"ProcessorType": "Accelerator",
"SerialNumber": "1792425045048",
"Status": {
"Health": "OK",
"State": "Enabled"
},
"UUID": "48b2ad9f-afb1-47ed-a1f0-01c610da73af",
"Version": "2BB5-895-A1"
}
1. Verified no regression: Processor GET responses remain correct after
the rename to getProcessorLocationCode().
2. Ran Redfish Service Validator:
Summary - PASS: 10797, WARN: 370, FAIL: 1, NOT TESTED: 17149
Validating /redfish/v1/Managers/bmc...
- Pass: 45, Warn: 0, Fail: 1, Skip: 27
The FAIL is Oem/OpenBmc/Certificates, an unknown OEM property in the
schema that is pre-existing and unrelated to this change.
Change-Id: I346265d1e90024266fb23221e54705cbd3ae286c
Signed-off-by: JY Voon <jvoon@nvidia.com>
|
|
The location_util::getLocation is used to find the `LocationCode`
interface used for `ServiceLabel`. Also added logic to look for the
Inventory.Connector.X interfaces to populate `LocationType`.
The helper function is added to serve as the common location helper
and remove the same method call in each individual resource files.
For example, `Inventory.Connector.Embedded` means LocationType of
Embedded type.
Currently only support LocationType of
- Slot
- Embedded
Tested: No changes to redfish tree yet
Added unit tests
Change-Id: I7f2a8d6172e37dd72881fbfb5a9dfeaf83b2db09
Signed-off-by: Zhenwei Chen <zhenweichen0207@gmail.com>
Signed-off-by: Willy Tu <wltu@google.com>
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
These static variables have the potential to cause reentrancy issues.
In practice, the conditions to cause issues would require someone to
basically write incorrect code, but it makes sense to wrap this into a
state tracker anyway to clean up the code. While we're here, convert to
using std::chrono.
Note, this changes the behavior such that the values produced are now no
longer dependent on timezone. Functionally, Redfish only recently got
the ability to set a timezone, so this is not expected to have any user
facing impact, even though the unit tests need to change.
Tested: RSV Passes
Change-Id: Icb7cff1d289ae23790a5fb1db6604abd73dd68fd
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
time_t is less specific than using the equivalents in std::chono. In
practice, most of the time we end up converting the time_t to some
std::chrono class anyway. Avoid the intermediate conversion and just
use the std::chrono version of time.
Tested: Unit tests pass. Good Coverage
Change-Id: I2e3eca78760e158feaaf4b91793631343e417f15
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
This should be doing exact matching, not partial matching. This failed
to catch a bug in a later change.
Note, this unit test will currently only pass on the UTC timezone.
Later in the series the backend is fixed to produce consistent results
regardless of timezone
Tested: unit test
Change-Id: Ie5652c0f9503b4de926addcfc292c76b59682b12
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
BMC now exposes DateTime property under the Manager/<ID> in timezone
configured on the BMC (local TZ) and not in UTC, but the other date
time properties are still in UTC.
Convert date time fields to local timezone.
Tested:
1. Redfish service validator
2. Built Facebook's Catalina image with this change, ran in QEMU and
checked manually varioius endpoints.
3. Ran automated tests [1] from openbmc-test-automation repo.
4. Unit tests
[1] https://gerrit.openbmc.org/c/openbmc/openbmc-test-automation/+/88659
Change-Id: I8e587c7a1030deff8e6a550651c5e62719fe5299
Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
Signed-off-by: Ed Tanous <ed@tanous.net>
|
|
Not a lot we can do here, but at least we can check the regex matches.
Tested: Unit test passes
Change-Id: Ib6058042c725169e90b971bd15851f16d621ac0e
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
In certain debug scenarios, there were cases where we would hit
recursion depth limits. These do not appear in conventional scenarios,
but could pop up in debug builds while running fuzzing. To fix this,
implement two checks.
First, limit $filter expressions to 1000 characters or less. This is
largely arbitrary.
Second, implement a depth checker to ensure that stack depth doesn't
exceed 10 frames. 10 is intended to be an order of magnitude more than
anyone will ever use. Most examples use 1 or 2 parens.
Tested: Unit tests pass. New unit tests added for this case.
Change-Id: I2c95e2fc8c0a3b94ab2a7f882ac6e1805bb7ebd5
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
We should have a single entry point where we do json parsing. There are
configurations for nlohmmann that we had previously documented, but were
not well enforced. Move all uses to using the helper parse functions.
Tested: Unit tests pass.
Redfish service validator passes.
Change-Id: I2a8aed9327b6b15219dc9b4d6db146b69bcd8eb3
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
It would be better if the larger compile units didn't have to pull in
the sd-journal header. At the same time, there's C handling of a number
of resources that could be moved to an RAII class, and unit tests that
we can add. This commit does all those things.
Note, vacuum.journal is a file created with
```
journalctl --rotate && sleep 1 && journalctl --rotate
````
And contains a few log entries. Note, while this file is 8MB, the
majority are zeros, so git should compress it just fine.
Tested: Unit tests updated.
Redfish service validator passes
Change-Id: If578316bcd1d0162b7ecdcca27c1c7818ce2b6fa
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
docs/COMMON_ERRORS.md documents patterns that are easy to introduce
and hard to catch in review. This adds machine-enforceable ast-grep
rules for those patterns so they get caught in CI instead of review.
Rules cover unsafe integer parsing, throwing JSON APIs, throwing
filesystem APIs, wildcard lambda captures, blocking calls, missing
trailing slashes on routes, and route string concatenation.
Tested: ast-grep scan --error exits 0.
Change-Id: I7ae24b52ac5b120826d29bb3ac6fce8f30199c15
Signed-off-by: Davy Marrero <dmarrero@nvidia.com>
|
|
Current code always return Date time in UTC, despite local timezone may
differ. This change allows to set manager timezone via redfish and show
manager's TZ and offset in manager's local timezone. When the DateTime
is being patched, the provided date time gets converted from the
provided TZ to the local timezone, but configured TZ does not get
changed. A user must explicitly patch TimeZoneName to change Manager's
TZ.
Tested:
1. Built an image, ran in QEMU, changed TZ to PST8PDT (negative offset),
UTC (0 offset), and Tokyo (positive offset). Made sure the patch works
and all the touched fields have correct values. See [1].
2. Unit tests
3. Redfish validator
[1]
```
$ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName'
"2026-03-19T11:03:16-07:00"
"-07:00"
"PST8PDT"
$ curl -i -k -H 'Content-type: application/json' -u root:0penBmc -d '{"TimeZoneName": "UTC"}' -X PATCH https://localhost:8443/redfish/v1/Managers/bmc
HTTP/1.1 204 No Content
Allow: GET, PATCH
OData-Version: 4.0
Strict-Transport-Security: max-age=31536000; includeSubdomains
Pragma: no-cache
Cache-Control: no-store, max-age=0
X-Content-Type-Options: nosniff
Date: Thu, 19 Mar 2026 18:03:28 GMT
Content-Length: 0
$ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName'
"2026-03-19T18:03:53+00:00"
"+00:00"
"UTC"
$ curl -i -k -H 'Content-type: application/json' -u root:0penBmc -d '{"TimeZoneName": "Asia/Tokyo"}' -X PATCH https://localhost:8443/redfish/v1/Managers/bmc
HTTP/1.1 204 No Content
Allow: GET, PATCH
OData-Version: 4.0
Strict-Transport-Security: max-age=31536000; includeSubdomains
Pragma: no-cache
Cache-Control: no-store, max-age=0
X-Content-Type-Options: nosniff
Date: Thu, 19 Mar 2026 18:04:20 GMT
Content-Length: 0
$ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName'
"2026-03-20T03:04:32+09:00"
"+09:00"
"Asia/Tokyo"
$ curl -i -k -H 'Content-type: application/json' -u root:0penBmc -d '{"DateTime": "2026-01-02T11:03:16-07:00"}' -X PATCH https://localhost:8443/redfish/v1/Managers/bmc
HTTP/1.1 204 No Content
Allow: GET, PATCH
OData-Version: 4.0
Strict-Transport-Security: max-age=31536000; includeSubdomains
Pragma: no-cache
Cache-Control: no-store, max-age=0
X-Content-Type-Options: nosniff
Date: Fri, 02 Jan 2026 18:03:16 GMT
Content-Length: 0
$ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc | jq '.DateTime, .DateTimeLocalOffset, .TimeZoneName'
"2026-01-03T03:03:21+09:00"
"+09:00"
"Asia/Tokyo"
$ curl -s -k -H 'Content-type: application/json' -u root:0penBmc https://localhost:8443/redfish/v1/Managers/bmc/LogServices/Journal/Entries | jq '.Members[0]'
{
"@odata.id": "/redfish/v1/Managers/bmc/LogServices/Journal/Entries/cz0zNTMzMTVkMTBjYWQ0ZTg5ODJiYjliZGVmOTc2NDE2MDtpPTE7Yj00YzU5NzY1NzQ0M2M0N2IzOWZjYTZiNzU1ZWVlY2NjOTttPTFlZjc1Yzg7dD02MzY0OGQxOTFhZTE0O3g9ZDU5MjYwNzJkZTgzMWYzYw==",
"@odata.type": "#LogEntry.v1_9_0.LogEntry",
"Created": "2025-05-29T16:30:41.794580+00:00",
"EntryType": "Oem",
"Id": "cz0zNTMzMTVkMTBjYWQ0ZTg5ODJiYjliZGVmOTc2NDE2MDtpPTE7Yj00YzU5NzY1NzQ0M2M0N2IzOWZjYTZiNzU1ZWVlY2NjOTttPTFlZjc1Yzg7dD02MzY0OGQxOTFhZTE0O3g9ZDU5MjYwNzJkZTgzMWYzYw==",
"Message": "kernel: Booting Linux on physical CPU 0xf00",
"Name": "BMC Journal Entry",
"OemRecordFormat": "BMC Journal Entry",
"Severity": "OK"
}
```
Change-Id: I5a4567b9ca6a0f56dd9d1b971d418a19bf625a10
Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
|
|
Keep existing Members on local I/O failures in the generic
collection path, and ensure empty collections still return
mandatory Members and Members@odata.count properties.
Add a reusable JSON array helper and use it in both
collection building and aggregator merge logic to avoid
clearing the response on transient failures.
Fixes common error #13.[1]
[1] https://github.com/openbmc/bmcweb/blob/master/docs/COMMON_ERRORS.md#13-complete-replacement-of-the-response-object
Tested: unit test passed; validator passed on empty collection URIs.
Change-Id: I8e144f55b99e3f8017abcebb11c409fffebf38ad
Signed-off-by: Tony Ao <tao@nvidia.com>
|
|
The generic collection path could clear the "Members" array on a local
I/O error, which breaks aggregated responses and can trigger Common
Error #13 [1].
The aggregator merge logic also needed a small reusable helper to ensure
a JSON value is an array.
Add a generic JSON array "ensure" helper in utils/collection.hpp and use
it from both the local collection builder and the aggregator merge path.
This avoids resetting Members on transient failures and avoids relying
on transitive includes for the helper.
[1] https://github.com/openbmc/bmcweb/blob/master/docs/COMMON_ERRORS.md#13-complete-replacement-of-the-response-object
Tested: Unit tests passed.
Change-Id: Iddaa608916af661f75989b4aeae9b557d09eebe3
Signed-off-by: Tony Ao <tao@nvidia.com>
|
|
This patch enable support for following properties for Port Metrics URI
of a PCIe Switch. [1]
- PCIeErrors.CorrectableErrorCount
- PCIeErrors.NonFatalErrorCount
- PCIeErrors.FatalErrorCount
- PCIeErrors.L0ToRecoveryCount
- PCIeErrors.ReplayCount
- PCIeErrors.ReplayRolloverCount
- PCIeErrors.NAKSentCount
- PCIeErrors.NAKReceivedCount
- PCIeErrors.UnsupportedRequestCount
The patch uses "xyz.openbmc_project.Metric.Value" Interface for PCIe
Port Metrics properties. Association between a Metric and a Port is
`measuring` and `measured_by`.
PDI patch -
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/84839
dbus-sensors patches -
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84132
Tested: Build an image for nvl32-obmc machine with the following patch
cherry picked.
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84132
https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490
The openbmc patch cherry-picks the following patches that are currently
under review.
```
1. device tree
https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/
2. mctpd patches
https://github.com/CodeConstruct/mctp/pull/85
3. u-boot changes
https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t
4. kernel changes as specified in the openbmc patch (for espi)
5. entity-manager changes
https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455
6. platform-init changes
https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456
7. spi changes
https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/
```
redfish service validator is passing.
```
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/Metrics/
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/Metrics",
"@odata.type": "#PortMetrics.v1_3_0.PortMetrics",
"Id": "Metrics",
"Name": "Nvidia_ConnectX_0 UP_0 Port Metrics",
"PCIeErrors": {
"CorrectableErrorCount": 0,
"FatalErrorCount": 0,
"L0ToRecoveryCount": 1,
"NAKReceivedCount": 0,
"NAKSentCount": 0,
"NonFatalErrorCount": 0,
"ReplayCount": 0,
"ReplayRolloverCount": 0,
"UnsupportedRequestCount": 0
}
}%
```
[1]: https://redfish.dmtf.org/schemas/v1/PortMetrics_v1.xml
Change-Id: I7cca75fa5d4c77a4b02d35f7ce0b024f325ceff0
Signed-off-by: Harshit Aghera <haghera@nvidia.com>
|
|
Adds SpeedPercent and SecondarySpeedPercent information according to the
Redfish Fan schema.[1] The schema only allows fans of ReadingType
Percent to be reported in SpeedPercent and SecondarySpeedPercent.
These new properties are accessed through the Redfish Uri for a
particular fan on a particular chassis[2]:
```
/redfish/v1/Chassis/<chassisId>/ThermalSubsystem/Fans/<fanId>
```
The primary and secondary fan sensors connected to the fan are found by:
1) Find all sensors associated to fan using the 'sensors' endpoint.[3]
2) For each sensor get its priority using the
'xyz.openbmc_project.Common.Priority' interface.[4][5]
3) Retrieve the sensor excerpt and place into the response based on the
priority of the sensor.
Implementation Notes:
- The utility function objectExcerptToJson() is used to populate the
SensorFanExcerpt.
- Guards are added to handle different cases of D-Bus sensors Priority
settings:
- Fan has only 1 sensor associated and the sensor has no priority.
Fills SpeedPercent for response.
- Fan has more than one sensor. Any sensor without priority will be
skipped.
- Fan has one or more sensors with priority. The priority setting
determines which property will be filled for the response. If the
priority is 0 it uses SpeedPercent. If the priority is 1 it uses
SecondarySpeedPercent. Any other priority the sensor will not be
included in the response.
- Fan has two sensors with the same priority. The first one is in the
response and the second one is skipped.
[1] https://redfish.dmtf.org/schemas/v1/Fan.v1_6_0.json
[2] https://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2025.4.html#fan
[3] https://github.com/openbmc/docs/blob/master/architecture/sensor-architecture.md#association-type-2-linking-a-low-level-hardware-item-to-its-sensors
[4] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/66779
[5] https://gerrit.openbmc.org/c/openbmc/phosphor-hwmon/+/67170
Tested (using p10bmc hardware simulator with fan configuration edits):
- Redfish Service Validator passes
- Tested various fan configurations with Percent fans:
```
/* Fan has two sensors both with priority set */
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0",
"@odata.type": "#Fan.v1_6_0.Fan",
...
"SecondarySpeedPercent": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_1",
"Reading": 60,
"SpeedRPM": 12036.0
},
...
"SpeedPercent": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0",
"Reading": 100,
"SpeedRPM": 18000.0
},
...
}
/* Fan has two sensors neither with priority, both skipped */
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan1
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan1",
"@odata.type": "#Fan.v1_6_0.Fan",
...
"PartNumber": "XXXXXXX",
"SerialNumber": "XXXXXXXXXXXX",
"SparePartNumber": "XXXXXXX",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
/* Fan has one sensor without priority, shown as primary */
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan2
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan2",
"@odata.type": "#Fan.v1_6_0.Fan",
...
"SpeedPercent": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan2_0",
"Reading": 50,
"SpeedRPM": 18000.0
},
...
}
/* Fan has two sensors. Both have priority 0. The first sensor is in the
* response the second sensor is skipped.
*/
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan3
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan3",
"@odata.type": "#Fan.v1_6_0.Fan",
"Id": "fan3",
"Location": {
"PartLocation": {
"ServiceLabel": "U78DA.ND0.1234567-A3"
}
},
"LocationIndicatorActive": false,
"Manufacturer": "Delta",
"Model": "7B5G",
"Name": "Fan",
"PartNumber": "02YK200",
"SerialNumber": "YS10JP12V0TY",
"SparePartNumber": "02YK237",
"SpeedPercent": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan3_0",
"Reading": null,
"SpeedRPM": 18000.0
},
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
/* Fan has two sensors. One priority 0, other priority 2. Only the
* primary is in the response.
*/
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan4
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan4",
"@odata.type": "#Fan.v1_6_0.Fan",
...
"PartNumber": "XXXXXXX",
"SerialNumber": "XXXXXXXXXXXX",
"SparePartNumber": "XXXXXXX",
"SpeedPercent": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan4_0",
"Reading": null,
"SpeedRPM": 18000.0
},
...
}
/* Fan has two sensors. One priority 1, other priority 2. Only the
* secondary is in the response.
*/
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan5
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan5",
"@odata.type": "#Fan.v1_6_0.Fan",
...
"SecondarySpeedPercent": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan5_1",
"Reading": null,
"SpeedRPM": 12036.0
},
"SerialNumber": "XXXXXXXXXXXX",
"SparePartNumber": "XXXXXXX",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
```
- Tested with rotational fans the new fields are not in response:
```
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0
{
"@odata.id": "/redfish/v1/Chassis/chassis/ThermalSubsystem/Fans/fan0",
"@odata.type": "#Fan.v1_6_0.Fan",
...
"PartNumber": "XXXXXXX",
"SerialNumber": "XXXXXXXXXXXX",
"SparePartNumber": "XXXXXXX",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0",
"@odata.type": "#Sensor.v1_11_1.Sensor",
...
"ReadingType": "Rotational",
...
}
```
Signed-off-by: George Liu <liuxiwei@inspur.com>
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
Change-Id: Ic767de3bde8bfe14b31da23b67e17a8d04eefadb
|
|
Redfish 2025.3 clarified the reporting of fan sensors should always be
as ReadingType Percent to address issue #6197. [1] The fan_tach
sensors on D-Bus are Rotational sensors. Conversion is necessary for
these sensor values to reflect Percent instead. [2] This is reflected in
a published mockup. [3]
The Redfish update includes an additional sentence for the ReadingType
description:
```
"... Services should represent fan speed and pump speed sensors with the `ReadingType` value `Percent`."
```
The ReadingRangeMax and ReadingRangeMin properties also must be
converted to percent basis as they are defined to reflect the range of
the Reading property.
```
curl -s https://redfish.dmtf.org/schemas/v1/Sensor.v1_11_1.json | jq .definitions.Sensor.properties.ReadingRangeMax.longDescription
"This property shall indicate the maximum possible value of the `Reading` property for this sensor. This value is the range of valid readings for this sensor. Values outside this range are discarded as reading errors."
```
A new compile option, redfish-allow-rotational-fans, will maintain the
old behavior of reporting fan_tach sensors as Rotational. When the
option is disabled they will be reported as Percent. This will allow
time for distributions to make adjustments to handle Percent reported
fan sensors.
The SpeedRPM Redfish property contains the RPM value for these sensors
whether this option is enabled or disabled. Clients wanting to use the
RPM value should convert to use the SpeedRPM property instead of the
Reading property.
```
curl -s https://redfish.dmtf.org/schemas/v1/Sensor.v1_11_1.json | jq .definitions.Sensor.properties.SpeedRPM
{
"description": "The rotational speed.",
"excerpt": "SensorFan,SensorFanArray,SensorPump",
"longDescription": "This property shall contain a reading of the rotational speed of the device in revolutions per minute (RPM) units.",
"readonly": true,
"type": [
"number",
"null"
],
"units": "{rev}/min",
"versionAdded": "v1_2_0"
}
```
With the compile option disabled the following differences will be
reflected in the responses for /redfish/v1/Chassis/chassis/Sensors/{}:
- ReadingRangeMax/ReadingRangeMin: Converted to percent range, (100,0)
- ReadingType: "Percent"
- ReadingUnits: "%"
- Reading: Computed percent value. The computation is the percent of
the RPM Value within the MaxValue to MinValue range as reported by
D-Bus for the sensor.
- Note: If the percent cannot be computed for any reason the Reading
property is set to null.
- Note: SpeedRPM: Remains unchanged, it continues to report the RPM
value as reported by D-Bus.
Implementation Notes:
- The SensorFanExcerpt and SensorFanArrayExcerpt definitions also
include the SpeedRPM property. So moved setting of this property to
be handled for excerpts as well.
- The Sensor schema version has been updated regardless of the compile
option setting.
[1] https://github.com/DMTF/Redfish/issues/6197
[2] https://redfish.dmtf.org/schemas/v1/Sensor.v1_11_1.json
[3] https://github.com/DMTF/Redfish-Publications/blob/main/mockups/public-rackmount1/Chassis/1U/Sensors/CPUFan1/index.json
Tested:
- Added new unit tests for new function getFanPercent()
- Adjusted existing unit tests for Sensors to reflect changes for
fan_tach sensors.
- Redfish Service Validator passes (with option enabled and disabled)
- Using hardware simulator hand-edited values for the min/max of the
fan_tach sensors:
- Option enabled: confirmed Redfish response same before and after
code changes.
- Option disabled: Confirmed Redfish responses and percent
calculation.
Example responses with compile option disabled:
```
// D-Bus: "Value" d 18000 "MaxValue" d 18000 "MinValue" d 0
curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0",
"@odata.type": "#Sensor.v1_11_1.Sensor",
"Id": "fantach_fan0_0",
"Name": "fan0 0",
"Reading": 100,
"ReadingRangeMax": 100,
"ReadingRangeMin": 0,
"ReadingType": "Percent",
"ReadingUnits": "%",
"SpeedRPM": 18000.0,
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
// D-Bus: "Value" d 18000 "MaxValue" d 36000 "MinValue" d 0
curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan1_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan1_0",
"@odata.type": "#Sensor.v1_11_1.Sensor",
"Id": "fantach_fan1_0",
"Name": "fan1 0",
"Reading": 50,
"ReadingRangeMax": 100,
"ReadingRangeMin": 0,
"ReadingType": "Percent",
"ReadingUnits": "%",
"SpeedRPM": 18000.0,
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
// Minimum is non-zero
// D-Bus: "Value" d 18000 "MaxValue" d 27000 "MinValue" d 9000
curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan2_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan2_0",
"@odata.type": "#Sensor.v1_11_1.Sensor",
"Id": "fantach_fan2_0",
"Name": "fan2 0",
"Reading": 50,
"ReadingRangeMax": 100,
"ReadingRangeMin": 0,
"ReadingType": "Percent",
"ReadingUnits": "%",
"SpeedRPM": 18000.0,
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
// Minimum is not initialized - Reading is null
// D-Bus: "Value" d 18000 "MaxValue" d 18000 "MinValue" d -inf
curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan3_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan3_0",
"@odata.type": "#Sensor.v1_11_1.Sensor",
"Id": "fantach_fan3_0",
"Name": "fan3 0",
"Reading": null,
"ReadingRangeMax": 100,
"ReadingRangeMin": 0,
"ReadingType": "Percent",
"ReadingUnits": "%",
"SpeedRPM": 18000.0,
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
// Minimum and Maximum are not initialized - so Reading is null
// D-Bus: "Value" d 18000 "MaxValue" d inf "MinValue" d -inf
curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan4_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan4_0",
"@odata.type": "#Sensor.v1_11_1.Sensor",
"Id": "fantach_fan4_0",
"Name": "fan4 0",
"Reading": null,
"ReadingRangeMax": 100,
"ReadingRangeMin": 0,
"ReadingType": "Percent",
"ReadingUnits": "%",
"SpeedRPM": 18000.0,
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
```
Example of unchanged response with compile option enabled:
```
curl -s -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/fantach_fan0_0",
"@odata.type": "#Sensor.v1_11_1.Sensor",
"Id": "fantach_fan0_0",
"Name": "fan0 0",
"Reading": 18000.0,
"ReadingRangeMax": 18000.0,
"ReadingRangeMin": 0.0,
"ReadingType": "Rotational",
"ReadingUnits": "RPM",
"SpeedRPM": 18000.0,
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
```
Change-Id: I8ec1e739bcd5ebce7453a2570569f2edc2284341
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
|
|
This patch enable support for following properties for Port of a PCIe
Switch. [1]
- PortProtocol
- PortType
- CurrentSpeedGbps
- ActiveWidth
One of the devices that gets enabled with this patch is Nvidia ConnectX
devices, which are network cards featuring an integrated PCIe switch.
These devices combine both PCIe ports and network ports in a single
unit. Since such devices don't strictly qualify as Fabric Adapters, the
Switch URI is used instead of the FabricAdapter URI.
Port schema only allows certain URIs as Port URI. URI
/redfish/v1/Fabrics/{FabricId}/Switches/{SwitchId}/Ports/{PortId} seems
most appropriate choice for PCIe Switch Port. [1]
The Fabric resource is modeled similarly to the System resource, meaning
that only one Fabric resource will exist for each BMC. Route handler for
collections and each individual components are added in this patch for
each URI resource under /redfish/v1/Fabrics.
DBus Interface "xyz.openbmc_project.Inventory.Item.PCIeSwitch" is used
to identify the Switch resources. Association between Switch and Port is
`connecting` and `connected_to`.
Feature like Port Metrics properties (for PCIe Error Counters) can be
added in future at Port Metric URI.
dbus-sensors patches -
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84079
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/83202
Tested: Build an image for nvl32-obmc machine with the following patch
cherry picked.
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/84079
https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490
The openbmc patch cherry-picks the following patches that are currently
under review.
```
1. device tree
https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/
2. mctpd patches
https://github.com/CodeConstruct/mctp/pull/85
3. u-boot changes
https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t
4. kernel changes as specified in the openbmc patch (for espi)
5. entity-manager changes
https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455
6. platform-init changes
https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456
7. spi changes
https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/
```
redfish service validator is passing.
```
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/
{
"@odata.id": "/redfish/v1/Fabrics",
"@odata.type": "#FabricCollection.FabricCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Fabrics/fabric"
}
],
"Members@odata.count": 1,
"Name": "Fabric Collection"
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/
{
"@odata.id": "/redfish/v1/Fabrics/fabric",
"@odata.type": "#Fabric.v1_2_0.Fabric",
"Id": "fabric",
"Name": "fabric Fabric",
"Switches": {
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches"
}
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches",
"@odata.type": "#SwitchCollection.SwitchCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_1"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_2"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_3"
}
],
"Members@odata.count": 4,
"Name": "fabric Switch Collection"
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0",
"@odata.type": "#Switch.v1_7_0.Switch",
"Id": "Nvidia_ConnectX_0",
"Name": "Nvidia_ConnectX_0",
"Ports": {
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports"
},
"Status": {
"Health": "OK",
"State": "Enabled"
}
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports",
"@odata.type": "#PortCollection.PortCollection",
"Members": [
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/DOWN_0"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/DOWN_1"
},
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0"
}
],
"Members@odata.count": 3,
"Name": "Nvidia_ConnectX_0 Port Collection"
}%
$ curl -k -u 'root:0penBmc' https://${bmc_ip}/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/
{
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0",
"@odata.type": "#Port.v1_4_0.Port",
"ActiveWidth": 8,
"CurrentSpeedGbps": 32.0,
"Id": "UP_0",
"Metrics": {
"@odata.id": "/redfish/v1/Fabrics/fabric/Switches/Nvidia_ConnectX_0/Ports/UP_0/Metrics"
},
"Name": "Nvidia_ConnectX_0 UP_0 Port",
"PortProtocol": "PCIe",
"PortType": "UpstreamPort",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}%
```
[1]: https://redfish.dmtf.org/schemas/v1/Port_v1.xml
Change-Id: I52f4ca62b4953f6196c589e340602a0d7885d9c1
Signed-off-by: Harshit Aghera <haghera@nvidia.com>
|
|
Add test assertions for Cables and JsonSchemas endpoints in the
ServiceRoot response. These verify that both endpoints are properly
exposed with their respective @odata.id URIs at /redfish/v1/Cables
and /redfish/v1/JsonSchemas
Change-Id: Icec5d2c5a99872f6a44a6c82f0d5ab02490d9339
Signed-off-by: Ramya Sivakumar <sramya@ami.com>
|
|
nlohmann::json::begin() throws an uncaught exception.
Tested: Redfish service validator passes.
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I08244b0787cd4d6e592b0731196490a5160aba62
|
|
An earlier commit [1] refactored parts of objectPropertiesToJson() into
sub-functions to make the code easier to follow. The review of that
change requested unit tests for these new functions. [2] This commit
adds them.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/85835
[2] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/85835/comments/408617a1_474b4062
Tested: Compiles and unit tests pass
Change-Id: I65e06deccb4b7194603f2749a977986bcb673cd1
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
|
|
Add support for PeakReading and PeakReadingTime for sensors. This
enhancement allows sensor readings to include max observed value
information in the Redfish API, along with timestamp. It uses PDI
xyz.openbmc_project.Telemetry.Report. Property PeakReading is added if
OperationType in PDI property ReadingParameters is set to Maximum.
Current Limitation -
The ResetMetrics action is currently not supported for sensor URIs. As a
result, the ability to clear PeakReading values for GPU Power Sensors
has not been implemented.
Future Consideration -
If ResetMetrics action support is added in the future, the corresponding
functionality will also need to be implemented in the dbus-sensor
application to ensure full compatibility.
Schema:
https://redfish.dmtf.org/schemas/v1/Sensor.v1_2_0.yaml (PeakReading)
Backend implementation for reference:
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/82479
Tested: Build an image for nvl32-obmc machine with the following patches
cherry picked.
https://gerrit.openbmc.org/c/openbmc/openbmc/+/85490
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/82449.
The patch cherry-picks the following patches that are currently under
review.
```
1. device tree
https://lore.kernel.org/all/aRbLqH8pLWCQryhu@molberding.nvidia.com/
2. mctpd patches
https://github.com/CodeConstruct/mctp/pull/85
3. u-boot changes
https://lore.kernel.org/openbmc/20251121-msx4-v1-0-fc0118b666c1@nvidia.com/T/#t
4. kernel changes as specified in the openbmc patch (for espi)
5. entity-manager changes
https://gerrit.openbmc.org/c/openbmc/entity-manager/+/85455
6. platform-init changes
https://gerrit.openbmc.org/c/openbmc/platform-init/+/85456
7. spi changes
https://lore.kernel.org/all/20251121-w25q01jv_fixup-v1-1-3d175050db73@nvidia.com/
```
```
> curl -s -k -u 'root:0penBmc' https://10.137.203.137/redfish/v1/Chassis/NVIDIA_GB200_1/Sensors/power_NVIDIA_GB200_GPU_0_Power_0
{
"@odata.id": "/redfish/v1/Chassis/NVIDIA_GB200_1/Sensors/power_NVIDIA_GB200_GPU_0_Power_0",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "power_NVIDIA_GB200_GPU_0_Power_0",
"Name": "NVIDIA GB200 GPU 0 Power 0",
"PeakReading": 52.671,
"PeakReadingTime": 0,
"Reading": 27.214,
"ReadingRangeMax": 5000.0,
"ReadingRangeMin": 0.0,
"ReadingType": "Power",
"ReadingUnits": "W",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}%
````
Change-Id: I8c1ab6ce85f31419db4a1d931bf99722d24afbd7
Signed-off-by: Harshit Aghera <haghera@nvidia.com>
|
|
Initially, systems_utils.hpp has not defined its own namespace, all
functions were under the redfish namespace. Patch 82078 [1] introduced
systems_utils namespace to the header for new functionality.
This patch adds all functions, that haven't been part of the new
namespace to systems_utils namespace and updates all call sites
accordingly.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/82078
Tested: Code compiles.
Change-Id: Ia6ac3edd36aacc22cbf1a6adae4e2b264932b43c
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
This commit adds file descriptor and temporary file management to
DuplicatableFileHandle, removing the redundant test-only
TemporaryFileHandle utility.
Changes:
- Add file descriptor constructor and setFd() method
- Add temporary file constructor with string_view content
- Add filePath member and automatic cleanup in destructor
- Add configurable temp-dir meson option (default: /tmp/bmcweb)
- Remove include/file_test_utilities.hpp
- Update all tests to use DuplicatableFileHandle
- Rename stringPath to filePath
These features will be used by the multipart parser to stream
large uploads to temporary files instead of keeping them in memory,
and by the update service to pass file descriptors over D-Bus.
Change-Id: I982f5928d453f9f0c13d91c3525006134ddc87b3
Signed-off-by: Rajeev Ranjan <ranjan.rajeev1609@gmail.com>
|
|
Applications are logging Redfish Message ID to journal, but the version
of some message ID are different with the definition of bmcweb. E.g:
- psusensor is defining version of OpenBMC registry is "0.1" as [1].
- The bmcweb defines the version of OpenBMC registry is "0.5" as [2].
It makes the "MessageId" property of Event log's enties has different
version with definition in the /redfish/v1/Registries.
This commit corrects the version of Message ID.
[1]: https://github.com/openbmc/dbus-sensors/blob/6b7123225fc4a5180faf89190e9f64a7e248e697/src/psu/PSUEvent.cpp#L121
[2]: https://github.com/openbmc/bmcweb/blob/master/redfish-core/include/registries/openbmc.json#L1678
Tested:
Verify the version of Events are the same the version of Registries
that are defined in the bmcweb.
Change-Id: Ib862c8d0a62cae63082436cb4646a9ca45207872
Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
|
|
Deprecate intoToHex handler now that we can do everything using
std::format.
Tested: RSV passes
Redfish protocol validator passes
Change-Id: I71000506573314d6c9326c4677f5fbca1ca02b46
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
Include cleaner helps the code review process. Add it back, by ignoring
some of the more recent boost headers.
Change-Id: I6eddd0e67cd9f469c93fbb344cc1ab46231e450f
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
The EnvironmentMetrics schema[1] provides for efficient retrieval of
environmental metrics by separating them from performance metrics.
EnvironmentMetrics is a property of the Chassis schema since v1_15_0[2].
EnvironmentMetrics was added to Redfish release 2021.2 [3] to be used
instead of the deprecated Power schema.[4]
This commit adds PowerWatts property of the EnvironmentMetrics schema.
PowerWatts has been part of the EnvironmentMetrics schema since v1_1_0.
PowerWatts is a SensorPowerExcerpt[5].
Implementation notes: The new D-Bus interface
"xyz.openbmc_project.Sensor.Purpose" is used to find the sensor with the
"TotalPower" purpose.[6][7] The new utility function
sensor_utils::getSensorsByPurpose() returns a subset of an incoming list
of sensors which implement a specified purpose.
Multiple D-Bus calls are needed to find the sensor providing the
totalPower:
1. Retrieve list of power sensors associated with specified chassis
which implement the Sensor.Purpose interface using existing
getAllSensorObjects() function.
2. For each of those power sensors retrieve the actual purpose of the
sensor to find the sensor implementing totalPower purpose. Expect no
more than one sensor to implement this purpose. New utility function
getSensorsByPurpose() is used.
3. If a totalPower sensor is found then retrieve its properties to fill
in PowerWatts in the response using existing
sensor_utils::objectExcerptToJson() utility function.
If no sensor has the "TotalPower" purpose then PowerWatts is
not added to EnvironmentMetrics and no error is returned.
[1] https://redfish.dmtf.org/schemas/v1/EnvironmentMetrics.v1_3_2.json
[2] https://redfish.dmtf.org/schemas/v1/Chassis.v1_25_2.json
[3] http://redfish.dmtf.org/schemas/Redfish_Release_History.pdf
[4] https://redfish.dmtf.org/schemas/v1/Power.v1_7_3.json
[5] http://redfish.dmtf.org/schemas/v1/Sensor.v1_9_1.json#/definitions/SensorPowerExcerpt
[6] https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/75943
[7] https://gerrit.openbmc.org/c/openbmc/openpower-occ-control/+/77408
Tested:
- Updated unit tests for new environmentMetricsNode enum
- Redfish Service Validator passes (confirmed PowerWatts tested)
```
VERBOSE1 - ServiceRoot -> Chassis -> Members#4 -> EnvironmentMetrics, EnvironmentMetrics.v1_3_0, EnvironmentMetrics
VERBOSE1 - @odata.id PASS
VERBOSE1 - @odata.type PASS
VERBOSE1 - Id PASS
VERBOSE1 - Name PASS
VERBOSE1 - PowerWatts PASS
```
- No "TotalPower" sensor exists (system never powered on).
PowerWatts is not shown and no error is returned.
```
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/EnvironmentMetrics
{
"@odata.id": "/redfish/v1/Chassis/chassis/EnvironmentMetrics",
"@odata.type": "#EnvironmentMetrics.v1_3_0.EnvironmentMetrics",
"Id": "EnvironmentMetrics",
"Name": "Chassis Environment Metrics"
}
```
- "TotalPower" sensor exists (system powered on)
```
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Systems/system | grep PowerState
"PowerState": "On",
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/EnvironmentMetrics
{
"@odata.id": "/redfish/v1/Chassis/chassis/EnvironmentMetrics",
"@odata.type": "#EnvironmentMetrics.v1_3_0.EnvironmentMetrics",
"Id": "EnvironmentMetrics",
"Name": "Chassis Environment Metrics",
"PowerWatts": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/power_total_power",
"Reading": 191.0
}
}
```
DataSourceUri is a valid sensor:
```
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/Sensors/power_total_power
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/power_total_power",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "power_total_power",
"Name": "total power",
"Reading": 191.0,
"ReadingType": "Power",
"ReadingUnits": "W",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
```
- "TotalPower" sensor exists but null value (system powered off)
```
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Systems/system | grep PowerState
"PowerState": "Off",
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/EnvironmentMetrics
{
"@odata.id": "/redfish/v1/Chassis/chassis/EnvironmentMetrics",
"@odata.type": "#EnvironmentMetrics.v1_3_0.EnvironmentMetrics",
"Id": "EnvironmentMetrics",
"Name": "Chassis Environment Metrics",
"PowerWatts": {
"DataSourceUri": "/redfish/v1/Chassis/chassis/Sensors/power_total_power",
"Reading": null
}
}
```
And again the DataSourceUri points to a valid sensor:
```
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassis/Sensors/power_total_power
{
"@odata.id": "/redfish/v1/Chassis/chassis/Sensors/power_total_power",
"@odata.type": "#Sensor.v1_2_0.Sensor",
"Id": "power_total_power",
"Name": "total power",
"Reading": null,
"ReadingType": "Power",
"ReadingUnits": "W",
"Status": {
"Health": "OK",
"State": "Enabled"
}
}
```
- Invalid chassis id ("TotalPower" sensor exists)
```
curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/Chassis/chassisBAD/EnvironmentMetrics
{
"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.19.ResourceNotFound",
"MessageSeverity": "Critical",
"Resolution": "Provide a valid resource identifier and resubmit the request."
}
],
"code": "Base.1.19.ResourceNotFound",
"message": "The requested resource of type Chassis named 'chassisBAD' was not found."
}
}
```
Signed-off-by: George Liu <liuxiwei@inspur.com>
Signed-off-by: Janet Adkins <janeta@us.ibm.com>
Change-Id: Ibe84a5e7fe0d2b232f925e457a094c021ca85d36
|
|
These decodes haven't been standard practice for a while. While they
will likely break some downstream builds, we need to clean things up.
If you are seeing this commit message because your downstream build is
broken, please migrate your code to using nlohmann::json::object_t
instead of nlohmann::json when it does the unpack.
Tested: Code compiles.
Change-Id: Id892ee381b2d6b40a6366ee0622cde04d2cacd7b
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|
|
Ignores any json property named `DateTime` when calculating
the etag value of an HTTP response as per the updated
Redfish Spec (section 6.5: ETags)
Tested:
- Redfish Service Validator passes
- Tested on romulus:
1. GET resource with a "DateTime" field
```
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/TaskService" \
--etag-save ./etag.txt -v
...
< etag: "6A4CE897"
...
{
"@odata.id": "/redfish/v1/TaskService",
"@odata.type": "#TaskService.v1_1_4.TaskService",
"CompletedTaskOverWritePolicy": "Oldest",
"DateTime": "2025-07-23T17:08:20+00:00",
"Id": "TaskService",
"LifeCycleEventOnTaskStateChange": true,
"Name": "Task Service",
"ServiceEnabled": true,
"Status": {
"State": "Enabled"
},
"Tasks": {
"@odata.id": "/redfish/v1/TaskService/Tasks"
}
```
2. GET same resource again later, etag is same as before
```
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/TaskService" \
--etag-save ./etag.txt -v
...
< etag: "6A4CE897"
...
{
"@odata.id": "/redfish/v1/TaskService",
"@odata.type": "#TaskService.v1_1_4.TaskService",
"CompletedTaskOverWritePolicy": "Oldest",
"DateTime": "2025-07-23T17:10:48+00:00",
"Id": "TaskService",
"LifeCycleEventOnTaskStateChange": true,
"Name": "Task Service",
"ServiceEnabled": true,
"Status": {
"State": "Enabled"
},
"Tasks": {
"@odata.id": "/redfish/v1/TaskService/Tasks"
}
```
"DateTime" is the only value to have changed, but since
it is ignored the etag did not change
3. GET with if-none-match returns 304
```
curl -k -H "X-Auth-Token: $XAUTH_TOKEN" "https://$BMC/redfish/v1/TaskService" \
--etag-save ./etag.txt --etag-compare ./etag.txt -v
...
> if-none-match: "6A4CE897"
...
< HTTP/2 304
< allow: GET
< odata-version: 4.0
< strict-transport-security: max-age=31536000; includeSubdomains
< pragma: no-cache
< cache-control: no-store, max-age=0
< x-content-type-options: nosniff
< etag: "6A4CE897"
< date: Wed, 23 Jul 2025 17:14:39 GMT
< content-length: 0
<
...
```
Change-Id: I51f7668e75719c69c55535e4a1e48c8bae7c9488
Signed-off-by: Corey Ethington <cethington@coreweave.com>
|
|
Add support for multi-host GET request-handling under the
/redfish/v1/Systems/{computerSystemId}/ redfish resource.
All multi-host supported redfish URIs can be found in this listing [1].
Multi-host meson options needed:
-Dexperimental-redfish-multi-computer-system=enabled
Tested: Validator passes on single-host machine and yv4 qemu emulation.
[1] https://gerrit.openbmc.org/c/openbmc/bmcweb/+/76118
Change-Id: I67c17c3dd7a354fa9a2ebbc56d4def7a7e788909
Signed-off-by: Oliver Brewka <oliver.brewka@9elements.com>
|
|
Since 2020, nlohmann has recognized that implicit conversions to and
from json are an issue. Many bugs have been caused at both development
time and runtime due to unexpected implicit conversions from json to
std::string/int/bool. This commit disables implicit conversions using
JSON_USE_IMPLICIT_CONVERSIONS [1]. This option will become the default
in the future. That comment was written 3 years ago at this point, so
we should prepare.
Tested:
Redfish service validator passes.
[1] https://json.nlohmann.me/api/macros/json_use_implicit_conversions/
Change-Id: Id6cc47b9bbf8889e4777fd6d77ec992f3139962c
Signed-off-by: Ed Tanous <etanous@nvidia.com>
|