History log of /openbmc/phosphor-psu-code-mgmt/src/utils.cpp (Results 1 – 13 of 13)
Revision Date Author Comments
# 3f6c12b8 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I732e5e7e4a76173d0018b1cd540c3b9b4adee83e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 5670b188 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Idb72665dbadfa8afd569a2e0e254d84f0a2108d3
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 374fae56 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ie530f2c63000bbfac7c5fbbc74ebe6bc8c07fb1a

show more ...


# 0b7c7b3a 07-Feb-2022 George Liu <liuxiwei@inspur.com>

openssl: stop using deprecated SHA512_* functions

The openssl/sha.h header is deprecated for OpenSSL 3 along with all the
functions in it. Switch to use the EVP_MD interfaces.

Signed-off-by: Georg

openssl: stop using deprecated SHA512_* functions

The openssl/sha.h header is deprecated for OpenSSL 3 along with all the
functions in it. Switch to use the EVP_MD interfaces.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I17f9cd3652d92caab1baf29829e8e0cd6f781142

show more ...


# 6d62ceb3 02-Sep-2021 Patrick Williams <patrick@stwcx.xyz>

exception: switch to public sdbus exception

SdBusError was intended to be a private error type inside sdbusplus.
Switch all catch locations to use the general sdbusplus::exception type.

Signed-off-

exception: switch to public sdbus exception

SdBusError was intended to be a private error type inside sdbusplus.
Switch all catch locations to use the general sdbusplus::exception type.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3f173e46d23ab9a21f37356df848f5226ccf7962

show more ...


# 2d156252 17-Oct-2019 Lei YU <mine260309@gmail.com>

Fix an incorrect logging

It was incorrectly using "%d" to log a "METHOD" string.
Fix it.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I792f82feb894f5d5a83c4d4f60f52135f6d08dd0


# 4b9ac392 11-Oct-2019 Lei YU <mine260309@gmail.com>

utils: Add function to check if PSU is associated

Add a helper function to check if a PSU is in an association list, which
will be used in future commits to check if a PSU is running a software
imag

utils: Add function to check if PSU is associated

Add a helper function to check if a PSU is in an association list, which
will be used in future commits to check if a PSU is running a software
image.

Tested: added unit test case and verify it passes.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I99b5d3d8d09f8e09a1eb42ba104a4804b7214cf1

show more ...


# 6520748d 11-Oct-2019 Lei YU <mine260309@gmail.com>

utils: Add function to get the latest version

This repo does not know which PSU version is the latest, and it lets the
vendor tool to decide which one is the latest.

This commit defines PSU_VERSION

utils: Add function to get the latest version

This repo does not know which PSU version is the latest, and it lets the
vendor tool to decide which one is the latest.

This commit defines PSU_VERSION_COMPARE_UTIL which is expected to be a
tool that accepts arguments of a list of versions, and returns the
latest version string.

Tested: Put and configure to use the example get_latest_version on
Witherspoon, verify the versionId with a larger version string
is returned.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ic5a10d3724cf6a98b3979486c72d54f8deac7038

show more ...


# d0bbfa9e 11-Sep-2019 Lei YU <mine260309@gmail.com>

Activation: Delete version interface after activation

When activation is finished, the version interface and the related
images created by phosphor-version-software-manager shall be deleted.

This i

Activation: Delete version interface after activation

When activation is finished, the version interface and the related
images created by phosphor-version-software-manager shall be deleted.

This is done by invoking the Delete method of the related service, so we
need to get all the services from the object, and get the correct
service to invoke the Delete method.

Tested: Verify the Version interface created by
xyz.openbmc_project.Software.Version service, and the related
files in /tmp/image/<versionId> are removed after activation is
completed.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Icb14731bbea35175c2519bd40b9f88a0b54a034a

show more ...


# 5f3584d4 27-Aug-2019 Lei YU <mine260309@gmail.com>

Get PSU version from vendor specific tool

The code was getting the version from PSU inventory object.
This commit changes the behavior to use a vendor-specific tool to get
the version directly, wher

Get PSU version from vendor specific tool

The code was getting the version from PSU inventory object.
This commit changes the behavior to use a vendor-specific tool to get
the version directly, where the tool is expected to be configured during
build time.

Add an example get_version app that shows the expected behavior of the
tool:
* It accepts an argument of PSU inventory object;
* It outputs the version to stdout.

Tested: 1. Put and configure to use the example get_version on witherspoon,
verify that PSU software objects are created with the version
returned by the exmaple tool.
2. With the Witherspoon specific tool in
https://gerrit.openbmc-project.xyz/c/openbmc/witherspoon-pfault-analysis/+/24811,
verify the version is correctly got from the PSU inventory path
and the software objects are created.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I5195cb6fc8998a76b09abcfe0b107364cb180c01

show more ...


# f77189f7 07-Aug-2019 Lei YU <mine260309@gmail.com>

Add unit test for item_udpater

To test item_updater easier, mocking utils is necessary.
So add a UtilsInterface to make the mocking eaiser.

Due to the fact that there is templated member functions

Add unit test for item_udpater

To test item_updater easier, mocking utils is necessary.
So add a UtilsInterface to make the mocking eaiser.

Due to the fact that there is templated member functions that could not
be virtual, adding an extra "Impl" virtual function makes it possible to
simulates the mock of templated functions.
See
https://stackoverflow.com/questions/7968023/c-virtual-template-method
for details.

However, using std::any in with googlemock has an issue on GCC9, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415
for details.

So this commit uses std::experimental::any as a workaround.

With the mocked utils, it's easy to test item_updater in different
cases.

This commit adds the test cases for creating PSU objects, when:
* There is no PSU present
* There is one PSU present
* There are two PSUs present with the same version;
* There are two PSUs present with different versions.

Tested: Verify the unit tests passes.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I5d74ab26b344c5c40bc141f97b8aca42e74ee88e

show more ...


# ad90ad51 05-Aug-2019 Lei YU <mine260309@gmail.com>

Create objects for running PSUs

On service startup, create activation and version objects for running
PSUs, and set related active, functional associations.

If multiple PSUs are running with the sa

Create objects for running PSUs

On service startup, create activation and version objects for running
PSUs, and set related active, functional associations.

If multiple PSUs are running with the same software version, they share
the same DBus object, and the object will be associated to multiple PSU
inventories.

Tested: Verify the software objects are created on Witherspoon, and the
active, functional associations are created.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ia8372aba8299818baccfdf37e98fdbc99f747b7c

show more ...


# 5e0dcb39 02-Aug-2019 Lei YU <mine260309@gmail.com>

Get psu inventory path

Invoke GetSubTreePaths on configurable psu inventory base path to get
all the PSU paths.
Add unit test case and meson.build to build the unit test case.

In test/meson.build,

Get psu inventory path

Invoke GetSubTreePaths on configurable psu inventory base path to get
all the PSU paths.
Add unit test case and meson.build to build the unit test case.

In test/meson.build, manually adding dynamic_linker related options for
OE SDK environment to link_args, so that the built test binary could be
executed in OE SDK environment. Otherwise, the ld will not find the
correct shared libraries in OE SDK.

And you have to execute the test binaries manually in OE SDK, because
meson skips running the tests due to it thinks it's cross compiling.
This is described in README as well.

Tested: Verify the build and unit test run OK in OE SDK
environment and in OpenBMC CI.
Verify it gets the PSU inventory paths correctly on Witherspoon.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I2e2003c5897d7a623fad7f87d263b71c926fc46d

show more ...