History log of /openbmc/phosphor-psu-code-mgmt/test/ (Results 1 – 25 of 37)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
80c2daae23-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability-convert-member-functions-to-static

This check finds non-static member functions that can be made
static because the functions don’t use this.
This check also triggers

clang-tidy: Enable readability-convert-member-functions-to-static

This check finds non-static member functions that can be made
static because the functions don’t use this.
This check also triggers readability-static-accessed-through
-instance check as we are trying to access a static member
function through an instance.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I6c06c61e8f199247e74aca3443741683e3853274

show more ...

22c2fbd823-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability-uppercase-literal-suffix check

cert-dcl16-c redirects here as an alias for this check. By default,
only the suffixes that begin with l (l, ll, lu, llu, but not u, ul,

clang-tidy: Enable readability-uppercase-literal-suffix check

cert-dcl16-c redirects here as an alias for this check. By default,
only the suffixes that begin with l (l, ll, lu, llu, but not u, ul,
ull) are diagnosed by that alias.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I180ee3e3274899c63181f69a14f158319f178f0c

show more ...

71ae535c23-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability-make-member-function-const check

Finds non-static member functions that can be made const because the
functions don’t use this in a non-const way.

Signed-off-by: Geor

clang-tidy: Enable readability-make-member-function-const check

Finds non-static member functions that can be made const because the
functions don’t use this in a non-const way.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Iff3a367401d571f9fcff90539aaab59e2c66e627

show more ...

66a54ad423-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable cppcoreguidelines-special-member-functions

The check finds classes where some but not all of the special member
functions are defined.

By default the compiler defines a copy cons

clang-tidy: Enable cppcoreguidelines-special-member-functions

The check finds classes where some but not all of the special member
functions are defined.

By default the compiler defines a copy constructor, copy assignment
operator, move constructor, move assignment operator and destructor.
The default can be suppressed by explicit user-definitions. The
relationship between which functions will be suppressed by
definitions of other functions is complicated and it is advised that
all five are defaulted or explicitly defined.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Icbfd448b2bf78ebf99ec07b55220871e093cb899

show more ...

047d994423-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable cppcoreguidelines-explicit-virtual-functions

Adds override (introduced in C++11) to overridden virtual functions
and removes virtual from those functions as it is not required.

v

clang-tidy: Enable cppcoreguidelines-explicit-virtual-functions

Adds override (introduced in C++11) to overridden virtual functions
and removes virtual from those functions as it is not required.

virtual on non base class implementations was used to help indicate
to the user that a function was virtual. C++ compilers did not use
the presence of this to signify an overridden function.

In C++11 override and final keywords were introduced to allow
overridden functions to be marked appropriately. Their presence
allows compilers to verify that an overridden function correctly
overrides a base class implementation.

This can be useful as compilers can generate a compile time error
when:
- The base class implementation function signature changes.
- The user has not created the override with the correct signature.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I428f69c11b071a1a50e7f93f7bcc29c8300dcddb

show more ...

bab5ed9916-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

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

show more ...

760053d816-May-2024 Faisal Awada <faisal@us.ibm.com>

Waiting for PSUs to be available during startup

Modified the Software PSU Updater Service to wait until inventory
service available. Updated ItemUpdater::scanDirectory to search
for the installed PS

Waiting for PSUs to be available during startup

Modified the Software PSU Updater Service to wait until inventory
service available. Updated ItemUpdater::scanDirectory to search
for the installed PSU model directory. For example, the PSU model
2B1E should have a directory named /usr/share/obmc/psu/2B1E. The
firmware file and the MANIFEST reside in the model directory.

Added a new function, `onInterfacesAdded`, processes D-Bus messages
to update the internal state of PSU devices. It performs the following
steps:
- Read D-Bus message to extract the object path and interfaces.
- Check for PSU Interface.
- Retrieve all PSUs inventory paths from the D-Bus.
- Update PSU present status and model. If the PSU is present and has
valid version, process FW update to latest version.

Fixed the issue with version comparison when there is no firmware to
compare with.

Tested:
Tested the code in simulation module and verified it waits for all PSUs
to be discovered. Verified phosphor-psu-code-manager invokes psutils to
get the PSU version, compare and update.

Change-Id: Ic26e215baffd56fc070cc0cf6d3fff92fdfb914c
Signed-off-by: Faisal Awada <faisal@us.ibm.com>

show more ...

33cf9f0817-Jun-2024 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://githu

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://github.com/codespell-project/codespell

Change-Id: Icafafe827d67c9b6cc5c3f6bfb204fe425e91a32
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>

show more ...

ce6c5c5429-Nov-2023 Patrick Williams <patrick@stwcx.xyz>

build: use allowed over enabled

Meson feature options are typically in a tri-state of enabled, disabled,
or auto. The enabled and disabled functions on an option (from
`get_option`) no longer retur

build: use allowed over enabled

Meson feature options are typically in a tri-state of enabled, disabled,
or auto. The enabled and disabled functions on an option (from
`get_option`) no longer return true for auto features. Instead, the
expectation is to use `allowed()` which is true for both enabled and auto.

Switch all uses of `enabled` to `allowed`.

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

show more ...

3f6c12b820-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 ...

4ba2edcc06-Jan-2023 Chicago Duan <duanzhijia01@inspur.com>

Fix bug: Fix spelling errors

Fix spelling errors.

Signed-off-by: Chicago Duan <duanzhijia01@inspur.com>
Change-Id: Ibf7c6598be90d6a19d4a39adef0dee2202d9f0a6

374fae5622-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 ...

b5f9b82916-Jun-2022 Patrick Williams <patrick@stwcx.xyz>

remove std::experimental usage

The bug previously referenced that instigated the usage of
std::experimental::any instead of std::any has long been fixed in
GCC/libstdc++. Switch back to use the non

remove std::experimental usage

The bug previously referenced that instigated the usage of
std::experimental::any instead of std::any has long been fixed in
GCC/libstdc++. Switch back to use the non-experimental library.

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

show more ...

a8b966f117-Mar-2020 Lei YU <mine260309@gmail.com>

Add updateable association

Add 'updateable' association to the functional PSU firmware.
This 'updateable' association can be used to mark all the
firmware components which can be programmable from B

Add updateable association

Add 'updateable' association to the functional PSU firmware.
This 'updateable' association can be used to mark all the
firmware components which can be programmable from BMC
interfaces like Redfish.

Resolves openbmc/phosphor-psu-code-mgmt#2

Tested: Verify unit tests success;
Verify the updateable associations are created for PSU firmware
objects on Witherspoon, and the Redfish has "Updateable": true
for the PSU images.

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

show more ...

8afeee5621-Oct-2019 Lei YU <mine260309@gmail.com>

Activation: add BMC reboot guard

BMC shall not reboot during PSU update, otherwise it has the risk of
putting the PSU in a bad state.
So add BMC reboot guard in ActivationBlocksTransition to enable

Activation: add BMC reboot guard

BMC shall not reboot during PSU update, otherwise it has the risk of
putting the PSU in a bad state.
So add BMC reboot guard in ActivationBlocksTransition to enable reboot
guard when PSU update is started, and disable it when it's finished or
failed.

During test, it's found that the ActivationBlocksTransition is created
too early before checking the PSU compatibility, it is fixed by
constructing ActivationBlocksTransition after the check.

Tested: Verify the BMC guard is enabled and disabled during PSU update.

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

show more ...

d0f8bbb318-Oct-2019 Lei YU <mine260309@gmail.com>

Version: support CRLF line feed in MANIFEST

When a MANIFEST is generated from Windows and it contains CRLF as line
feed, the code was getting each line with '\r' at the end, and thus the
parsed stri

Version: support CRLF line feed in MANIFEST

When a MANIFEST is generated from Windows and it contains CRLF as line
feed, the code was getting each line with '\r' at the end, and thus the
parsed string contains '\r' and it incorrectly parses the string.

Add a piece of code to support CRLF line feed so support such MANIFEST
files.

Tested: Added a unit test case to verify CRLF is correctly handled.

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

show more ...

1517f5f614-Oct-2019 Lei YU <mine260309@gmail.com>

Check and sync PSU image when PSU is plugged in

When a PSU is plugged out and in, the service shall check the version
and do update if it is with an old software.
When the PSU is plugged in, the mod

Check and sync PSU image when PSU is plugged in

When a PSU is plugged out and in, the service shall check the version
and do update if it is with an old software.
When the PSU is plugged in, the model is not available for a while, so
the service subscribe the model property as well, and only create the
software object when both present and model properties are set.

Tested: With dummy update service, verify on Witherspoon that when PSU
is plugged out (by setting "Present" property in inventory), the
software object is removed, and when it's pluggd int (by setting
"Present" property), the software object is created after the
model is got, and is upgraded by a newer image stored in BMC
filesystem.

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

