firmware: add verify blob_id

Add verification blob_id into the blob list.  This blob_id will require
special handling in a few actions to be added later.

Goal behavior:
- on open, if all others closed, allows open (now only one of 3 can be
opened at once).
- on commit, starts verification process.
- on close, clears out any outstanding state (but doesn't abort
anything).
- on delete, returns failure.

Change-Id: Ifc759c1051cf1748624ccdb5f7dda0a9ea1681d4
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/firmware_open_unittest.cpp b/test/firmware_open_unittest.cpp
index 1975740..81a1977 100644
--- a/test/firmware_open_unittest.cpp
+++ b/test/firmware_open_unittest.cpp
@@ -37,7 +37,7 @@
 
     /* The active image blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(4, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             FirmwareBlobHandler::activeImageBlobID));
 }
@@ -66,7 +66,7 @@
 
     /* The active hash blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(4, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             FirmwareBlobHandler::activeHashBlobID));
 }
@@ -100,7 +100,7 @@
 
     /* The active hash blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(4, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             FirmwareBlobHandler::activeHashBlobID));
 }
@@ -130,7 +130,7 @@
 
     /* The active hash blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(2, currentBlobs.size());
+    EXPECT_EQ(3, currentBlobs.size());
 }
 
 TEST(FirmwareHandlerOpenTest, OpenEverythingSucceedsVerifyOpenFileCheck)
@@ -157,7 +157,7 @@
 
     /* The active image blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(4, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             FirmwareBlobHandler::activeImageBlobID));
 
@@ -202,7 +202,7 @@
 
     /* The active image blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(4, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             FirmwareBlobHandler::activeImageBlobID));
 
@@ -240,7 +240,7 @@
 
     /* Verify blob_id list doesn't grow. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(2, currentBlobs.size());
+    EXPECT_EQ(3, currentBlobs.size());
 }
 
 TEST(FirmwareHandlerOpenTest, OpenWithoutWriteFails)