bmc-toolbox / bmclib

Library to abstract Baseboard Management Controller interaction
Apache License 2.0
194 stars 37 forks source link

redfish: added support for adapters with multiple ports #309

Closed EugenioSiciliano closed 1 year ago

EugenioSiciliano commented 1 year ago

Reworked according to discussion in https://github.com/bmc-toolbox/bmclib/pull/308.

What does this PR implement/change/remove?

Multiple ports in the same network adapter are now inventoried as different NICPorts under the same NIC. Added some network port fields. Fixed network speed conversion. Added unit tests for network port and ethernet interface processing.

Description for changelog/release notes

Added support for NICs with multiple ports.
Fixed network speed conversion.
codecov[bot] commented 1 year ago

Codecov Report

Base: 42.85% // Head: 43.73% // Increases project coverage by +0.88% :tada:

Coverage data is based on head (763d880) compared to base (bac6449). Patch coverage: 63.51% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #309 +/- ## ========================================== + Coverage 42.85% 43.73% +0.88% ========================================== Files 33 33 Lines 2597 2659 +62 ========================================== + Hits 1113 1163 +50 - Misses 1367 1378 +11 - Partials 117 118 +1 ``` | [Impacted Files](https://codecov.io/gh/bmc-toolbox/bmclib/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox) | Coverage Δ | | |---|---|---| | [providers/redfish/inventory\_collect.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-cHJvdmlkZXJzL3JlZGZpc2gvaW52ZW50b3J5X2NvbGxlY3QuZ28=) | `15.46% <63.51%> (+15.46%)` | :arrow_up: | | [providers/redfish/inventory.go](https://codecov.io/gh/bmc-toolbox/bmclib/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox#diff-cHJvdmlkZXJzL3JlZGZpc2gvaW52ZW50b3J5Lmdv) | `5.46% <0.00%> (+2.34%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bmc-toolbox)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.