blob: a140ddded7ea31be6ae48bf28850004014ecae91 [file] [log] [blame]
Xiuzhi Cheng4f3eb902022-06-08 09:06:33 +08001#include "config.h"
2
3#include "kunlun_oem.hpp"
4
5#include <ipmid/api.h>
6
7#include <gmock/gmock.h>
8#include <gtest/gtest.h>
9
10using ::testing::_;
11using ::testing::Invoke;
12using ::testing::IsNull;
13using ::testing::Return;
14using ::testing::StrEq;
15using ::testing::VariantWith;
16
17namespace ipmi
18{
19
20namespace impl
21{
22
Patrick Williamsb8c92442022-08-04 13:27:05 -050023bool registerHandler(int prio, NetFn netFn, Cmd cmd, Privilege priv,
24 ::ipmi::HandlerBase::ptr handler)
Xiuzhi Cheng4f3eb902022-06-08 09:06:33 +080025{
26 (void)prio;
27 (void)netFn;
28 (void)cmd;
29 (void)priv;
30 (void)handler;
31
32 return true;
33}
34
35} // namespace impl
36
37TEST(TestKunlunIpmiOem, SetAndGetCpuInfo)
38{
39 uint8_t index = 0;
40 uint32_t loop;
41 std::vector<char> infoSet;
42 std::vector<char> infoGet;
43
44 for (loop = 0; loop < 256; loop++)
45 {
46 infoSet.push_back(static_cast<char>(loop));
47 }
48
49 EXPECT_EQ(setCpuInfo(index, infoSet), responseSuccess());
50
51 auto result = getCpuInfo(index);
52 infoGet = std::get<0>(std::get<1>(result).value());
53
54 EXPECT_TRUE(infoSet == infoGet);
55}
56
57} // namespace ipmi