show more ...

ffb3653915-Oct-2019 Lei YU <mine260309@gmail.com>

Activation: remove old objects after update done

The update on PSUs is one-by-one, after each PSU is updated, notify
ItemUpdater by onUpdateDone() so that the old object for the PSU is
removed.

Tes

Activation: remove old objects after update done

The update on PSUs is one-by-one, after each PSU is updated, notify
ItemUpdater by onUpdateDone() so that the old object for the PSU is
removed.

Tested: With dummy PSU image and update service, verify the old
objects are removed on Witherspoon.

Change-Id: I212b8cba9570ad96083d362bf57691fdabb4e42f

show more ...

63f9e71212-Oct-2019 Lei YU <mine260309@gmail.com>

Sync PSU images on service startup

On service startup, it shall check the PSU images, find a latest
version, and update to the PSUs that are not with this version.

Tested: With dummy image and serv

Sync PSU images on service startup

On service startup, it shall check the PSU images, find a latest
version, and update to the PSUs that are not with this version.

Tested: With dummy image and service, test on Witherspoon with 2
different running PSU software:
* When startup without stored image, the serive tries to update an older
PSU but it does not have PSU image, so it's skipped with below journal
log:
Automatically update PSU
No image for the activation, skipped
* When startup with an older image stored in BMC, it behaves the same as
above.
* When startup with a new image stored in BMC, it updates the PSUs, with
below example journal log:
Automatically update PSU
Starting Update PSU
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
/var/lib/obmc/psu/2B1D...
Started Update PSU
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
/var/lib/obmc/psu/2B1D.
Starting Update PSU
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1
/var/lib/obmc/psu/2B1D...
Started Update PSU
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1
/var/lib/obmc/psu/2B1D.

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

