blob: f62564e6c1dd1a33f854ab69310129ccee7e7a03 [file] [log] [blame]
Steve Foreman4f0d1de2021-09-20 14:06:32 -07001// Copyright 2022 Google LLC
Willy Tua2056e92021-10-10 13:36:16 -07002//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Patrick Venturef085d912019-03-15 08:50:00 -070015#pragma once
16
17#include "handler.hpp"
18
Patrick Venture40e8ace2020-08-12 20:44:43 -070019#include <cstddef>
20#include <cstdint>
21#include <string>
Steve Foreman4f0d1de2021-09-20 14:06:32 -070022#include <string_view>
Patrick Venture40e8ace2020-08-12 20:44:43 -070023#include <tuple>
24
Patrick Venturef085d912019-03-15 08:50:00 -070025#include <gmock/gmock.h>
26
27namespace google
28{
29namespace ipmi
30{
31
32class HandlerMock : public HandlerInterface
33{
Patrick Venturef085d912019-03-15 08:50:00 -070034 public:
35 ~HandlerMock() = default;
36
Willy Tucad9eb82021-10-10 14:08:39 -070037 MOCK_METHOD((std::tuple<std::uint8_t, std::string>), getEthDetails,
38 (std::string), (const, override));
39 MOCK_METHOD(std::int64_t, getRxPackets, (const std::string&),
40 (const, override));
41 MOCK_METHOD(
42 (std::tuple<std::uint8_t, std::uint8_t, std::uint8_t, std::uint8_t>),
43 getCpldVersion, (unsigned int), (const, override));
44
45 MOCK_METHOD(void, psuResetDelay, (std::uint32_t), (const, override));
46 MOCK_METHOD(void, psuResetOnShutdown, (), (const, override));
47 MOCK_METHOD(std::uint32_t, getFlashSize, (), (override));
48 MOCK_METHOD(std::string, getEntityName, (std::uint8_t, std::uint8_t),
49 (override));
50 MOCK_METHOD(std::string, getMachineName, (), (override));
51 MOCK_METHOD(void, buildI2cPcieMapping, (), (override));
52 MOCK_METHOD(size_t, getI2cPcieMappingSize, (), (const, override));
53 MOCK_METHOD((std::tuple<std::uint32_t, std::string>), getI2cEntry,
54 (unsigned int), (const, override));
55 MOCK_METHOD(void, hostPowerOffDelay, (std::uint32_t), (const, override));
Steve Foreman4f0d1de2021-09-20 14:06:32 -070056
57 MOCK_METHOD(uint32_t, accelOobDeviceCount, (), (const, override));
58 MOCK_METHOD(std::string, accelOobDeviceName, (size_t), (const, override));
59 MOCK_METHOD(uint64_t, accelOobRead, (std::string_view, uint64_t, uint8_t),
60 (const, override));
61 MOCK_METHOD(void, accelOobWrite,
62 (std::string_view, uint64_t, uint8_t, uint64_t),
63 (const, override));
Willy Tu6c71b0f2021-10-10 13:34:41 -070064 MOCK_METHOD(std::vector<uint8_t>, pcieBifurcation, (uint8_t), (override));
Nikhil Namjoshi5e70dc82022-09-16 00:36:07 +000065 MOCK_METHOD(uint8_t, getBmcMode, (), (override));
John Wediga92d0e62023-06-29 10:43:47 -070066 MOCK_METHOD(void, linuxBootDone, (), (const, override));
Patrick Venturef085d912019-03-15 08:50:00 -070067};
68
69} // namespace ipmi
70} // namespace google