version_handler: Support multiple sessions
We want to be able to support multiple concurrent readers of version
information. Otherwise, upstream version checks might fail if they end
up being sequenced concurrently.
Change-Id: I5420ad667622b7906e633562a5373e0be042c0c1
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/bmc/version-handler/test/version_open_unittest.cpp b/bmc/version-handler/test/version_open_unittest.cpp
index 033b2f4..3d6f559 100644
--- a/bmc/version-handler/test/version_open_unittest.cpp
+++ b/bmc/version-handler/test/version_open_unittest.cpp
@@ -62,12 +62,12 @@
EXPECT_TRUE(h->open(defaultSessionNumber, blobs::read, "blob0"));
}
-TEST_F(VersionOpenBlobTest, VerifyDoubleOpenFails)
+TEST_F(VersionOpenBlobTest, VerifyMultiOpenWorks)
{
EXPECT_CALL(*tm.at("blob1"), trigger()).WillOnce(Return(true));
EXPECT_TRUE(h->open(0, blobs::read, "blob1"));
- EXPECT_FALSE(h->open(2, blobs::read, "blob1"));
- EXPECT_FALSE(h->open(2, blobs::read, "blob1"));
+ EXPECT_TRUE(h->open(1, blobs::read, "blob1"));
+ EXPECT_TRUE(h->open(2, blobs::read, "blob1"));
}
TEST_F(VersionOpenBlobTest, VerifyFailedTriggerFails)