remove tests
IEI will update some command sets according to the internal OEM spec,
and will refactor all DBus method in the next patch, so this patch
temporarily deletes the tests
Tested: Built iei-ipmi-oem successfully and it works fine.
Change-Id: Ib384c8683f998a49cdcfde22b0948e1f1bdbd80d
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/meson.build b/meson.build
index d5588d5..739bf5f 100644
--- a/meson.build
+++ b/meson.build
@@ -26,8 +26,3 @@
cdata.set_quoted('BIOS_OBJPATH', get_option('BIOS_OBJPATH'))
subdir('src')
-
-build_tests = get_option('tests')
-if not build_tests.disabled()
- subdir('test')
-endif
diff --git a/meson.options b/meson.options
index e311eda..0b231c8 100644
--- a/meson.options
+++ b/meson.options
@@ -1,9 +1,4 @@
option(
- 'tests', type: 'feature',
- description: 'Build tests'
-)
-
-option(
'BIOS_OBJPATH', type: 'string',
value: '/xyz/openbmc_project/software/bios_active',
description: 'The BIOS software Dbus object path'
diff --git a/test/meson.build b/test/meson.build
deleted file mode 100644
index f3ff324..0000000
--- a/test/meson.build
+++ /dev/null
@@ -1,24 +0,0 @@
-gtest = dependency('gtest', main: true, disabler: true, required: build_tests)
-gmock = dependency('gmock', disabler: true, required: build_tests)
-
-configure_file(output: 'config.h',
- configuration: cdata,
-)
-test_inc = include_directories('.')
-
-test_iei_ipmi_oem = executable(
- 'test_iei-ipmi-oem',
- '../src/iei_oem.cpp',
- 'test_iei_ipmi_oem.cpp',
- 'mocked_utils.cpp',
- 'mocked_sdbus.cpp',
- include_directories: [test_inc, src_inc],
- dependencies: [
- gtest,
- gmock,
- phosphor_logging,
- phosphor_dbus_interfaces,
- sdbusplus,
- ])
-
-test('test_iei-ipmi-oem', test_iei_ipmi_oem)
diff --git a/test/mocked_sdbus.cpp b/test/mocked_sdbus.cpp
deleted file mode 100644
index 0d81853..0000000
--- a/test/mocked_sdbus.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "sdbus_wrapper.hpp"
-
-#include <sdbusplus/test/sdbus_mock.hpp>
-
-#include <memory>
-
-// To support ipmid_get_sd_bus_connection, we have to make the sdbusMock global
-static std::unique_ptr<sdbusplus::SdBusMock> sdbusMock;
-static std::unique_ptr<sdbusplus::bus::bus> mockedBus;
-
-sdbusplus::bus::bus& getBus()
-{
- if (!sdbusMock)
- {
- sdbusMock = std::make_unique<sdbusplus::SdBusMock>();
- }
- mockedBus = std::make_unique<sdbusplus::bus::bus>(
- sdbusplus::get_mocked_new(sdbusMock.get()));
- return *mockedBus.get();
-}
-
-void clearMockedBus()
-{
- sdbusMock.reset();
- mockedBus.reset();
-}
diff --git a/test/mocked_sdbus.hpp b/test/mocked_sdbus.hpp
deleted file mode 100644
index 5d4fcd5..0000000
--- a/test/mocked_sdbus.hpp
+++ /dev/null
@@ -1,3 +0,0 @@
-#pragma once
-
-void clearMockedBus();
diff --git a/test/mocked_utils.cpp b/test/mocked_utils.cpp
deleted file mode 100644
index 31cbd80..0000000
--- a/test/mocked_utils.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "mocked_utils.hpp"
-
-namespace utils
-{
-
-static std::unique_ptr<MockedUtils> utils;
-const UtilsInterface& getUtils()
-{
- if (!utils)
- {
- utils = std::make_unique<MockedUtils>();
- }
- return *utils;
-}
-
-void freeUtils()
-{
- utils.reset();
-}
-
-} // namespace utils
diff --git a/test/mocked_utils.hpp b/test/mocked_utils.hpp
deleted file mode 100644
index 8cd4a43..0000000
--- a/test/mocked_utils.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#pragma once
-
-#include "utils.hpp"
-
-#include <gmock/gmock.h>
-
-namespace utils
-{
-
-class MockedUtils : public UtilsInterface
-{
- public:
- virtual ~MockedUtils() = default;
-
- MOCK_CONST_METHOD3(getService,
- std::string(sdbusplus::bus::bus& bus, const char* path,
- const char* interface));
-
- MOCK_CONST_METHOD3(getServices,
- std::vector<std::string>(sdbusplus::bus::bus& bus,
- const char* path,
- const char* interface));
-
- MOCK_CONST_METHOD5(getPropertyImpl,
- any(sdbusplus::bus::bus& bus, const char* service,
- const char* path, const char* interface,
- const char* propertyName));
-
- MOCK_CONST_METHOD6(setPropertyImpl,
- void(sdbusplus::bus::bus& bus, const char* service,
- const char* path, const char* interface,
- const char* propertyName, ValueType&& value));
-};
-
-const UtilsInterface& getUtils();
-
-void freeUtils();
-
-} // namespace utils
diff --git a/test/test_iei_ipmi_oem.cpp b/test/test_iei_ipmi_oem.cpp
deleted file mode 100644
index bdaf5f0..0000000
--- a/test/test_iei_ipmi_oem.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "config.h"
-
-#include "iei_oem.hpp"
-#include "mocked_sdbus.hpp"
-#include "mocked_utils.hpp"
-#include "sdbus_wrapper.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
-{
-
-void parseBIOSInfo(const std::vector<uint8_t>& data);
-
-}
-
-void ipmi_register_callback(ipmi_netfn_t, ipmi_cmd_t, ipmi_context_t,
- ipmid_callback_t, ipmi_cmd_privilege_t)
-{
- // Empty
-}
-
-class TestIpmiOem : public ::testing::Test
-{
- public:
- TestIpmiOem() :
- mockedUtils(
- reinterpret_cast<const utils::MockedUtils&>(utils::getUtils()))
- {}
- virtual ~TestIpmiOem()
- {
- utils::freeUtils();
- clearMockedBus();
- }
-
- sdbusplus::bus::bus& mockedBus = getBus();
- const utils::MockedUtils& mockedUtils;
-};
-
-TEST_F(TestIpmiOem, Empty)
-{
- // Empty
-}
-
-TEST_F(TestIpmiOem, parseBIOSInfoEmpty)
-{
- EXPECT_CALL(mockedUtils, setPropertyImpl(_, _, _, _, _, _)).Times(0);
- ipmi::parseBIOSInfo({});
-}
-
-TEST_F(TestIpmiOem, parseBIOSInfoValidBIOSVersion)
-{
- std::vector<uint8_t> data{
- 0x00, 0x30, 0x31, 0x2e, 0x30, 0x31, 0x2e, 0x30, 0x31, 0x2e,
- 0x30, 0x31, 0x2e, 0x30, 0x31, 0x00, 0x30, 0x38, 0x2f, 0x31,
- 0x31, 0x2f, 0x32, 0x30, 0x32, 0x30, 0x20, 0x32, 0x30, 0x3a,
- 0x31, 0x39, 0x3a, 0x33, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
- std::string dummyService = "com.test.bios.version";
- std::string expectedVersion = "01.01.01.01.01";
- EXPECT_CALL(mockedUtils,
- getService(_, StrEq(BIOS_OBJPATH), StrEq(VERSION_IFACE)))
- .WillOnce(Return(dummyService));
- EXPECT_CALL(
- mockedUtils,
- setPropertyImpl(_, StrEq(dummyService), StrEq(BIOS_OBJPATH),
- StrEq(VERSION_IFACE), StrEq(VERSION),
- VariantWith<std::string>(StrEq(expectedVersion))))
- .Times(1);
- ipmi::parseBIOSInfo(data);
-}