History log of /openbmc/sdbusplus/test/ (Results 51 – 75 of 178)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
1a25a10d29-Sep-2022 Patrick Williams <patrick@stwcx.xyz>

clang-format: update whitespace penalty

clang-format-15 seems to end up with a slightly different whitespace
break than clang-format-14 did. Tweak the PenaltyBreakAssignment
to favor not breaking a

clang-format: update whitespace penalty

clang-format-15 seems to end up with a slightly different whitespace
break than clang-format-14 did. Tweak the PenaltyBreakAssignment
to favor not breaking as often, which allows the two to be more
consistent.

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

show more ...

ce8d16d907-Sep-2022 Willam A. Kennington III <wak@google.com>

treewide: Leverage sdbus++-gen-meson

This makes us more consistent with other projects instead of writing
meson builds for sdbus++ by hand.

Change-Id: I38b69bc67b6a3d80cda1b508a76e106a50d8ab93
Sign

treewide: Leverage sdbus++-gen-meson

This makes us more consistent with other projects instead of writing
meson builds for sdbus++ by hand.

Change-Id: I38b69bc67b6a3d80cda1b508a76e106a50d8ab93
Signed-off-by: Willam A. Kennington III <wak@google.com>

show more ...

293c8a2602-Sep-2022 William A. Kennington III <wak@google.com>

sdbus++: Fix meson dependency generation

All of the generated meson files optionally look for sdbus++ sources
that can be plumbed in to allow changes to the generator code to
correctly trigger rebui

sdbus++: Fix meson dependency generation

All of the generated meson files optionally look for sdbus++ sources
that can be plumbed in to allow changes to the generator code to
correctly trigger rebuilds.

This will require adding a new variable prior to generated sources,
`sdbusplusplus_depfiles`. You can convert previous meson defitions with
the follwing.

```
sdbusplus_dep = dependency('sdbusplus')
sdbusplusplus_prog = find_program('sdbus++', native: true)
sdbuspp_gen_meson_prog = find_program('sdbus++-gen-meson', native: true)
sdbusplusplus_depfiles = files()
if sdbusplus_dep.type_name() == 'internal'
sdbusplusplus_depfiles = subproject('sdbusplus').get_variable('sdbusplusplus_depfiles')
endif
```

Change-Id: Ic2d5bafdbdd2595be8c44e0e616e590143639f21
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...

a970d83608-Sep-2022 Patrick Williams <patrick@stwcx.xyz>

test: unpack_properties: add constructor hint

scan-build-14 with GCC-12 seems to be failing with the following
warning:
```
../../../test/unpack_properties.cpp:34:23: error: no matching member funct

test: unpack_properties: add constructor hint

scan-build-14 with GCC-12 seems to be failing with the following
warning:
```
../../../test/unpack_properties.cpp:34:23: error: no matching member function for call to 'emplace'
error.emplace(reason, property);
```

Add a constructor to provide a hint and make scan-build happier.

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

show more ...

9cde21ff29-Aug-2022 Patrick Williams <patrick@stwcx.xyz>

message: add unpack method

Add an unpack method that allows reading from the message as
r-values. This simplifies the pattern:

```
foo f{};
bar b{};
msg.read(f,b);

// Can now be w

message: add unpack method

Add an unpack method that allows reading from the message as
r-values. This simplifies the pattern:

```
foo f{};
bar b{};
msg.read(f,b);

// Can now be written as...

auto [f, b] = msg.unpack<foo, bar>();
```

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

show more ...

f289c65f26-Aug-2022 Patrick Williams <patrick@stwcx.xyz>

clang-format: update with latest

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

c8447d5205-Jan-2022 Krzysztof Grobelny <krzysztof.grobelny@intel.com>

added support for optionals in unpackProperties

- Added support for optionals
- Added support for pointers
- Removed support for moving data from input container
- Removed support for container type

added support for optionals in unpackProperties

- Added support for optionals
- Added support for pointers
- Removed support for moving data from input container
- Removed support for container types other than std::vector

Tested:
- Unit tests are passing
- Examples which use unpackProperties are working correctly

Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I3dbd7333237a1373d784187951ad6abe217567d1

show more ...

b7329a9028-Apr-2022 Patrick Williams <patrick@stwcx.xyz>

message: append: support span

Change how we detect the ability to iterate over a type so that
it supports additional types, such as span. Add test case to cover
span. Add some static_asserts in th

