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_updatecompleted_unittest.cpp b/bmc/test/firmware_state_updatecompleted_unittest.cpp
index 7136223..d002499 100644
--- a/bmc/test/firmware_state_updatecompleted_unittest.cpp
+++ b/bmc/test/firmware_state_updatecompleted_unittest.cpp
@@ -245,5 +245,19 @@
     }
 }
 
+/*
+ * expire(session)
+ */
+TEST_F(FirmwareHandlerUpdateCompletedTest, ExpireOnUpdateCompletedAbortsProcess)
+{
+    getToUpdateCompleted(ActionStatus::success);
+
+    ASSERT_TRUE(handler->expire(session));
+    EXPECT_THAT(handler->getBlobIds(),
+                UnorderedElementsAreArray(startingBlobs));
+
+    expectedState(FirmwareBlobHandler::UpdateState::notYetStarted);
+}
+
 } // namespace
 } // namespace ipmi_flash