bmc: abort from verificationStarted
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I649ad1779075ef07908740a1430ca285f856512c
diff --git a/test/firmware_state_verificationstarted_unittest.cpp b/test/firmware_state_verificationstarted_unittest.cpp
index 03ceb99..ba76503 100644
--- a/test/firmware_state_verificationstarted_unittest.cpp
+++ b/test/firmware_state_verificationstarted_unittest.cpp
@@ -263,8 +263,22 @@
/*
* close(session) - close while state if verificationStarted without calling
* stat first will abort.
- * TODO: implement this test when we implement abort.
*/
+TEST_F(FirmwareHandlerVerificationStartedTest,
+ CloseOnVerifyDuringVerificationAbortsProcess)
+{
+ getToVerificationStarted(staticLayoutBlobId);
+ EXPECT_CALL(*verifyMockPtr, abort()).Times(1);
+
+ EXPECT_TRUE(handler->close(session));
+
+ std::vector<std::string> expectedBlobs = {staticLayoutBlobId, hashBlobId};
+
+ EXPECT_THAT(handler->getBlobIds(),
+ UnorderedElementsAreArray(expectedBlobs));
+
+ expectedState(FirmwareBlobHandler::UpdateState::notYetStarted);
+}
} // namespace
} // namespace ipmi_flash