chassishandler: Interpret intrusion sensor values

Chassis Intrusion Sensor value on D-Bus was updated with new format that
adapts PDI enum definition [1]. This patch modifies how the value from
D-Bus be interpreted to adapt with the change from D-Bus. This commit
uses GetSubTree to look for all object paths that implement the
Chassis Intrusion interface, instead of using hardcoded path.
phosphor-dbus-interfaces class is used to ensure consistency.

When more than one path is returned from GetSubTree. If all the Status
values are Normal, the final result is inactive. If one of the Status
value is not Normal, the final result is active. If no Status value can
be read from D-Bus, the final result is inactive.

[1]: https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Chassis/Intrusion.interface.yaml#L30

Tested:
If value on D-Bus is:
"xyz.openbmc_project.Chassis.Intrusion.Status.Normal"
$ ipmitool chassis status | grep -i intrusion
Chassis Intrusion: inactive

Otherwise, Chassis Intrusion: active

Signed-off-by: Chau Ly <chaul@amperecomputing.com>
Change-Id: I3bf7d6c8db9d8537cde10a8e8b20d325b86a9c73
1 file changed
tree: f8fd81b6e04640d28bcd5114a50bff214860a5e7
  1. app/
  2. dbus-sdr/
  3. docs/
  4. include/
  5. libipmid/
  6. scripts/
  7. softoff/
  8. subprojects/
  9. test/
  10. transport/
  11. user_channel/
  12. xyz/
  13. .build.sh
  14. .clang-format
  15. .gitignore
  16. .shellcheck
  17. .travis.yml
  18. apphandler.cpp
  19. apphandler.hpp
  20. chassishandler.cpp
  21. chassishandler.hpp
  22. dcmihandler.cpp
  23. dcmihandler.hpp
  24. error-HostEvent.hpp
  25. fruread.hpp
  26. generate_whitelist.sh
  27. generate_whitelist_create.sh
  28. globalhandler.cpp
  29. groupext.cpp
  30. host-cmd-manager.cpp
  31. host-cmd-manager.hpp
  32. host-interface.cpp
  33. host-interface.hpp
  34. host-ipmid-whitelist.conf
  35. ipmi_fru_info_area.cpp
  36. ipmi_fru_info_area.hpp
  37. ipmiallowlist.hpp
  38. ipmid-new.cpp
  39. ipmisensor.cpp
  40. LICENSE
  41. meson.build
  42. meson.options
  43. OWNERS
  44. read_fru_data.cpp
  45. read_fru_data.hpp
  46. README.md
  47. selutility.cpp
  48. selutility.hpp
  49. sensordatahandler.cpp
  50. sensordatahandler.hpp
  51. sensorhandler.cpp
  52. sensorhandler.hpp
  53. settings.cpp
  54. settings.hpp
  55. storageaddsel.cpp
  56. storageaddsel.hpp
  57. storagehandler.cpp
  58. sys_info_param.cpp
  59. sys_info_param.hpp
  60. systemintfcmds.cpp
  61. systemintfcmds.hpp
  62. transportconstants.hpp
  63. transporthandler.cpp
  64. transporthandler.hpp
  65. whitelist-filter.cpp
README.md

phosphor-host-ipmid

Compile ipmid with default options

meson builddir
ninja -C builddir

Compile ipmid with yocto defaults

meson builddir -Dbuildtype=minsize -Db_lto=true -Dtests=disabled
ninja -C builddir

If any of the dependencies are not found on the host system during configuration, meson automatically gets them via its wrap dependencies mentioned in ipmid/subprojects.

Enable/Disable meson wrap feature

meson builddir -Dwrap_mode=nofallback
ninja -C builddir

Enable debug traces

meson builddir -Dbuildtype=debug
ninja -C builddir

Generate test coverage report

meson builddir -Db_coverage=true -Dtests=enabled
ninja -C builddir test
ninja -C builddir coverage