History log of /openbmc/phosphor-objmgr/src/test/ (Results 1 – 25 of 46)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
2a1ef01303-Mar-2025 Patrick Williams <patrick@stwcx.xyz>

meson: reformat with meson formatter

Apply the `meson format` results.

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

d884cdf701-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I555df8382455157bff44671b6f284e3121d5c182
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

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

show more ...

883a892922-Jan-2025 Benjamin Fair <benjaminfair@google.com>

associations: fix leak in assocMaps.ifaces

New entries get added to ifaces whenever an object with associations is
detected, but the entries are never removed even if all the endpoints
are gone, lea

associations: fix leak in assocMaps.ifaces

New entries get added to ifaces whenever an object with associations is
detected, but the entries are never removed even if all the endpoints
are gone, leading to a memory leak.

Change-Id: Ide5439e4eaab7c70fb0331d59d59753905f45066
Signed-off-by: Benjamin Fair <benjaminfair@google.com>
Signed-off-by: Willy Tu <wltu@google.com>

show more ...

7a93d51613-Sep-2024 Myung Bae <myungbae@us.ibm.com>

Return empty paths if no SubTreePathsById is found

`getAssociatedSubTreePaths()` returns the empty paths if there are no
associated subtrees, and bmcweb uses it to differentiate from the error.

How

Return empty paths if no SubTreePathsById is found

`getAssociatedSubTreePaths()` returns the empty paths if there are no
associated subtrees, and bmcweb uses it to differentiate from the error.

However, `getAssociatedSubTreePathsById()` (which is introduced by [1])
returns NotFound error for the case. It would be more appropriate to
match its behavior with `getAssociatedSubTreePaths()`.

Tested:
- unit-test is succeeded for good and bad cases

[1] https://gerrit.openbmc.org/c/openbmc/phosphor-objmgr/+/70699

Change-Id: I84680b1b39ba8ade94ea6fdb7dae280505e5c050
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...

c363323e09-Apr-2024 Lakshmi Yadlapati <lakshmiy@us.ibm.com>

mapper: Add GetAssociatedSubTreePathsById and GetAssociatedSubTreeById

dbus-interface change in:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/69999

This commit implements two new

mapper: Add GetAssociatedSubTreePathsById and GetAssociatedSubTreeById

dbus-interface change in:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/69999

This commit implements two new methods: GetAssociatedSubTreePathsById
and GetAssociatedSubTreeById. These methods retrieve the paths of
associated endpoints corresponding to the provided identifier, filtering
based on their association with specified endpoint interfaces.

GetAssociatedSubTreePathsById returns the D-Bus paths of associated
endpoints, while GetAssociatedSubTreeById retrieves a dictionary of
D-Bus paths of associated endpoints mapped to corresponding services
associated with the provided identifier.

Tested:
'''
busctl call -j "xyz.openbmc_project.ObjectMapper" "/xyz/openbmc_project/object_mapper" \
"xyz.openbmc_project.ObjectMapper" "GetAssociatedSubTreePathsById" ssassas \
"chassis" \
"/xyz/openbmc_project/inventory" \
1 "xyz.openbmc_project.Inventory.Item.Chassis" \
"powered_by" \
1 "xyz.openbmc_project.Inventory.Item.PowerSupply"
{
"type" : "as",
"data" : [
[
"/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply2",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply3"
]
]
}
'''

Another example.

```
busctl call -j xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper \
xyz.openbmc_project.ObjectMapper GetAssociatedSubTreePathsById ssassas \
disk_backplane0 \
/xyz/openbmc_project/inventory \
1 xyz.openbmc_project.Inventory.Item.FabricAdapter \
connecting \
1 xyz.openbmc_project.Inventory.Connector.Port
{
"type" : "as",
"data" : [
[
"/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector0",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector1",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector2",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector3",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector4",
"/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector5"
]
]
}
```

Change-Id: Id55a9b41fe70f7204543d92b5396888f6914a1d4
Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Signed-off-by: Myung Bae <myungbae@us.ibm.com>

show more ...

9052ebd316-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: Ic68b91e23738cafe198c50f40e46d4163bda02b6
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

47b68cbc20-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: Ibc0976e16acb6163431698832a461e9fc7335448
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

670edd1215-Feb-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: update with latest

Copy the latest clang-format and apply to the repository.

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

a99e109c03-Feb-2023 Brad Bishop <bradleyb@fuzziesquirrel.com>

lint: update .clant-format and run

Change-Id: If9cfc42ca96517a4df2c59c130c2e22a2a443467
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

58881d0b02-Oct-2022 Willy Tu <wltu@google.com>

mapper: Add Associated subtree method definition

dbus-interface change in:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/57821

Create new mapper function to make subtree call and

mapper: Add Associated subtree method definition

dbus-interface change in:
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/57821

Create new mapper function to make subtree call and association call at
the same time. With the association definition, we will have more
endpoints to fetch and verify that it is actually the resource that we
are looking for. We need to verify that it has the expected interface to
confirm that it is right device. In the current workflow this will take
two dbus calls to the mapper to get the association and the subtree.

