Patrick Venture | 1361a12 | 2019-05-20 07:36:05 -0700 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include "data_mock.hpp" |
| 4 | #include "firmware_handler.hpp" |
| 5 | #include "image_mock.hpp" |
| 6 | #include "verification_mock.hpp" |
| 7 | |
| 8 | #include <memory> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <gmock/gmock.h> |
| 12 | #include <gtest/gtest.h> |
| 13 | |
| 14 | namespace blobs |
| 15 | { |
| 16 | |
| 17 | class IpmiOnlyFirmwareTest : public ::testing::Test |
| 18 | { |
| 19 | protected: |
| 20 | ImageHandlerMock imageMock; |
| 21 | std::vector<HandlerPack> blobs; |
| 22 | std::vector<DataHandlerPack> data = { |
| 23 | {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr}}; |
| 24 | std::unique_ptr<GenericBlobInterface> handler; |
| 25 | |
| 26 | void SetUp() override |
| 27 | { |
| 28 | blobs = { |
| 29 | {hashBlobId, &imageMock}, |
| 30 | {"asdf", &imageMock}, |
| 31 | }; |
| 32 | handler = FirmwareBlobHandler::CreateFirmwareBlobHandler( |
| 33 | blobs, data, CreateVerifyMock()); |
| 34 | } |
| 35 | }; |
| 36 | |
| 37 | class FakeLpcFirmwareTest : public ::testing::Test |
| 38 | { |
| 39 | protected: |
| 40 | DataHandlerMock dataMock; |
| 41 | ImageHandlerMock imageMock; |
| 42 | std::vector<HandlerPack> blobs; |
| 43 | std::vector<DataHandlerPack> data; |
| 44 | std::unique_ptr<GenericBlobInterface> handler; |
| 45 | |
| 46 | void SetUp() override |
| 47 | { |
| 48 | blobs = { |
| 49 | {hashBlobId, &imageMock}, |
| 50 | {"asdf", &imageMock}, |
| 51 | }; |
| 52 | data = { |
| 53 | {FirmwareBlobHandler::UpdateFlags::ipmi, nullptr}, |
| 54 | {FirmwareBlobHandler::UpdateFlags::lpc, &dataMock}, |
| 55 | }; |
| 56 | handler = FirmwareBlobHandler::CreateFirmwareBlobHandler( |
| 57 | blobs, data, CreateVerifyMock()); |
| 58 | } |
| 59 | }; |
| 60 | |
| 61 | } // namespace blobs |