test: firmware verificationStarted: additional stat()
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ie8ca4e1da0ef79944872d0fbebb9e847e9a1971d
diff --git a/test/firmware_state_verificationstarted_unittest.cpp b/test/firmware_state_verificationstarted_unittest.cpp
index 86b10f5..1e73c98 100644
--- a/test/firmware_state_verificationstarted_unittest.cpp
+++ b/test/firmware_state_verificationstarted_unittest.cpp
@@ -106,6 +106,23 @@
}
TEST_F(FirmwareHandlerVerificationStartedTest,
+ StatOnVerifyBlobIdAfterCommitChecksStateAndReturnsOther)
+{
+ getToVerificationStarted(staticLayoutBlobId);
+ EXPECT_CALL(*verifyMockPtr, checkVerificationState())
+ .WillOnce(Return(VerifyCheckResponses::other));
+
+ blobs::BlobMeta meta, expectedMeta = {};
+ expectedMeta.size = 0;
+ expectedMeta.blobState = flags | blobs::StateFlags::committing;
+ expectedMeta.metadata.push_back(
+ static_cast<std::uint8_t>(VerifyCheckResponses::other));
+
+ EXPECT_TRUE(handler->stat(session, &meta));
+ EXPECT_EQ(expectedMeta, meta);
+}
+
+TEST_F(FirmwareHandlerVerificationStartedTest,
StatOnVerifyBlobIdAfterCommitCheckStateAndReturnsFailed)
{
/* If the returned state from the verification handler is failed, it sets