firmware: add expiration handle

Expiring the session aborts the process.

Tested: Only tested with unit-tests, not run on a real system.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I3a7ae54cfa04e162a2a1e591c0ddd4eca3d6d3db
diff --git a/bmc/test/firmware_state_notyetstarted_unittest.cpp b/bmc/test/firmware_state_notyetstarted_unittest.cpp
index b3cfc49..970ae2f 100644
--- a/bmc/test/firmware_state_notyetstarted_unittest.cpp
+++ b/bmc/test/firmware_state_notyetstarted_unittest.cpp
@@ -113,5 +113,18 @@
     EXPECT_TRUE(handler->canHandleBlob(activeHashBlobId));
 }
 
+/*
+ * expire(session)
+ */
+TEST_F(FirmwareHandlerNotYetStartedTest, ExpireOnNotYetStartedAbortsProcess)
+{
+    ASSERT_TRUE(handler->expire(session));
+
+    EXPECT_THAT(handler->getBlobIds(),
+                UnorderedElementsAreArray(startingBlobs));
+
+    expectedState(FirmwareBlobHandler::UpdateState::notYetStarted);
+}
+
 } // namespace
 } // namespace ipmi_flash