boot-block: remove blocking error on erase

When an entry is erased, remove it from the blocking array. This will
result in the d-bus object at the /xyz/openbmc_project/logging/blockX
path being deleted as well.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ib49073532588d25c4ae357917ecd6339a70d8c1e
diff --git a/test/elog_quiesce_test.cpp b/test/elog_quiesce_test.cpp
index 3eb2a3d..1f1cdeb 100644
--- a/test/elog_quiesce_test.cpp
+++ b/test/elog_quiesce_test.cpp
@@ -140,6 +140,22 @@
     manager.checkQuiesceOnError(elog);
     // Created error with callout so expect a blocking error now
     EXPECT_EQ(manager.getBlockingErrSize(), 1);
+
+    // Now delete the error and make sure the object and entry go away
+    EXPECT_CALL(sdbusMock, sd_bus_emit_object_removed(testing::_, testing::_))
+        .Times(testing::AnyNumber());
+    EXPECT_CALL(sdbusMock,
+                sd_bus_emit_object_removed(
+                    testing::_, testing::HasSubstr(
+                                    "/xyz/openbmc_project/logging/block100")))
+        .Times(1);
+
+    // Make sure nothing happens within invalid id
+    manager.checkAndRemoveBlockingError(id + 1);
+    EXPECT_EQ(manager.getBlockingErrSize(), 1);
+
+    manager.checkAndRemoveBlockingError(id);
+    EXPECT_EQ(manager.getBlockingErrSize(), 0);
 }
 
 } // namespace test