PEL: Change method of asserting a fault LED

There was a recent change in direction on how PELs should request that
fault LEDs be turned on.  Previously, the code would talk to the LED
group objects directly.  The new direction is to set the Functional
property on the OperationalStatus interface on the inventory objects in
question to false, and the LED manager code will watch that to know when
to turn on the LEDs.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ieebb09ba002843cf863359a09aba26540356aa91
diff --git a/test/openpower-pels/mocks.hpp b/test/openpower-pels/mocks.hpp
index 510974c..a2c3b5a 100644
--- a/test/openpower-pels/mocks.hpp
+++ b/test/openpower-pels/mocks.hpp
@@ -39,12 +39,10 @@
                 (const override));
     MOCK_METHOD(std::string, getInventoryFromLocCode,
                 (const std::string&, uint16_t, bool), (const override));
-
-    MOCK_METHOD(std::string, getFaultLEDGroup, (const std::string&),
-                (const override));
-
     MOCK_METHOD(void, assertLEDGroup, (const std::string&, bool),
                 (const override));
+    MOCK_METHOD(void, setFunctional, (const std::string&, bool),
+                (const override));
 
     void changeHostState(bool newState)
     {
diff --git a/test/openpower-pels/pel_manager_test.cpp b/test/openpower-pels/pel_manager_test.cpp
index 3112a16..a2cb5fd 100644
--- a/test/openpower-pels/pel_manager_test.cpp
+++ b/test/openpower-pels/pel_manager_test.cpp
@@ -852,10 +852,8 @@
         EXPECT_CALL(*mockIface, getInventoryFromLocCode("U42", 0, true))
             .WillOnce(Return("/system/chassis/processor"));
 
-        EXPECT_CALL(*mockIface, getFaultLEDGroup("/system/chassis/processor"))
-            .WillOnce(Return("/led/groups/cpu0"));
-
-        EXPECT_CALL(*mockIface, assertLEDGroup("/led/groups/cpu0", true))
+        EXPECT_CALL(*mockIface,
+                    setFunctional("/system/chassis/processor", false))
             .Times(1);
 
         // This hostboot PEL has a single hardware callout in it.
@@ -895,10 +893,8 @@
         EXPECT_CALL(*mockIface, getInventoryFromLocCode("U42-P42-C23", 0, true))
             .WillOnce(Return("/system/chassis/processor"));
 
-        EXPECT_CALL(*mockIface, getFaultLEDGroup("/system/chassis/processor"))
-            .WillOnce(Return("/led/groups/cpu0"));
-
-        EXPECT_CALL(*mockIface, assertLEDGroup("/led/groups/cpu0", true))
+        EXPECT_CALL(*mockIface,
+                    setFunctional("/system/chassis/processor", false))
             .Times(1);
 
         const auto registry = R"(
diff --git a/test/openpower-pels/service_indicators_test.cpp b/test/openpower-pels/service_indicators_test.cpp
index f83edeb..410ee44 100644
--- a/test/openpower-pels/service_indicators_test.cpp
+++ b/test/openpower-pels/service_indicators_test.cpp
@@ -270,10 +270,8 @@
         EXPECT_CALL(dataIface, getInventoryFromLocCode("U42", 0, true))
             .WillOnce(Return("/system/chassis/processor"));
 
-        EXPECT_CALL(dataIface, getFaultLEDGroup("/system/chassis/processor"))
-            .WillOnce(Return("/led/groups/cpu0"));
-
-        EXPECT_CALL(dataIface, assertLEDGroup("/led/groups/cpu0", true))
+        EXPECT_CALL(dataIface,
+                    setFunctional("/system/chassis/processor", false))
             .Times(1);
 
         auto data = pelFactory(1, 'O', 0x20, 0xA400, 500);
@@ -307,7 +305,7 @@
         EXPECT_CALL(dataIface, getInventoryFromLocCode("U42", 0, true))
             .WillOnce(Throw(std::runtime_error("Fail")));
 
-        EXPECT_CALL(dataIface, getFaultLEDGroup(_)).Times(0);
+        EXPECT_CALL(dataIface, setFunctional).Times(0);
 
         EXPECT_CALL(dataIface,
                     assertLEDGroup("/xyz/openbmc_project/led/groups/"
@@ -321,7 +319,7 @@
         lightPath.activate(pel);
     }
 
-    // Make getFaultLEDGroup fail - will set the platform SAI LED
+    // Make setFunctional fail
     {
         MockDataInterface dataIface;
         service_indicators::LightPath lightPath{dataIface};
@@ -329,33 +327,8 @@
         EXPECT_CALL(dataIface, getInventoryFromLocCode("U42", 0, true))
             .WillOnce(Return("/system/chassis/processor"));
 
-        EXPECT_CALL(dataIface, getFaultLEDGroup("/system/chassis/processor"))
-            .WillOnce(Throw(std::runtime_error("Fail")));
-
         EXPECT_CALL(dataIface,
-                    assertLEDGroup("/xyz/openbmc_project/led/groups/"
-                                   "platform_system_attention_indicator",
-                                   true))
-            .Times(1);
-
-        auto data = pelFactory(1, 'O', 0x20, 0xA400, 500);
-        PEL pel{data};
-
-        lightPath.activate(pel);
-    }
-
-    // Make assertLEDGroup fail
-    {
-        MockDataInterface dataIface;
-        service_indicators::LightPath lightPath{dataIface};
-
-        EXPECT_CALL(dataIface, getInventoryFromLocCode("U42", 0, true))
-            .WillOnce(Return("/system/chassis/processor"));
-
-        EXPECT_CALL(dataIface, getFaultLEDGroup("/system/chassis/processor"))
-            .WillOnce(Return("/led/groups/cpu0"));
-
-        EXPECT_CALL(dataIface, assertLEDGroup("/led/groups/cpu0", true))
+                    setFunctional("/system/chassis/processor", false))
             .WillOnce(Throw(std::runtime_error("Fail")));
 
         auto data = pelFactory(1, 'O', 0x20, 0xA400, 500);