b7077437 | 16-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: Id49ad73c860533f4658c909e86d6dc8e1423efb4 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
b02752f7 | 30-Nov-2023 |
Jeff Lin <JeffLin2@quantatw.com> |
topology: Add powered_by topology
bmcweb already support the power supply command, refer to https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57668
Use "PowerPort" to add the powered_by association for
topology: Add powered_by topology
bmcweb already support the power supply command, refer to https://gerrit.openbmc.org/c/openbmc/bmcweb/+/57668
Use "PowerPort" to add the powered_by association for upstream port, so that the PowerSupplyCollection in redfish can get the power supply information.
Tested: Add the following config in mobo.json: ``` { "Name": "Mobo Upstream Port", "Type": "Mobo Upstream Port" }, ``` Add the following config in PSU.json: ``` { "ConnectsToType": "Mobo Upstream Port", "Name": "PSU $BUS Downstream Port", "Type": "DownstreamPort", "PowerPort": true }, ``` Result for association: ``` { "type" : "as", "data" : [ [ "/xyz/openbmc_project/inventory/system/board/PSU_1" ] ] } ``` Result in bmcweb: ``` $ curl -s -k -H "X-Auth-Token: $token" http://${bmc}/redfish/v1/Chassis/Mobo | jq .Links.Contains [ { "@odata.id": "/redfish/v1/Chassis/PSU_1" } ] $ curl -k -H "X-Auth-Token: $token" http://${bmc}/redfish/v1/Chassis/Mobo/PowerSubsystem/PowerSupplies/PSU_1 { "@odata.id": "/redfish/v1/Chassis/Mobo/PowerSubsystem/PowerSupplies/PSU_1", "@odata.type": "#PowerSupply.v1_5_0.PowerSupply", ... } ```
Run unitest for test_topology is PASSED.
Change-Id: Iad10e61417437a41628cf311cdd7893725a5dcde Signed-off-by: Jeff Lin <JeffLin2@quantatw.com>
show more ...
|
1c39d7b8 | 21-Sep-2023 |
Patrick Rudolph <patrick.rudolph@9elements.com> |
test: Add test for string matching
Add test for regex (?!) to not match a specific sequence. This is useful to exclude specific matches while using wildcard patterns.
Change-Id: I54aec4b5a956af0e81
test: Add test for string matching
Add test for regex (?!) to not match a specific sequence. This is useful to exclude specific matches while using wildcard patterns.
Change-Id: I54aec4b5a956af0e815b7a57c715f4f58af8a4e6 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
show more ...
|
6eb60972 | 14-Aug-2023 |
Matt Spinler <spinler@us.ibm.com> |
phys-topology: Add late add/remove support
The current physical topology code doesn't yet support adding entities late (in a different propertiesChangedCallback call) or removing an entity because:
phys-topology: Add late add/remove support
The current physical topology code doesn't yet support adding entities late (in a different propertiesChangedCallback call) or removing an entity because: - The Topology class is just scoped to postToDbus(), so when that is called again later with new cards it has no concept of existing parent cards so it will miss creating associations.
- There is nothing to tell the class when an entity is removed, so it never attempts to remove the association for that entity.
- When the containing/contained_by association is created it doesn't use the createInterface() function, so if that entity is removed later that association interface will be left on D-Bus.
To add support for entity adds and removes, this commit will: - Make the Topology class have a global scoped lifetime so it can remember entity relationships.
- Now that Topology will outlive postToDbus() calls, pass the getAssocs() method the list of boards being processed in the current postToDbus() incantation so it will only return the new associations.
- Use the createInterface() method when creating the association. This stores the interface in a map with the entity name so that when the entity is removed the interface will be removed along with all the other interfaces.
- When an entity is removed, only the board name is known. So pass the board name into addBoard() so the Topology class knows it, and add a Topology::remove() method and call it so it can remove the removed path from all of the connector maps.
Tested: - All of the containing/contained_by associations still show up on good path.
- Added new unit tests to cover the new functionality.
- When a downstream entity is added after EM does its initial D-Bus publish, the containing/contained_by association is now created.
- On an entity remove, there are no left over interfaces for the removed entity on D-Bus.
- When the removed entity is added back, the association is put back in place.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ie5daaca92c6d2e6e7abc408f3e67e948977581ef
show more ...
|
f2f5b7ac | 09-Sep-2022 |
Benjamin Fair <benjaminfair@google.com> |
topology: add initial module
To use this module, add information about boards and their exposes records and then request a map of what resulting associations should be exposed on D-Bus.
Tested: Uni
topology: add initial module
To use this module, add information about boards and their exposes records and then request a map of what resulting associations should be exposed on D-Bus.
Tested: Unit tests pass
Signed-off-by: Benjamin Fair <benjaminfair@google.com> Change-Id: I42cd79407ab476599f5010c11cc146a569694b24
show more ...
|
3013fb49 | 09-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Make clang-tidy changes
clang-tidy has a number of checks it recommends. These checks are documented in the next commit, but make the code pass our coding standard.
Tested: Minor changes made by t
Make clang-tidy changes
clang-tidy has a number of checks it recommends. These checks are documented in the next commit, but make the code pass our coding standard.
Tested: Minor changes made by the robot.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I6cfaab92211af9c4c1eccd981ba9fe7b8c523457
show more ...
|
309c0b13 | 24-Feb-2022 |
Zev Weiss <zev@bewilderbeest.net> |
fru-device: add FRUReader EEPROM cache
This doesn't provide a huge benefit currently, but is a preparatory step for adding support for a wider variety of FRU format parsers. If parsers for multiple
fru-device: add FRUReader EEPROM cache
This doesn't provide a huge benefit currently, but is a preparatory step for adding support for a wider variety of FRU format parsers. If parsers for multiple formats are interested in reading the same areas of an EEPROM, the caching provided by this abstraction avoids the redundant bus traffic of all of them re-reading the same bytes over and over.
Tested: on an ASRock Rack romed8hm3, fru-device successfully recognizes and parses the baseboard FRU EEPROM as it did prior to this patch.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I0d774508bc29dbda346309fe7fe42dbdf97bee43
show more ...
|
e45d8c71 | 25-May-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
treewide: comply with the OpenBMC style guidelines
The guidelines say cpp source code filenames should be lower_snake_case: https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#f
treewide: comply with the OpenBMC style guidelines
The guidelines say cpp source code filenames should be lower_snake_case: https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#files
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ia04017b0eb9a65ce1303af5b6dc36e730410fd91
show more ...
|
1525e859 | 22-Mar-2022 |
Zev Weiss <zev@bewilderbeest.net> |
fru-device: use off_t/size_t for FRU IO offsets & lengths
While the 8-bit and 16-bit types that had been used for these were adequate for the small devices typically used for most FRU EEPROMs, some
fru-device: use off_t/size_t for FRU IO offsets & lengths
While the 8-bit and 16-bit types that had been used for these were adequate for the small devices typically used for most FRU EEPROMs, some do get within striking distance of the limits of 16-bit types, and we might as well use the more "natural" types that are intended for these sorts of parameters, which avoid the risk of range problems and signal intent more clearly & explicitly.
Tested: on an ASRock Rack romed8hm3, fru-device successfully recognizes and parses the baseboard FRU EEPROM as it did prior to this patch.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net> Change-Id: I38251fec2857923356d324e01af77795186560eb
show more ...
|
1983d2f4 | 05-Apr-2022 |
Andrew Jeffery <andrew@aj.id.au> |
EntityManager: Make MapperGetSubTreeResponse type comprehensible
From there, rework a bunch of uses of the unaliased types to use the new aliased types and fix up some of the variable names to impro
EntityManager: Make MapperGetSubTreeResponse type comprehensible
From there, rework a bunch of uses of the unaliased types to use the new aliased types and fix up some of the variable names to improve readability.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I498e0d93091cae43e59907ee1908afc97ac601ee
show more ...
|
eab4929d | 05-Apr-2022 |
Andrew Jeffery <andrew@aj.id.au> |
EntityManager: Rename BasicVariantType to DBusValueVariant
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ifde3020ee286ee6b98951df4bad5c3bd8d0251d2 |
f8ae2ba5 | 24-Mar-2022 |
Andrew Jeffery <andrew@aj.id.au> |
FruUtils: Fix code formatting
format-code didn't include an invocation of clang-format, and as the in-repo format-code script overrides the default script in openbmc-build-scripts there was no code-
FruUtils: Fix code formatting
format-code didn't include an invocation of clang-format, and as the in-repo format-code script overrides the default script in openbmc-build-scripts there was no code-formatting being applied in CI.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I68bd7d2c930b752da4045412e7e286b303ac8ff6
show more ...
|
bd4075f7 | 05-Oct-2021 |
Oskar Senft <osk@google.com> |
FruUtils: Add support for finding FRU at an offset
This change adds findFRUHeader which can detect non-IPMI headers to identify the offset for IPMI FRU data. An implementation for "$TYAN$" has been
FruUtils: Add support for finding FRU at an offset
This change adds findFRUHeader which can detect non-IPMI headers to identify the offset for IPMI FRU data. An implementation for "$TYAN$" has been added. The new findFRUHeader is now used by readFRUContents to generically read IPMI FRU both at offset 0 and at a offset as determined by findFRUHeader.
Signed-off-by: Oskar Senft <osk@google.com> Change-Id: I4325aac7737db59aaa11359ad7a0d575957f16e7
show more ...
|
a0d1b3f8 | 05-Oct-2021 |
Zhikui Ren <zhikui.ren@intel.com> |
Utils: Fix more than one template replace
There is a bug in templateCharReplace function that only the first template gets replaced correctly and additional templates are left unchanged.
Add a new
Utils: Fix more than one template replace
There is a bug in templateCharReplace function that only the first template gets replaced correctly and additional templates are left unchanged.
Add a new test case twoReplacementsWithMath2 to show the issue. Difference with the existing passing test case is key string "ADDRESS" is less than "BAR". nlohmann::json j = {{"foo", "4 / 2 equals $ADDRESS / 2 $BAR"}}; data["ADDRESS"] = 4; data["BAR"] = std::string("bar");
With this change the new test case passes.
Tested: All unit tests passed.
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> Change-Id: I121ec8c0fcfce645f52518ed4429228549ff9371
show more ...
|
fbce8e22 | 02-Sep-2021 |
Ed Tanous <edtanous@google.com> |
clang-format with version clang-format-13
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I8bc6b9a83acbd26b9a306f63eb0ac90da8e44e33 |
8dacf6a8 | 02-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
test: fru-utils: Exercise the FRU checksum algorithm
Add some tests for basic cases and behaviour around the checksum roll-over.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia28fd625
test: fru-utils: Exercise the FRU checksum algorithm
Add some tests for basic cases and behaviour around the checksum roll-over.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ia28fd62559846e653e066dc8c3063a9d254191cf
show more ...
|
07d467bc | 23-Feb-2021 |
Ed Tanous <edtanous@google.com> |
Make build on clang
And support clang-tidy rules. The changes are pretty minimal, and were all done by the clang robot.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I29501aa56de1cd63c
Make build on clang
And support clang-tidy rules. The changes are pretty minimal, and were all done by the clang robot.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I29501aa56de1cd63cda233e06a07641458f89345
show more ...
|
7a682a3a | 12-Apr-2021 |
Vijay Khemka <vijaykhemkalinux@gmail.com> |
test: Add tests for validateHeader
Added unit tests for version/reserved bit, padding and checksum in validateHeader.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: Iacf4eead95
test: Add tests for validateHeader
Added unit tests for version/reserved bit, padding and checksum in validateHeader.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: Iacf4eead95cb55c9c50a1837d8e82b054767a2a0
show more ...
|
1694ef62 | 12-Feb-2021 |
Vijay Khemka <vijaykhemkalinux@gmail.com> |
test: Add tests for verifyOffset
Added unit tests for verifyOffset in fruUtil.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: I799acaef087676b3d50aa93c076a698226aaff61 |
a62466ce | 08-Feb-2021 |
Patrick Venture <venture@google.com> |
test: start frutils unit-tests
Add initial fruutils library unit-tests.
Signed-off-by: Patrick Venture <venture@google.com> Change-Id: Ie02c1a968500d010daea747f61e818a2d110363b |
b9f50cd5 | 14-Oct-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
meson: test: move tests up one dir
Move the test definition up one directory to work around meson bug https://github.com/mesonbuild/meson/issues/6747
Change-Id: I550992175bc83121404a0ad2cf9b9512245
meson: test: move tests up one dir
Move the test definition up one directory to work around meson bug https://github.com/mesonbuild/meson/issues/6747
Change-Id: I550992175bc83121404a0ad2cf9b951224520f06 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
cd1868e8 | 28-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: probe: add support for bytestrings
Add support for bytestrings, and associated unit tests.
Change-Id: I1307b886494784ee3cd510351626297c43c431d6 Signed-off-by: Brad Bishop <bradleyb@
entity-manager: probe: add support for bytestrings
Add support for bytestrings, and associated unit tests.
Change-Id: I1307b886494784ee3cd510351626297c43c431d6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
5d525413 | 26-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: probe: Refactor matching
In a nutshell, rely on nlohmann's comparison operator to make the match instead of rolling our own. A nice side effect is the expected match behavior is wel
entity-manager: probe: Refactor matching
In a nutshell, rely on nlohmann's comparison operator to make the match instead of rolling our own. A nice side effect is the expected match behavior is well documented by nlohmann.
Code size and performance are unaffected (after removing dead code): before: 25121752 bytes unstripped, 3202608 bytes stripped after: 25146552 bytes unstripped, 3202616 bytes stripped before: ~22 seconds for 5000 iterations of the tests after: ~22 seconds for 5000 iterations of the tests
This refactor reduces the number of lines of code we need to maintain and test and increases the number of lines of code used from the extensively tested nlohmann json library.
The refactor simplifies the logic down to: return probe == value; for non-string probes. A string specialization is still required so we can pattern match.
The refactor enables support for matching non-trivial json types such as arrays and objects. New types need only be added to BasicVariantType.
There are several changed testcase expectations introduced by the refactor. Each is discussed in detail below.
- stringRegexError - boolStringError -> boolNeqString - falseEmptyError -> falseNeqEmpty - trueEmptyError -> trueNeqEmpty - uintStringError -> uintNeqString - uintEmptyError -> unitNeqEmpty - intStringError -> intNeqString - intEmptyError -> intNeqEmpty - doubleStringError -> doubleNeqString - doubleEmptyError -> doubleNeqEmpty Configuration file validation of regular expression syntax or the correct json type for a given dbus interface and property is better done by our offline validation tools. Avoid runtime complexity attempting to distinguish between user errors and probe statements that simply do not match by treating them the same and always return "no-match" instead of an invalid argument error for user error situations. stringRegexError could be an exception - there is no additional runtime complexity overhead associated with flagging it as a user error, but doing so would result in inconsistent behavior, so return no-match for it as well.
- stringZeroEqFalse -> stringZeroNeqFalse - stringOneEqTrue -> stringOneNeqTrue - stringEqUnit8 -> stringNeqUint8 - stringEqUint32 -> stringNeqUint32 - stringEqInt32 -> stringNeqInt32 - stringRegexEqInt32 -> stringRegexNeqInt32 - stringEqDouble -> stringNeqDouble Prior to this patch dbus properties are converted to strings in the event of a string probe. This works around mistakes in configuration files where the wrong json type is used but it can provide unexpected results like the probe "1" matching a true and the probe "11" matching a false, and the string "1*2" matching the number 112. Implementing the expected behavior is possible but would add complexity. For these reasons this refactor drops the string conversion and requires the user to use the correct types in their configurations.
- falseEqUint32Zero -> falseNeqUint32Zero - trueEqUint32Zero -> falseNeqUint32Zero - trueEqDoubleOne -> trueNeqDoubleOne - falseEqDoubleZero -> falseNeqDoubleZero - uintEqTrue -> uintNeqTrue - uintEqFalse -> uintNeqFalse - unitEqDoubleRound -> uintNeqDouble Prior to this patch dbus properties are coerced to unsigned integers in the event of a boolean or unsigned integer probes. Like in the previous section this can have unexpected results such as integral json types matching floats with fractional components from dbus. Again, implementing the expected behavior is possible but would add coomplexity, and again these conversions are abandoned and instead require the user to use the correct types in their configurations.
- intEqDoubleRound -> intNeqDoubleRoound - doubleEqFalse -> doubleNeqFalse - doubleEqTrue -> doubleNeqTrue Like the previous two sections, dbus properties are coerced to integers in the event of an integer probe, and dbus properties are coerced to doubles in the event of a double probe, and can result in unexpected behavior. Require the user to use the correct types in their configurations.
Change-Id: I6ce7a9c4a80d9612b15cd5e7bb4647bd96852e48 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
c776c414 | 28-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: probe: add probe logic tests
Add unit tests for matchProbe with json null.
Change-Id: I00314b68a587ec9b6bef052fa7ba5a877ce36a15 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.c
entity-manager: probe: add probe logic tests
Add unit tests for matchProbe with json null.
Change-Id: I00314b68a587ec9b6bef052fa7ba5a877ce36a15 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
6660e2a2 | 28-Aug-2020 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
entity-manager: probe: add probe logic tests
Add unit tests for matchProbe with json objects.
Change-Id: Ica33fb959d5680e86f3488510e0b841a7430fe2b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirre
entity-manager: probe: add probe logic tests
Add unit tests for matchProbe with json objects.
Change-Id: Ica33fb959d5680e86f3488510e0b841a7430fe2b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|