| // Copyright 2022 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| #pragma once |
| |
| #include "handler.hpp" |
| |
| #include <ipmid/message.hpp> |
| |
| #include <cstddef> |
| #include <cstdint> |
| #include <string> |
| #include <string_view> |
| #include <tuple> |
| |
| #include <gmock/gmock.h> |
| |
| namespace google |
| { |
| namespace ipmi |
| { |
| |
| class HandlerMock : public HandlerInterface |
| { |
| public: |
| ~HandlerMock() = default; |
| |
| MOCK_METHOD((std::tuple<std::uint8_t, std::string>), getEthDetails, |
| (std::string), (const, override)); |
| MOCK_METHOD(std::int64_t, getRxPackets, (const std::string&), |
| (const, override)); |
| MOCK_METHOD( |
| (std::tuple<std::uint8_t, std::uint8_t, std::uint8_t, std::uint8_t>), |
| getCpldVersion, (unsigned int), (const, override)); |
| |
| MOCK_METHOD(void, psuResetDelay, (std::uint32_t), (const, override)); |
| MOCK_METHOD(void, psuResetOnShutdown, (), (const, override)); |
| MOCK_METHOD(std::uint32_t, getFlashSize, (), (override)); |
| MOCK_METHOD(std::string, getEntityName, (std::uint8_t, std::uint8_t), |
| (override)); |
| MOCK_METHOD(std::string, getMachineName, (), (override)); |
| MOCK_METHOD(void, buildI2cPcieMapping, (), (override)); |
| MOCK_METHOD(size_t, getI2cPcieMappingSize, (), (const, override)); |
| MOCK_METHOD((std::tuple<std::uint32_t, std::string>), getI2cEntry, |
| (unsigned int), (const, override)); |
| MOCK_METHOD(void, hostPowerOffDelay, (std::uint32_t), (const, override)); |
| |
| MOCK_METHOD(uint32_t, accelOobDeviceCount, (), (const, override)); |
| MOCK_METHOD(std::string, accelOobDeviceName, (size_t), (const, override)); |
| MOCK_METHOD(uint64_t, accelOobRead, (std::string_view, uint64_t, uint8_t), |
| (const, override)); |
| MOCK_METHOD(void, accelOobWrite, |
| (std::string_view, uint64_t, uint8_t, uint64_t), |
| (const, override)); |
| MOCK_METHOD(std::vector<uint8_t>, pcieBifurcation, (uint8_t), (override)); |
| MOCK_METHOD(uint8_t, getBmcMode, (), (override)); |
| MOCK_METHOD(void, linuxBootDone, (), (const, override)); |
| MOCK_METHOD(void, accelSetVrSettings, |
| (::ipmi::Context::ptr, uint8_t, uint8_t, uint16_t), |
| (const, override)); |
| MOCK_METHOD(uint16_t, accelGetVrSettings, |
| (::ipmi::Context::ptr, uint8_t, uint8_t), (const, override)); |
| MOCK_METHOD(std::string, getBMInstanceProperty, (uint8_t), |
| (const, override)); |
| }; |
| |
| } // namespace ipmi |
| } // namespace google |