test: firmware verificationCompleted: stat(activehash)
Add missing test to verify the active hash blob id isn't present when it
shouldn't be in this state. It can be, however, the mechanism used to
reach this point didn't set it up.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I08397c38ecc9815454cc5387c30c61dbc7086d6a
diff --git a/test/firmware_state_verificationcompleted_unittest.cpp b/test/firmware_state_verificationcompleted_unittest.cpp
index d514dd0..3d20ce7 100644
--- a/test/firmware_state_verificationcompleted_unittest.cpp
+++ b/test/firmware_state_verificationcompleted_unittest.cpp
@@ -96,6 +96,23 @@
EXPECT_FALSE(handler->stat(activeImageBlobId, &meta));
}
+TEST_F(FirmwareHandlerVerificationCompletedTest,
+ VerifyActiveHashIdMissingInThisCase)
+{
+ /* The path taken to get to this state never opened the hash blob Id, which
+ * is fine. But let's verify it behaved as intended.
+ */
+ getToVerificationCompleted(VerifyCheckResponses::success);
+ EXPECT_FALSE(handler->canHandleBlob(activeHashBlobId));
+}
+
+/* TODO: Add sufficient warning that you can get to verificationCompleted
+ * without ever opening the image blob id (or the tarball one).
+ *
+ * Although in this case, it's expected that any verification triggered would
+ * certainly fail. So, although it's possible, it's uninteresting.
+ */
+
TEST_F(FirmwareHandlerVerificationCompletedTest, StatOnVerifyBlobReturnsFailure)
{
getToVerificationCompleted(VerifyCheckResponses::success);