update_engine: Add hardware support for firmware_max_rollforward
- Adds the methods to get and set firmware_max_rollforward
- This is for supporting the rollback feature
- A future CL will set these values based on policy
BUG=chromium:840432
TEST=unittests
Change-Id: I560f4cef9595d4a52d011fcfeb7b2675a096aefa
Reviewed-on: https://chromium-review.googlesource.com/1062766
Commit-Ready: Zentaro Kavanagh <zentaro@chromium.org>
Tested-by: Zentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/common/mock_hardware.h b/common/mock_hardware.h
index 662ccd9..f972df2 100644
--- a/common/mock_hardware.h
+++ b/common/mock_hardware.h
@@ -60,6 +60,12 @@
ON_CALL(*this, GetMinFirmwareKeyVersion())
.WillByDefault(
testing::Invoke(&fake_, &FakeHardware::GetMinFirmwareKeyVersion));
+ ON_CALL(*this, GetMaxFirmwareKeyRollforward())
+ .WillByDefault(testing::Invoke(
+ &fake_, &FakeHardware::GetMaxFirmwareKeyRollforward));
+ ON_CALL(*this, SetMaxFirmwareKeyRollforward())
+ .WillByDefault(testing::Invoke(
+ &fake_, &FakeHardware::SetMaxFirmwareKeyRollforward));
ON_CALL(*this, SetMaxKernelKeyRollforward())
.WillByDefault(
testing::Invoke(&fake_, &FakeHardware::SetMaxKernelKeyRollforward));
@@ -92,6 +98,9 @@
MOCK_CONST_METHOD0(GetECVersion, std::string());
MOCK_CONST_METHOD0(GetMinKernelKeyVersion, int());
MOCK_CONST_METHOD0(GetMinFirmwareKeyVersion, int());
+ MOCK_CONST_METHOD0(GetMaxFirmwareKeyRollforward, int());
+ MOCK_CONST_METHOD1(SetMaxFirmwareKeyRollforward,
+ bool(int firmware_max_rollforward));
MOCK_CONST_METHOD1(SetMaxKernelKeyRollforward,
bool(int kernel_max_rollforward));
MOCK_CONST_METHOD0(GetPowerwashCount, int());