summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJames Feist <james.feist@linux.intel.com>2019-06-03 16:24:53 -0700
committerJames Feist <james.feist@linux.intel.com>2019-06-05 17:21:16 +0000
commit98b704e179f12d987179fe6b0ea6234d1bace48f (patch)
tree860597ad14a89ed655fd0f46c2a7360f4a4805fe /test
parent926411e10deeaff6e44b71ff4b80fa26e086965f (diff)
downloadphosphor-pid-control-98b704e179f12d987179fe6b0ea6234d1bace48f.tar.gz
phosphor-pid-control-98b704e179f12d987179fe6b0ea6234d1bace48f.zip
Add Fan Redundancy Support
This adds fan redundancy support to passive sensors. If there are redundancy interfaces on dbus, we'll fail a sensor if the status is set to failed. Tested: Set Redundancy to Failed On Dbus, saw all fans in collection boost. Then restarted swampd, came up and still boosted. Set redundancy OK, and they all slowed down. Change-Id: I8879bef1471bbc168435d6b22dd20006b9dca133 Signed-off-by: James Feist <james.feist@linux.intel.com>
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am2
-rw-r--r--test/dbus_passive_unittest.cpp9
2 files changed, 6 insertions, 5 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index fbc78bf..3d74c88 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -63,7 +63,7 @@ pid_fancontroller_unittest_LDADD = $(top_builddir)/pid/ec/pid.o \
dbus_passive_unittest_SOURCES = dbus_passive_unittest.cpp
dbus_passive_unittest_LDADD = $(top_builddir)/dbus/util.o \
- $(top_builddir)/dbus/dbuspassive.o
+ $(top_builddir)/dbus/dbuspassive.o $(top_builddir)/dbus/dbuspassiveredundancy.o
dbus_active_unittest_SOURCES = dbus_active_unittest.cpp
dbus_active_unittest_LDADD = $(top_builddir)/dbus/dbusactiveread.o
diff --git a/test/dbus_passive_unittest.cpp b/test/dbus_passive_unittest.cpp
index 2fc3471..84557ee 100644
--- a/test/dbus_passive_unittest.cpp
+++ b/test/dbus_passive_unittest.cpp
@@ -31,8 +31,8 @@ TEST(DbusPassiveTest, FactoryFailsWithInvalidType)
DbusHelperMock helper;
auto info = conf::SensorConfig();
- std::unique_ptr<ReadInterface> ri =
- DbusPassive::createDbusPassive(bus_mock, type, id, &helper, &info);
+ std::unique_ptr<ReadInterface> ri = DbusPassive::createDbusPassive(
+ bus_mock, type, id, &helper, &info, nullptr);
EXPECT_EQ(ri, nullptr);
}
@@ -50,7 +50,7 @@ TEST(DbusPassiveTest, BoringConstructorTest)
DbusHelperMock helper;
struct SensorProperties properties;
- DbusPassive(bus_mock, type, id, &helper, properties, false);
+ DbusPassive(bus_mock, type, id, &helper, properties, false, path, nullptr);
// Success
}
@@ -77,7 +77,8 @@ class DbusPassiveTestObj : public ::testing::Test
.WillOnce(Return(false));
auto info = conf::SensorConfig();
- ri = DbusPassive::createDbusPassive(bus_mock, type, id, &helper, &info);
+ ri = DbusPassive::createDbusPassive(bus_mock, type, id, &helper, &info,
+ nullptr);
passive = reinterpret_cast<DbusPassive*>(ri.get());
EXPECT_FALSE(passive == nullptr);
}
OpenPOWER on IntegriCloud