From c8705e2bfcc7582fb7dc89ac1598489712c006f3 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Wed, 11 Sep 2019 12:36:07 -0500 Subject: PEL: Interface to collect system data There are PEL fields that contain information that must be obtained from various places throughout the BMC, such as the machine type/model/SN from VPD, a few types of codes levels, etc. Create a DataInterface class that will provide the APIs for collecting this information. It has an abstract base class so that its functions can be mocked to return specific data in test cases. This commit provides APIs to read and present the machine type-model and machine serial number. These will be used in the FailingMTM and ExtendedUserHeader PEL sections. Signed-off-by: Matt Spinler Change-Id: Iec41fea8d9510ba711475154f019bd59f0028d2e --- test/openpower-pels/Makefile.include | 1 + test/openpower-pels/pel_manager_test.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/openpower-pels/Makefile.include b/test/openpower-pels/Makefile.include index 51f3ecc..124970d 100644 --- a/test/openpower-pels/Makefile.include +++ b/test/openpower-pels/Makefile.include @@ -101,6 +101,7 @@ pel_manager_test_CXXFLAGS = $(test_cxxflags) pel_manager_test_LDADD = \ $(test_ldadd) \ $(pel_objects) \ + $(top_builddir)/extensions/openpower-pels/data_interface.o \ $(top_builddir)/extensions/openpower-pels/manager.o \ $(top_builddir)/extensions/openpower-pels/repository.o pel_manager_test_LDFLAGS = $(test_ldflags) diff --git a/test/openpower-pels/pel_manager_test.cpp b/test/openpower-pels/pel_manager_test.cpp index 9d788c9..0a82141 100644 --- a/test/openpower-pels/pel_manager_test.cpp +++ b/test/openpower-pels/pel_manager_test.cpp @@ -27,8 +27,10 @@ TEST_F(ManagerTest, TestCreateWithPEL) { auto bus = sdbusplus::bus::new_default(); phosphor::logging::internal::Manager logManager(bus, "logging_path"); + std::unique_ptr dataIface = + std::make_unique(bus); - openpower::pels::Manager manager{logManager}; + openpower::pels::Manager manager{logManager, std::move(dataIface)}; // Create a PEL, write it to a file, and pass that filename into // the create function. -- cgit v1.2.1