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_close_unittest.cpp b/bmc/version-handler/test/version_close_unittest.cpp
index c529206..efdff5d 100644
--- a/bmc/version-handler/test/version_close_unittest.cpp
+++ b/bmc/version-handler/test/version_close_unittest.cpp
@@ -36,6 +36,16 @@
EXPECT_TRUE(h->close(0));
}
+TEST_F(VersionCloseExpireBlobTest, VerifySingleAbort)
+{
+ EXPECT_CALL(*tm.at("blob0"), trigger()).WillOnce(Return(true));
+ EXPECT_TRUE(h->open(0, blobs::read, "blob0"));
+ EXPECT_TRUE(h->open(1, blobs::read, "blob0"));
+ EXPECT_TRUE(h->close(0));
+ EXPECT_CALL(*tm.at("blob0"), abort()).Times(1);
+ EXPECT_TRUE(h->close(1));
+}
+
TEST_F(VersionCloseExpireBlobTest, VerifyUnopenedBlobCloseFails)
{
EXPECT_FALSE(h->close(0));