summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEdward A. James <eajames@us.ibm.com>2017-10-06 10:53:55 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2017-11-17 20:50:09 +0000
commit636577f44fe3fc951538c1119ed0da8ac9a40932 (patch)
treecded6020e29358bd8913d6f7b2b5d56cd8f42204 /test
parent5e177970328acb51d7213d137b6b47cde0451780 (diff)
downloadopenpower-occ-control-636577f44fe3fc951538c1119ed0da8ac9a40932.tar.gz
openpower-occ-control-636577f44fe3fc951538c1119ed0da8ac9a40932.zip
Add OCC present count detection and watch
Add a Presence child class of Error to handle detecting the number of OCCs available. Add an instance of this Presence class if the Device detects that it is the master OCC, since the number of present OCCs is only reported by the master OCC. When a change to the number of OCCs reported is detected, compare with the number of OCCs determined to be active by the Manager, and if there is a mismatch, follow the usual error path (reset OCC, etc). Partially resolves openbmc/openbmc#2285 See https://gerrit.openbmc-project.xyz/#/c/7843/ Change-Id: Idbaca52b307992d9b01fe15439ab746ef6d64397 Signed-off-by: Edward A. James <eajames@us.ibm.com>
Diffstat (limited to 'test')
-rw-r--r--test/utest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/utest.cpp b/test/utest.cpp
index 9731209..dc80cc2 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -1,5 +1,6 @@
#include <gtest/gtest.h>
#include <occ_events.hpp>
+#include <occ_manager.hpp>
#include "powercap.hpp"
using namespace open_power::occ;
@@ -11,7 +12,8 @@ class VerifyOccInput : public ::testing::Test
bus(sdbusplus::bus::new_default()),
rc(sd_event_default(&event)),
eventP(event),
- occStatus(bus, eventP, "/test/path/occ1"),
+ manager(bus, eventP),
+ occStatus(bus, eventP, "/test/path/occ1", manager),
pcap(bus,occStatus)
{
EXPECT_GE(rc, 0);
@@ -25,6 +27,7 @@ class VerifyOccInput : public ::testing::Test
int rc;
open_power::occ::EventPtr eventP;
+ Manager manager;
Status occStatus;
powercap::PowerCap pcap;
};
OpenPOWER on IntegriCloud