This change aims to reduce that down to one by combining the two
operations. It will not significant performance increase for the daemons,
but it can help reduce the load on the dbus-broker.service.

Tested:
```
Normal Call:
busctl call "xyz.openbmc_project.ObjectMapper" \
"/xyz/openbmc_project/object_mapper" \
"xyz.openbmc_project.ObjectMapper" "GetSubTreePaths" sias \
"/xyz/openbmc_project/inventory" 0 1 \
"xyz.openbmc_project.Inventory.Item.Storage"
as 4 "/xyz/openbmc_project/inventory/storage_0" "/xyz/openbmc_project/inventory/storage_1"
"/xyz/openbmc_project/inventory/storage_4" "/xyz/openbmc_project/inventory/storage_3"

Associated Call: (Only 0 and 1 is associated to the chassis)
busctl call "xyz.openbmc_project.ObjectMapper" \
"/xyz/openbmc_project/object_mapper" \
"xyz.openbmc_project.ObjectMapper" "GetAssociatedSubTreePaths" ssias \
"/xyz/openbmc_project/inventory/chassis_0/storage" \
"/xyz/openbmc_project/inventory" 0 1 "xyz.openbmc_project.Inventory.Item.Storage"
as 2 "/xyz/openbmc_project/inventory/storage_0" "/xyz/openbmc_project/inventory/storage_1"
```

Change-Id: Ib532e660cf20b9efc83045fb1cbd9143d0c1841e
Signed-off-by: Willy Tu <wltu@google.com>

show more ...

aba14d3d31-Jan-2023 Willy Tu <wltu@google.com>

test: Add dbus handler unit tests

Created unit tests for all of the object mapper dbus handlers.

Refactor the handlers to handler.cpp to allow unit testing.
Also updated to use std::set_intersectio

test: Add dbus handler unit tests

Created unit tests for all of the object mapper dbus handlers.

Refactor the handlers to handler.cpp to allow unit testing.
Also updated to use std::set_intersection.

Change-Id: Ib87ab81f949d27f7dab55899d3e8d380e43bda04
Signed-off-by: Willy Tu <wltu@google.com>

show more ...

5b4357da12-Oct-2022 Kallas, Pawel <pawel.kallas@intel.com>

add Associations endpoints change delay timer

When multiple associations that point to the same interface are
created, each change (adding or removing one) leads to updating
"endpoints" property on

add Associations endpoints change delay timer

When multiple associations that point to the same interface are
created, each change (adding or removing one) leads to updating
"endpoints" property on dbus. This property update is time consuming
with many endpoints already present, because each update needs to send
the whole list of current elements plus/minus one. With a lot of
changes in short time it can cause the service to be unresponsive.
This change adds timer to delay updating dbus property. This way many
associations updates can be aggregated into single dbus property
update.

Tested: Ran on hardware with dbus sensor tester. 4000 created sensors
with interfaces are processed within 10 seconds. Time before the change
was above 2 minutes.

Signed-off-by: Kallas, Pawel <pawel.kallas@intel.com>
Change-Id: I1083c027ab12238249cffc67fb29a8ffef6baf83

show more ...

1e94e60b02-Jun-2022 Brad Bishop <bradleyb@fuzziesquirrel.com>

mapper: remove configurable service allowlists

Remove the ability to specify an allow list at runtime. Instead,
introspect any DBus service except those that start with
org.freedesktop. This remov

mapper: remove configurable service allowlists

Remove the ability to specify an allow list at runtime. Instead,
introspect any DBus service except those that start with
org.freedesktop. This removes the need for argument parsing code and
complex bitbake metadata.

Skip org.freedesktop because applications (OpenBMC or otherwise) should
access org.freedesktop services directly and not indirectly via the
OpenBMC mapper.

Change-Id: I83038a121580dcde2a2b3b1f994b3066cc9d955f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

show more ...

26ed4a1e13-Jul-2022 Ed Tanous <edtanous@google.com>

Add boost wrap file

Recent changes make us incompatible with older versions of boost (1.74
in my testing). Like we do elsewhere, add a wrapfile for boost.

At the same time, the tests were missing

Add boost wrap file

Recent changes make us incompatible with older versions of boost (1.74
in my testing). Like we do elsewhere, add a wrapfile for boost.

At the same time, the tests were missing an explicit #include for boost,
so even when the above patch was applied, it still doesn't build. Add
an explicit dependency.

Tested:
meson buildlocal --buildtype=debug && ninja -C buildlocal

Succeeds. Should have no impact to yocto builds.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I20543fd184491dc138a2e145945eb71051c4cd52

show more ...

964681ca08-Jul-2022 Ed Tanous <edtanous@google.com>

Modernize mapper core types

There's a number of best practices that have evolved in our use of
flat_maps and flat_sets since this code was originally written.

First, add std::less<> to the Compare

Modernize mapper core types

