utils: Add function to check if PSU is associated

Add a helper function to check if a PSU is in an association list, which
will be used in future commits to check if a PSU is running a software
image.

Tested: added unit test case and verify it passes.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I99b5d3d8d09f8e09a1eb42ba104a4804b7214cf1
4 files changed
tree: 4bf605238e8c3398dc872a09941bcc7a342fcc26
  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