Kunlun OEM commands,The first version add two commands:
1,setCpuInfo:save cpu infomation from bios to file
2,getCpuInfo:load cpu infomation from file
Signed-off-by: Xiuzhi Cheng <xzcheng@zd-tech.com.cn>
diff --git a/test/test_kunlun_ipmi_oem.cpp b/test/test_kunlun_ipmi_oem.cpp
new file mode 100644
index 0000000..1b4526a
--- /dev/null
+++ b/test/test_kunlun_ipmi_oem.cpp
@@ -0,0 +1,56 @@
+#include "config.h"
+
+#include "kunlun_oem.hpp"
+
+#include <ipmid/api.h>
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using ::testing::_;
+using ::testing::Invoke;
+using ::testing::IsNull;
+using ::testing::Return;
+using ::testing::StrEq;
+using ::testing::VariantWith;
+
+namespace ipmi
+{
+
+namespace impl
+{
+
+bool registerHandler(int prio, NetFn netFn, Cmd cmd, Privilege priv, ::ipmi::HandlerBase::ptr handler)
+{
+ (void)prio;
+ (void)netFn;
+ (void)cmd;
+ (void)priv;
+ (void)handler;
+
+ return true;
+}
+
+} // namespace impl
+
+TEST(TestKunlunIpmiOem, SetAndGetCpuInfo)
+{
+ uint8_t index = 0;
+ uint32_t loop;
+ std::vector<char> infoSet;
+ std::vector<char> infoGet;
+
+ for (loop = 0; loop < 256; loop++)
+ {
+ infoSet.push_back(static_cast<char>(loop));
+ }
+
+ EXPECT_EQ(setCpuInfo(index, infoSet), responseSuccess());
+
+ auto result = getCpuInfo(index);
+ infoGet = std::get<0>(std::get<1>(result).value());
+
+ EXPECT_TRUE(infoSet == infoGet);
+}
+
+} // namespace ipmi
\ No newline at end of file