test: firmware verificationCompleted: commit
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I929fdc480b127dcda4b80b9a4d7153ce5cc8f5f4
diff --git a/test/firmware_state_verificationcompleted_unittest.cpp b/test/firmware_state_verificationcompleted_unittest.cpp
index c162c5b..24ad9ad 100644
--- a/test/firmware_state_verificationcompleted_unittest.cpp
+++ b/test/firmware_state_verificationcompleted_unittest.cpp
@@ -273,8 +273,28 @@
}
/*
- * commit(session) - ?
+ * commit(session) - returns failure
*/
+TEST_F(FirmwareHandlerVerificationCompletedTest,
+ CommitOnVerifyBlobAfterSuccessReturnsFailure)
+{
+ /* If you've started this'll return success, but if it's finished, it won't
+ * let you try-again.
+ */
+ getToVerificationCompleted(VerifyCheckResponses::success);
+ EXPECT_CALL(*verifyMockPtr, triggerVerification()).Times(0);
+
+ EXPECT_FALSE(handler->commit(session, {}));
+}
+
+TEST_F(FirmwareHandlerVerificationCompletedTest,
+ CommitOnVerifyBlobAfterFailureReturnsFailure)
+{
+ getToVerificationCompleted(VerifyCheckResponses::failed);
+ EXPECT_CALL(*verifyMockPtr, triggerVerification()).Times(0);
+
+ EXPECT_FALSE(handler->commit(session, {}));
+}
/*
* close(session) - close on the verify blobid: