blob: 0eea768f3c997850f3929f92097d04c286a2eacc [file] [log] [blame]
Patrick Venture1361a122019-05-20 07:36:05 -07001#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
14namespace blobs
15{
16
17class 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
37class 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