Remove add_object_vtable expect from fanpwm UT

For some reason, having an expect on the sdbusplus mock
sd_bus_add_object_vtable causes valgrind to fail in CI with errors such
as:

```
==729843== Conditional jump or move depends on uninitialized value(s)
==729843==    at 0x5CB89AB: std::unique_ptr<sd_bus_slot, sdbusplus::slot::details::SlotDeleter>::~unique_ptr() (unique_ptr.h:403)
==729843==    by 0x5CB8665: sdbusplus::slot::slot::~slot() (slot.hpp:43)
==729843==    by 0x5CC3CC9: sdbusplus::server::interface::interface::~interface() (interface.cpp:38)
==729843==    by 0x13189B: sdbusplus::server::xyz::openbmc_project::control::FanPwm::~FanPwm() (server.hpp:32)
==729843==    by 0x13E267: sdbusplus::server::object::details::compose<sdbusplus::server::xyz::openbmc_project::control::FanPwm>::~compose() (object.hpp:181)
==729843==    by 0x13E4BC: sdbusplus::server::object::object<sdbusplus::server::xyz::openbmc_project::control::FanPwm>::~object() (object.hpp:95)
==729843==    by 0x13C5C9: hwmon::FanPwm::~FanPwm() (fan_pwm.hpp:18)
==729843==    by 0x12C0D1: FanPwmTest_BasicConstructorDeferredTest_Test::TestBody() (fanpwm_unittest.cpp:76)
==729843==    by 0x5E089FC: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2638)
==729843==    by 0x5DFE67A: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2674)
==729843==    by 0x5DD3BA3: testing::Test::Run() (gtest.cc:2713)
==729843==    by 0x5DD4661: testing::TestInfo::Run() (gtest.cc:2859)
```

There are 4 more stanzas of similar 'Conditional jump or move...'
errors.  None of these show up without the vtable expect.

Other repositories that use this same expect also fail.

I opened sdbusplus issue openbmc/sdbusplus#97 for the problem.  I spent
time looking into it, and did not figure anything out.

This commit just removes the call to it because in these testcases the
FanPwm object, which is just derived from the sdbuplus interface object,
is simply created on the stack:

```
hwmon::FanPwm f(...);
```

The unit tests aren't actually testing any code that conditionally
creates a FanPwm interface on D-Bus, so checking that it happens isn't
that useful and seems to more just be testing sdbusplus.

Change-Id: Idf2df085bf909af1ad94ba06863c4605831a3824
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
1 file changed
tree: f2b019dfccede0402944c360ae20b89762c1511b
  1. msl/
  2. subprojects/
  3. test/
  4. tools/
  5. .clang-format
  6. .gitignore
  7. .lcovrc
  8. .shellcheck
  9. 70-hwmon.rules
  10. 70-iio.rules
  11. average.cpp
  12. average.hpp
  13. env.cpp
  14. env.hpp
  15. fan_pwm.cpp
  16. fan_pwm.hpp
  17. fan_speed.cpp
  18. fan_speed.hpp
  19. gpio_handle.cpp
  20. gpio_handle.hpp
  21. hwmon.cpp
  22. hwmon.hpp
  23. hwmonio.cpp
  24. hwmonio.hpp
  25. interface.hpp
  26. LICENSE
  27. mainloop.cpp
  28. mainloop.hpp
  29. meson.build
  30. meson.options
  31. OWNERS
  32. phosphor-hwmon.conf
  33. readd.cpp
  34. README.iio.md
  35. README.md
  36. sensor.cpp
  37. sensor.hpp
  38. sensorset.cpp
  39. sensorset.hpp
  40. start_hwmon.sh.in
  41. sysfs.cpp
  42. sysfs.hpp
  43. targets.hpp
  44. thresholds.hpp
  45. types.hpp
  46. util.hpp
  47. xyz.openbmc_project.Hwmon@.service
README.md

phosphor-hwmon

Exposes generic hwmon entries as DBus objects. More information can be found at Sensor Architecture

To Build

To build this package, do the following steps:

  1. meson setup build
  2. ninja -C build

To clean the repository run rm -rf build.

D-Bus bus names

To enable the use of Linux features like cgroups prioritization and udev/systemd control, one instance of phosphor-hwmon is intended to be run per hwmon sysfs class instance.

This requires an algorithm for selecting a stable, well-known D-Bus busname.

The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is a meson configurable prefix (BUSNAME_PREFIX=xyz.openbmc_project by default), ID is either a std::hash of the /sys/devices path backing the hwmon class instance or provided suffix value from the command line, and N is the implemented phosphor-hwmon D-Bus API version.