bugfix: active blob id added on open failure
The active blob id for image or hash is added before the open is
guaranteed to succeed.
Change-Id: I48a428862bca915381298cf1425ddaef039195a6
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/firmware_open_unittest.cpp b/test/firmware_open_unittest.cpp
index 317911c..967f792 100644
--- a/test/firmware_open_unittest.cpp
+++ b/test/firmware_open_unittest.cpp
@@ -126,6 +126,10 @@
EXPECT_FALSE(handler->open(
0, OpenFlags::write | FirmwareBlobHandler::UpdateFlags::ipmi, "asdf"));
+
+ /* Verify blob_id list doesn't grow. */
+ auto currentBlobs = handler->getBlobIds();
+ EXPECT_EQ(2, currentBlobs.size());
}
TEST(FirmwareHandlerOpenTest, OpenWithoutWriteFails)