show more ...

4b9ac39211-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 ...

6520748d11-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 ...

c09155bb11-Oct-2019 Lei YU <mine260309@gmail.com>

Test: Use unique mocked utils for each test

The mocked utils object was shared between the tests because it's a
static object. This causes problems on expecting the number of
called the mocked funct

Test: Use unique mocked utils for each test

The mocked utils object was shared between the tests because it's a
static object. This causes problems on expecting the number of
called the mocked functions.

Add a freeUtils() in mocked_utils.hpp, and call it in test fixture's
destructor, so that each test case will use a different mocked object.

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

show more ...

e8945ea629-Sep-2019 Lei YU <mine260309@gmail.com>

Activation: support updating PSU from stored image

The previous code assume the image to update is from IMG_DIR.
Now it needs to update PSU from pre-built or stored images.

This commit adds the sup

Activation: support updating PSU from stored image

The previous code assume the image to update is from IMG_DIR.
Now it needs to update PSU from pre-built or stored images.

This commit adds the support, by constructing the systemd unit based on
Activation's Path property instead of IMG_DIR.

Tested: Verify on Witherspoon that it is able to activate a stored
image.

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

show more ...

58c26e3f27-Sep-2019 Lei YU <mine260309@gmail.com>

Scan directories that store PSU images on start

When the service starts, scan the directories that store PSU images,
including the built-in images, and the saved images during PSU update.

When the

Scan directories that store PSU images on start

When the service starts, scan the directories that store PSU images,
including the built-in images, and the saved images during PSU update.

When the scanned image is different than the running images, create
activation/version object;
When the scanned image is the same as the running images, update the
version object's path to indicate the PSU image path, so it could be
used for future update in case a PSU is replaced with a different
software.

Tested: On Witherspoon, fake create a dummy PSU image with a different
version than running PSU, verify a new object is created on
restart;
fake creating a dummy PSU image with a same version as a running
PSU, verify no new object is created, but the "Path" property is
set to the PSU image directory.

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

show more ...

9930137b29-Sep-2019 Lei YU <mine260309@gmail.com>

Refactor: Make Activation inherit FilePath interface

Previously Version inherits FilePath interface to provide the
information of the file path property of a software, and Activation was
using pre-d

Refactor: Make Activation inherit FilePath interface

Previously Version inherits FilePath interface to provide the
information of the file path property of a software, and Activation was
using pre-defined location to find the image path (IMG_DIR / versionId).

Now the code is going to support pre-built image and stored image during
update, the Activation class needs to know the file path to perform the
update.

So this commit "moves" the FilePath from Version to Activation.

Tested: Verify the "Path" property on FilePath still exists on the DBus
object after uploading a tarball.

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

show more ...

12