1 // Copyright 2022 Google LLC 2 // 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 15 #pragma once 16 17 #include "handler.hpp" 18 19 #include <ipmid/message.hpp> 20 21 #include <cstddef> 22 #include <cstdint> 23 #include <string> 24 #include <string_view> 25 #include <tuple> 26 27 #include <gmock/gmock.h> 28 29 namespace google 30 { 31 namespace ipmi 32 { 33 34 class HandlerMock : public HandlerInterface 35 { 36 public: 37 ~HandlerMock() = default; 38 39 MOCK_METHOD((std::tuple<std::uint8_t, std::string>), getEthDetails, 40 (std::string), (const, override)); 41 MOCK_METHOD(std::int64_t, getRxPackets, (const std::string&), 42 (const, override)); 43 MOCK_METHOD( 44 (std::tuple<std::uint8_t, std::uint8_t, std::uint8_t, std::uint8_t>), 45 getCpldVersion, (unsigned int), (const, override)); 46 47 MOCK_METHOD(void, psuResetDelay, (std::uint32_t), (const, override)); 48 MOCK_METHOD(void, psuResetOnShutdown, (), (const, override)); 49 MOCK_METHOD(std::uint32_t, getFlashSize, (), (override)); 50 MOCK_METHOD(std::string, getEntityName, (std::uint8_t, std::uint8_t), 51 (override)); 52 MOCK_METHOD(std::string, getMachineName, (), (override)); 53 MOCK_METHOD(void, buildI2cPcieMapping, (), (override)); 54 MOCK_METHOD(size_t, getI2cPcieMappingSize, (), (const, override)); 55 MOCK_METHOD((std::tuple<std::uint32_t, std::string>), getI2cEntry, 56 (unsigned int), (const, override)); 57 MOCK_METHOD(void, hostPowerOffDelay, (std::uint32_t), (const, override)); 58 59 MOCK_METHOD(uint32_t, accelOobDeviceCount, (), (const, override)); 60 MOCK_METHOD(std::string, accelOobDeviceName, (size_t), (const, override)); 61 MOCK_METHOD(uint64_t, accelOobRead, (std::string_view, uint64_t, uint8_t), 62 (const, override)); 63 MOCK_METHOD(void, accelOobWrite, 64 (std::string_view, uint64_t, uint8_t, uint64_t), 65 (const, override)); 66 MOCK_METHOD(std::vector<uint8_t>, pcieBifurcation, (uint8_t), (override)); 67 MOCK_METHOD(uint8_t, getBmcMode, (), (override)); 68 MOCK_METHOD(void, linuxBootDone, (), (const, override)); 69 MOCK_METHOD(void, accelSetVrSettings, 70 (::ipmi::Context::ptr, uint8_t, uint8_t, uint16_t), 71 (const, override)); 72 MOCK_METHOD(uint16_t, accelGetVrSettings, 73 (::ipmi::Context::ptr, uint8_t, uint8_t), (const, override)); 74 }; 75 76 } // namespace ipmi 77 } // namespace google 78