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_uploadinprogress_unittest.cpp b/bmc/test/firmware_state_uploadinprogress_unittest.cpp
index 994ddb1..d5bd3f3 100644
--- a/bmc/test/firmware_state_uploadinprogress_unittest.cpp
+++ b/bmc/test/firmware_state_uploadinprogress_unittest.cpp
@@ -277,5 +277,18 @@
}
}
+/*
+ * expire(session)
+ */
+TEST_F(FirmwareHandlerUploadInProgressTest, ExpireAbortsProcess)
+{
+ openToInProgress(staticLayoutBlobId);
+
+ ASSERT_TRUE(handler->expire(session));
+ EXPECT_THAT(handler->getBlobIds(),
+ UnorderedElementsAreArray(startingBlobs));
+ expectedState(FirmwareBlobHandler::UpdateState::notYetStarted);
+}
+
} // namespace
} // namespace ipmi_flash