Get PSU version from vendor specific tool

The code was getting the version from PSU inventory object.
This commit changes the behavior to use a vendor-specific tool to get
the version directly, where the tool is expected to be configured during
build time.

Add an example get_version app that shows the expected behavior of the
tool:
* It accepts an argument of PSU inventory object;
* It outputs the version to stdout.

Tested: 1. Put and configure to use the example get_version on witherspoon,
        verify that PSU software objects are created with the version
        returned by the exmaple tool.
        2. With the Witherspoon specific tool in
        https://gerrit.openbmc-project.xyz/c/openbmc/witherspoon-pfault-analysis/+/24811,
        verify the version is correctly got from the PSU inventory path
        and the software objects are created.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I5195cb6fc8998a76b09abcfe0b107364cb180c01
9 files changed
tree: b27f2034b7467940951b962aa018d6be75e96537
  1. service/
  2. src/
  3. test/
  4. vendor-example/
  5. .clang-format
  6. .gitignore
  7. LICENSE
  8. MAINTAINERS
  9. meson.build
  10. meson_options.txt
  11. README.md
README.md

phosphor-psu-code-mgmt

phosphor-psu-code-mgmt is a service to provide management for PSU code, including:

  • PSU code version
  • PSU code update

Building

meson build/ && ninja -C build

Unit test

  • Run it in OpenBMC CI, refer to local-ci-build.md
  • Run it in OE SDK, run below commands in a x86-64 SDK env:
    meson -Doe-sdk=enabled -Dtests=enabled build/
    ninja -C build/ test  # Meson skips running the case due to it thinks it's cross compiling
    # Manually run the tests
    for t in `find build/test/ -maxdepth 1 -name "test_*"`; do ./$t || break ; done