There's a number of best practices that have evolved in our use of
flat_maps and flat_sets since this code was originally written.

First, add std::less<> to the Compare template argument. The default
for this is std::less<Key> which limits find() calls (and any lookup for
that matter) to only supporting std::string. Using std::less<> allows
lookup by std::string_view, which can prevent some copies in some cases.

Next, add std::vector<...> to the types under the AllocatorOrContainer
template arg. Per our coding standard, this overrides the default of
using boost::vector, and replaces it with std::vector, which, although
it has a very similar interface, tends to optimize better, and be better
supported overall.

The rest of this patch updates a couple places where the various types
were specifically hardcoded, so it moves to using the various using
declarations.

Tested: Unit tests; Next patch tests this more fully.

Change-Id: I11e8ecb669f31193c55dda344b25d3fa5d191502
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...

d554232b02-Jun-2022 Brad Bishop <bradleyb@fuzziesquirrel.com>

mapper: remove service deny list feature

This feature has existed for years, but remains unused. Drop the dead
code.

Change-Id: I1b0b6f7fee0da30a3e36e1d151e70e1039fe2c7b
Signed-off-by: Brad Bishop

mapper: remove service deny list feature

This feature has existed for years, but remains unused. Drop the dead
code.

Change-Id: I1b0b6f7fee0da30a3e36e1d151e70e1039fe2c7b
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

show more ...

1f62380a31-May-2022 Brad Bishop <bradleyb@fuzziesquirrel.com>

lint: fix trivial clang tidy errors

Change-Id: Ie5395004a451d6168249f56f75c5e6ae31dca4af
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

a098a37a05-May-2022 Brad Bishop <bradleyb@fuzziesquirrel.com>

style: comply with OpenBMC style guidelines

Change-Id: I72f86c59a0502777c861de901907c0a556c4c6c5
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

f944a45005-May-2022 Brad Bishop <bradleyb@fuzziesquirrel.com>

naming: be inclusive

Adhere to the project inclusive naming guidelines and also adhere to the
OpenBMC style guidelines.

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5a365049

naming: be inclusive

Adhere to the project inclusive naming guidelines and also adhere to the
OpenBMC style guidelines.

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5a365049b6fb27236dd55c8455fe13a4a9e7fd31

show more ...

2352088e26-May-2022 Brad Bishop <bradleyb@fuzziesquirrel.com>

clang-format: update to OpenBMC latest

Ignore libmapper, because it is written in C and the CPP style
guidelines are not appropriate.

Ignore subprojects; they can validate their formatting themselv

clang-format: update to OpenBMC latest

Ignore libmapper, because it is written in C and the CPP style
guidelines are not appropriate.

Ignore subprojects; they can validate their formatting themselves.

Change-Id: Id88dcc49f4176c6443e7f53ca193ca8f3e83a51f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

show more ...

cbca32ec02-Aug-2021 Brad Bishop <bradleyb@fuzziesquirrel.com>

build: drop autotools support

Change-Id: Ic159830e2ccbc8934f23eb4eff7d15c83a7ffaf0
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

0aa1590708-May-2019 Brad Bishop <bradleyb@fuzziesquirrel.com>

build: Add meson support

Add support for buildling with meson.

Support for --enable-oe-sdk is dropped because running unit tests on the
build system is now supported directly with meson subprojects

build: Add meson support

Add support for buildling with meson.

Support for --enable-oe-sdk is dropped because running unit tests on the
build system is now supported directly with meson subprojects:

meson buildir && ninja -C buildir test

I tested this by building a witherspoon image and booting it to
multi-user and verifying the mapper-wait functionality works correctly.

Change-Id: I86e5efc7b7c89183219a4c890ad658e334765fc1
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

show more ...

efd5827503-Aug-2021 Brad Bishop <bradleyb@fuzziesquirrel.com>

tests: fix use-after-free

sdbusplus::asio::connection saves a reference to the io context passed
to its constructor so we need to increase its scope.

Change-Id: Ia1bf05871329a06ec39e6c0cef17e92c0d3

tests: fix use-after-free

sdbusplus::asio::connection saves a reference to the io context passed
to its constructor so we need to increase its scope.

Change-Id: Ia1bf05871329a06ec39e6c0cef17e92c0d37b138
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

show more ...

eecc196b10-Jun-2020 Andrew Geissler <geissonator@yahoo.com>

unit-test: ensure distinct dbus objects

sdbusplus recently added some code which ensures duplicate D-Bus objects
are not hosted under the same service. Modify the objects the unit tests
use to ensur

unit-test: ensure distinct dbus objects

sdbusplus recently added some code which ensures duplicate D-Bus objects
are not hosted under the same service. Modify the objects the unit tests
use to ensure they are distinct.

Without this change, three of the unit tests in associations were
failing.

Change-Id: If52dc90d63b92b0e5dbae55c9488fdaec27fad17
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>

show more ...

2bb2d6ba13-May-2020 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: replace message::variant with std::variant

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

12