<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/OpenBmc/bmcweb.git/test/redfish-core/include/utils, branch master</title>
<subtitle>A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/'/>
<updated>2026-09-30T18:19:49+00:00</updated>
<entry>
<title>utils: add PrettyName utility function</title>
<updated>2026-09-30T18:19:49+00:00</updated>
<author>
<name>Akash Arunkumar</name>
<email>mirrorghost007@gmail.com</email>
</author>
<published>2026-06-25T06:35:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=552997940e1a06bc2fc43297d9b7492f008fea03'/>
<id>urn:sha1:552997940e1a06bc2fc43297d9b7492f008fea03</id>
<content type='text'>
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 &lt;mirrorghost007@gmail.com&gt;
Signed-off-by: Justin Nguyen &lt;justinnanguyen@gmail.com&gt;
</content>
</entry>
<entry>
<title>utils: Map Available to UnavailableOffline</title>
<updated>2026-08-19T20:01:10+00:00</updated>
<author>
<name>Justin Nguyen</name>
<email>justinnanguyen@gmail.com</email>
</author>
<published>2026-07-20T15:07:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=e7df55ce35e441b4a97d0db9ae280a71968ffee6'/>
<id>urn:sha1:e7df55ce35e441b4a97d0db9ae280a71968ffee6</id>
<content type='text'>
- 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 &lt;justinnanguyen@gmail.com&gt;
</content>
</entry>
<entry>
<title>Change a few message responses as errors</title>
<updated>2026-06-25T18:51:59+00:00</updated>
<author>
<name>Myung Bae</name>
<email>myungbae@us.ibm.com</email>
</author>
<published>2026-04-29T12:40:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=8b0993927ede52f4a32228d955a8405805acedac'/>
<id>urn:sha1:8b0993927ede52f4a32228d955a8405805acedac</id>
<content type='text'>
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 &lt;myungbae@us.ibm.com&gt;
</content>
</entry>
<entry>
<title>sensor: add charge type support</title>
<updated>2026-06-12T00:07:56+00:00</updated>
<author>
<name>Jagpal Singh Gill</name>
<email>paligill@gmail.com</email>
</author>
<published>2026-06-08T22:27:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=dbc915a65b3fb0ddd07f9bcac83a154179debbd5'/>
<id>urn:sha1:dbc915a65b3fb0ddd07f9bcac83a154179debbd5</id>
<content type='text'>
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 &lt;paligill@gmail.com&gt;
Change-Id: I9b7180cb8597378a1b42f9da73335ca96b20d55a
</content>
</entry>
<entry>
<title>Add helper function for Location and `LocationType`</title>
<updated>2026-04-21T17:59:46+00:00</updated>
<author>
<name>Ed Tanous</name>
<email>etanous@nvidia.com</email>
</author>
<published>2021-12-29T05:12:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=54406f74d01d5045345e3c6cbe5fb9cae1518a53'/>
<id>urn:sha1:54406f74d01d5045345e3c6cbe5fb9cae1518a53</id>
<content type='text'>
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 &lt;zhenweichen0207@gmail.com&gt;
Signed-off-by: Willy Tu &lt;wltu@google.com&gt;
Signed-off-by: Ed Tanous &lt;etanous@nvidia.com&gt;
</content>
</entry>
<entry>
<title>Remove time_t</title>
<updated>2026-04-20T22:36:58+00:00</updated>
<author>
<name>Ed Tanous</name>
<email>etanous@nvidia.com</email>
</author>
<published>2026-04-20T17:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=bb9aae17eeb22ae44f573fd4d33303f65760b5ad'/>
<id>urn:sha1:bb9aae17eeb22ae44f573fd4d33303f65760b5ad</id>
<content type='text'>
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 &lt;etanous@nvidia.com&gt;
</content>
</entry>
<entry>
<title>Expose date/time in local timezone</title>
<updated>2026-04-10T22:21:27+00:00</updated>
<author>
<name>Igor Kanyuka</name>
<email>ifelmail@gmail.com</email>
</author>
<published>2026-03-24T12:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=33d7d41c71bb9a22725d77d97e41114c50b502c0'/>
<id>urn:sha1:33d7d41c71bb9a22725d77d97e41114c50b502c0</id>
<content type='text'>
BMC now exposes DateTime property under the Manager/&lt;ID&gt; 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 &lt;ifelmail@gmail.com&gt;
Signed-off-by: Ed Tanous &lt;ed@tanous.net&gt;
</content>
</entry>
<entry>
<title>Add unit tests for GetDateTimeOffsetNow</title>
<updated>2026-04-10T18:00:12+00:00</updated>
<author>
<name>Ed Tanous</name>
<email>etanous@nvidia.com</email>
</author>
<published>2026-04-03T21:32:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=64f8de4182e253e3d4c164555179ca877ea65ecc'/>
<id>urn:sha1:64f8de4182e253e3d4c164555179ca877ea65ecc</id>
<content type='text'>
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 &lt;etanous@nvidia.com&gt;
</content>
</entry>
<entry>
<title>Add ast-grep rules for common errors</title>
<updated>2026-03-25T21:01:32+00:00</updated>
<author>
<name>Davy Marrero</name>
<email>dmarrero@nvidia.com</email>
</author>
<published>2026-03-13T00:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=df9c5f41a5915f2b46b161e7d8d3ee5c020b0de1'/>
<id>urn:sha1:df9c5f41a5915f2b46b161e7d8d3ee5c020b0de1</id>
<content type='text'>
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 &lt;dmarrero@nvidia.com&gt;
</content>
</entry>
<entry>
<title>Allow to set Manager TZ and show its time in local</title>
<updated>2026-03-20T20:04:48+00:00</updated>
<author>
<name>Igor Kanyuka</name>
<email>ifelmail@gmail.com</email>
</author>
<published>2026-02-23T18:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/OpenBmc/bmcweb.git/commit/?id=22c8e70d0c41e06d15b5533f121ae704fbe8a0fb'/>
<id>urn:sha1:22c8e70d0c41e06d15b5533f121ae704fbe8a0fb</id>
<content type='text'>
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 &lt;ifelmail@gmail.com&gt;
</content>
</entry>
</feed>