message: append: support span

Change how we detect the ability to iterate over a type so that
it supports additional types, such as span. Add test case to cover
span. Add some static_asserts in the test cases to ensure we are
triggering the correct add_multiple/add_single paths for a few
assorted types.

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

show more ...

ba5460db30-Mar-2022 Patrick Williams <patrick@stwcx.xyz>

server: object: default emit destruct signals

In the mailing list discussion [1] it was observed that there were cases
where daemons like `phosphor-logging` do not end up emitting
InterfacesRemoved

server: object: default emit destruct signals

In the mailing list discussion [1] it was observed that there were cases
where daemons like `phosphor-logging` do not end up emitting
InterfacesRemoved signals even when the holding sdbusplus::object_t was
destructed.

After investigation, we determined that there are valid use cases for not
calling `object->emit_added()` but still wanting the removal signals to be
emitted. Specifically, the case of a daemon creating initial object prior
to claiming a bus-name it is good to omit the emission.

I examined all cases where callers were using `action::defer_emit` and
it was acceptable for all of them to later send the InterfacesRemoved
signals on destruction. To enable the old behavior, if desired, I added
a new enumeration which is `action::emit_no_signals`.

1. https://lore.kernel.org/openbmc/CAGm54UHMED4Np0MThLfp4H-i8R24o8pCns2-6MEzy1Me-9XJmA@mail.gmail.com/

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

show more ...

9f11c97914-Mar-2022 Patrick Williams <patrick@stwcx.xyz>

format: copy configs from phosphor-dbus-interfaces and reformat

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

e944507f12-Mar-2022 Patrick Williams <patrick@stwcx.xyz>

yaml: format with prettier

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

5770f51a10-Jan-2022 Paul Fertser <fercerpav@gmail.com>

utility: add merge_variants_t

This type is useful for processing D-Bus messages containing information
for multiple interfaces. For doing sdbusplus::message::message::read()
on them one needs to def

utility: add merge_variants_t

This type is useful for processing D-Bus messages containing information
for multiple interfaces. For doing sdbusplus::message::message::read()
on them one needs to define an std::variant which would be a combination
of all the PropertiesVariant's involved.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Change-Id: Idcb7b9841cc0253f2f7d5552dae540fba5ad488d

show more ...

4a46eb5a23-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

object: handle diamond inheritance

Commit 664922157bbbd14f0ad1692cee5547f60f6c617c added an inheritance
to `server::object` to gain access to the bus-pointer. This was
observed to cause a compile f

object: handle diamond inheritance

Commit 664922157bbbd14f0ad1692cee5547f60f6c617c added an inheritance
to `server::object` to gain access to the bus-pointer. This was
observed to cause a compile failure in some applications which had a
diamond-inheritance structure due to a nested `object` inheritance:

`object<object<iface0, iface1>, object<iface2, iface3>>`

