test: firmware verificationCompleted: open
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I8244cabf9fc40e31f4bd3d7fd346ad158edfc197
diff --git a/test/firmware_state_verificationcompleted_unittest.cpp b/test/firmware_state_verificationcompleted_unittest.cpp
index e5c3f43..1bef136 100644
--- a/test/firmware_state_verificationcompleted_unittest.cpp
+++ b/test/firmware_state_verificationcompleted_unittest.cpp
@@ -179,6 +179,29 @@
/*
* open(blob) - all open should fail
*/
+TEST_F(FirmwareHandlerVerificationCompletedTest,
+ OpeningAnyBlobAvailableFailsAfterSuccess)
+{
+ getToVerificationCompleted(VerifyCheckResponses::success);
+
+ auto blobs = handler->getBlobIds();
+ for (const auto& blob : blobs)
+ {
+ EXPECT_FALSE(handler->open(session + 1, flags, blob));
+ }
+}
+
+TEST_F(FirmwareHandlerVerificationCompletedTest,
+ OpeningAnyBlobAvailableFailsAfterFailure)
+{
+ getToVerificationCompleted(VerifyCheckResponses::failed);
+
+ auto blobs = handler->getBlobIds();
+ for (const auto& blob : blobs)
+ {
+ EXPECT_FALSE(handler->open(session + 1, flags, blob));
+ }
+}
/*
* writemeta(session) - write meta should fail.