bmc: add verify blob id only when ready

Originally, the verify blob id was always present.  Now, it's only added
when the state transitions initially to verificationPending.

Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I706273519354a7a4a98d9fe4f600c6455a69cc3c
diff --git a/test/firmware_open_unittest.cpp b/test/firmware_open_unittest.cpp
index 4da41a1..8190a47 100644
--- a/test/firmware_open_unittest.cpp
+++ b/test/firmware_open_unittest.cpp
@@ -13,6 +13,9 @@
 
 namespace ipmi_flash
 {
+namespace
+{
+
 using ::testing::Eq;
 using ::testing::Return;
 using ::testing::StrEq;
@@ -37,7 +40,7 @@
 
     /* The active image blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(4, currentBlobs.size());
+    EXPECT_EQ(3, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             activeImageBlobId));
 }
@@ -53,7 +56,7 @@
 
     /* The active hash blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(4, currentBlobs.size());
+    EXPECT_EQ(3, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             activeHashBlobId));
 }
@@ -72,7 +75,7 @@
 
     /* The active hash blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(4, currentBlobs.size());
+    EXPECT_EQ(3, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             activeHashBlobId));
 }
@@ -86,9 +89,9 @@
         0, blobs::OpenFlags::write | FirmwareBlobHandler::UpdateFlags::lpc,
         hashBlobId));
 
-    /* The active hash blob_id was added. */
+    /* The active hash blob_id was not added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(2, currentBlobs.size());
 }
 
 TEST_F(FirmwareHandlerOpenTestIpmiOnly,
@@ -105,7 +108,7 @@
 
     /* The active image blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(4, currentBlobs.size());
+    EXPECT_EQ(3, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             activeImageBlobId));
 
@@ -138,7 +141,7 @@
 
     /* The active image blob_id was added. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(4, currentBlobs.size());
+    EXPECT_EQ(3, currentBlobs.size());
     EXPECT_EQ(1, std::count(currentBlobs.begin(), currentBlobs.end(),
                             activeImageBlobId));
 
@@ -165,7 +168,7 @@
 
     /* Verify blob_id list doesn't grow. */
     auto currentBlobs = handler->getBlobIds();
-    EXPECT_EQ(3, currentBlobs.size());
+    EXPECT_EQ(2, currentBlobs.size());
 }
 
 TEST_F(FirmwareHandlerOpenTestIpmiOnly, OpenWithoutWriteFails)
@@ -197,4 +200,5 @@
 /* TODO: The client sends a request to open active image. */
 /* TODO: The client sends a request to open active hash. */
 
+} // namespace
 } // namespace ipmi_flash