These clients probably should not have attempted a nested/diamond
because the previous implementation would have resulted in a silent
failure to make `action::emit_interface_added` work properly (since
object itself doesn't have an `emit_added` function).

Improve the `object` so that:
- Diamond inheritance is no longer possible with nested inherits.
- The `action::emit_interface_added` action works properly with
nested inherits.

This required adding some template specialization to determine if one of
the type arguments to `object` were nested (ie.
`object<Args0..., object<Args1...>, Args2...>`) and collapse out the
nested `object` inheritance (so that the example acts exactly the same
as `object<Args0..., Args1..., Args2...>`).

Tested: Enhance the existing `object::emit` test cases to operate on a
nested `object` structure.

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

show more ...

a735ca5c19-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

vtable: shorten vtable type

Create an alias `sdbusplus::vtable_t` to `sdbusplus::vtable::vtable_t`
to reduce duplication.

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

vtable: shorten vtable type

Create an alias `sdbusplus::vtable_t` to `sdbusplus::vtable::vtable_t`
to reduce duplication.

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

show more ...

ba33c2a219-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

manager,interface: use shortened types

Use the shortened alias types whenever possible for `manager` and
`interface`.

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

manager,interface: use shortened types

Use the shortened alias types whenever possible for `manager` and
`interface`.

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

show more ...

0f282c4819-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

bus: shorten bus type

Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce
duplication.

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

bus: shorten bus type

Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce
duplication.

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

show more ...

10d7aa1219-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

message: shorten message type

Create an alias `sdbusplus::message_t` to `sdbusplus::message::message`
to reduce duplication.

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

message: shorten message type

Create an alias `sdbusplus::message_t` to `sdbusplus::message::message`
to reduce duplication.

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

show more ...

6d83cf5319-Oct-2021 Szymon Dompke <szymon.dompke@intel.com>

Add non-throwing version of unpackProperties

Some projects (e.g., bmcweb) don't use functions which throw exceptions.
This change introduces unpackPropertiesNoThrow() function, which returns
optiona

Add non-throwing version of unpackProperties

Some projects (e.g., bmcweb) don't use functions which throw exceptions.
This change introduces unpackPropertiesNoThrow() function, which returns
optional string. In case of mismatched type or missing property, it will
contain its name. In case of no errors, std::nullopt will be returned.

As a side change, message returned by UnpackPropertyError::what() now
also includes propertyName and reason.

Testing done:
- Added unit tests for unpackPropertiesNoThrow().
- unpackProperties() functionality remained the same.

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I61318bb906de7d5a252414c1d3ea25322874e23e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

a22dbf4016-Jul-2021 Patrick Williams <patrick@stwcx.xyz>

message: correctly unpack variants of enums

When a variant contains multiple types which can be converted
from a string (such as two enums, or an enum and string), the
previous code tried a conversi

message: correctly unpack variants of enums

When a variant contains multiple types which can be converted
from a string (such as two enums, or an enum and string), the
previous code tried a conversion from the first type in the
variant. When the first type was an enum, this often threw an
exception. When the first type was a string, this turned into
a plain string containing the dbus enum value.

Add special cases to the variant unpacking to detect types
which are convertible from strings and delegate to a template
specialization of 'convert_from_string' which handles variants.
This specialization will attempt all conversions first and then
revert to a string as a fallback.

Fixes openbmc/sdbusplus#52.

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

show more ...

87b6a8d315-Jul-2021 Patrick Williams <patrick@stwcx.xyz>

message: template to check if convert_from_string exists

Add a SFINAE template to determine if convert_from_string
exists for a type.

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

message: template to check if convert_from_string exists

Add a SFINAE template to determine if convert_from_string
exists for a type.

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

show more ...

ea56ec3c14-Jul-2021 Patrick Williams <patrick@stwcx.xyz>

test: add tests for enum parsing

Add test cases to cover the parsing of enums from generated
bindings, including two DISABLED test cases to show the issues
reported in openbmc/sdbusplus#52.

Signed-

test: add tests for enum parsing

Add test cases to cover the parsing of enums from generated
bindings, including two DISABLED test cases to show the issues
reported in openbmc/sdbusplus#52.

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

show more ...

64f0122614-Jul-2021 Patrick Williams <patrick@stwcx.xyz>

use C++17 std::foo_v templates

Use the C++17 style `foo_v` template aliases rather than
the older `foo<...>::value` style.

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

use C++17 std::foo_v templates

Use the C++17 style `foo_v` template aliases rather than
the older `foo<...>::value` style.

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

show more ...

34cf693214-Jul-2021 Patrick Williams <patrick@stwcx.xyz>

utility: dedup_variant: rename in C++14 '_t' style

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

8db46a0f05-May-2021 William A. Kennington III <wak@google.com>

native_types: string_path_wrapper: Don't escape all strings

Not all strings require escaping when appending them to a path. This
allows us to now append `openbmc_project` to `/xyz` and have
expected

native_types: string_path_wrapper: Don't escape all strings

Not all strings require escaping when appending them to a path. This
allows us to now append `openbmc_project` to `/xyz` and have
expected behavior.

Change-Id: I49a2ee100455cff4067dcf3df61f3e145231eeba
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...

285f78b101-May-2021 William A. Kennington III <wak@google.com>

native_types: Reduce append allocation

This builds the string from left to right, instead of dealing with
string inserts, optimizing for allocations. Uses our own hex encoder
instead of relying on s

native_types: Reduce append allocation

This builds the string from left to right, instead of dealing with
string inserts, optimizing for allocations. Uses our own hex encoder
instead of relying on systemd libraries. This maintains explicit
compatability with the systemd encoding scheme.

Change-Id: Ia6c2f4fb19984f549c6bac2d67d0b5d610022038
Signed-off-by: William A. Kennington III <wak@google.com>

show more ...

12345678