bmc: enable configuration of all verification
Enable verification configuration beyond the result file check. This
patchset allows a developer to provide their own verification mechanisms
by implementing an interface and adding configuration to enable using
their custom version.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Iba5d4be75bb49d9c4ab84be8578f0306c15b5be9
diff --git a/test/firmware_close_unittest.cpp b/test/firmware_close_unittest.cpp
index b0d20fb..ff839af 100644
--- a/test/firmware_close_unittest.cpp
+++ b/test/firmware_close_unittest.cpp
@@ -2,8 +2,8 @@
#include "firmware_handler.hpp"
#include "image_mock.hpp"
#include "util.hpp"
+#include "verification_mock.hpp"
-#include <sdbusplus/test/sdbus_mock.hpp>
#include <vector>
#include <gmock/gmock.h>
@@ -32,11 +32,8 @@
{FirmwareBlobHandler::UpdateFlags::lpc, &dataMock},
};
- sdbusplus::SdBusMock sdbus_mock;
- auto bus_mock = sdbusplus::get_mocked_new(&sdbus_mock);
-
auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
- std::move(bus_mock), blobs, data, "");
+ blobs, data, CreateVerifyMock());
EXPECT_CALL(dataMock, open()).WillOnce(Return(true));
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));
@@ -78,11 +75,8 @@
{FirmwareBlobHandler::UpdateFlags::lpc, &dataMock},
};
- sdbusplus::SdBusMock sdbus_mock;
- auto bus_mock = sdbusplus::get_mocked_new(&sdbus_mock);
-
auto handler = FirmwareBlobHandler::CreateFirmwareBlobHandler(
- std::move(bus_mock), blobs, data, "");
+ blobs, data, CreateVerifyMock());
EXPECT_CALL(imageMock, open(StrEq(hashBlobId))).WillOnce(Return(true));