From 3f19a51e5fcf369645585818b282a1c381b6d92c Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Mon, 7 Jan 2019 13:28:57 -0800 Subject: test: use mocked sdbus interface for sdbusplus Use mocked sdbus interface for sdbusplus such that it doesn't require talking to the real dbus interfaces. The warnings for the unexpected calls on the sdbus interface can be ignored in the cases for this test as returning 0 is the desired behavior. The warnings can be trivially handled by expecting the calls, or setting up "ON_CALL" statements. Change-Id: I8c72eaec957fb6a68eeaac982c1f45998487c35f Signed-off-by: Patrick Venture --- test/test_network_manager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_network_manager.cpp b/test/test_network_manager.cpp index ff0840e..f1cfa64 100644 --- a/test/test_network_manager.cpp +++ b/test/test_network_manager.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -26,11 +26,12 @@ namespace fs = std::experimental::filesystem; class TestNetworkManager : public testing::Test { public: + sdbusplus::SdBusMock sdbus_mock; sdbusplus::bus::bus bus; Manager manager; std::string confDir; TestNetworkManager() : - bus(sdbusplus::bus::new_default()), + bus(sdbusplus::get_mocked_new(&sdbus_mock)), manager(bus, "/xyz/openbmc_test/abc", "/tmp") { setConfDir(); -- cgit v1.2.1