summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-10-11 10:57:49 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-10-22 09:10:37 -0500
commit213e5c1bf871f509d3aa7691f3f5e559c20fc805 (patch)
tree24d63183167ceec760c2ab02f4f0706804f1f03a
parent42828bd922d6e067089770112de5ec22d2df8ab1 (diff)
downloadphosphor-logging-213e5c1bf871f509d3aa7691f3f5e559c20fc805.tar.gz
phosphor-logging-213e5c1bf871f509d3aa7691f3f5e559c20fc805.zip
PEL: Add 3 more sections to the test PEL data
Several testcases use pelDataFactory() for their PEL data. Add SRC, FailingMTMS, and UserData sections to this data to get some better coverage. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2b09fc94c32df1a6fd5bd3cb96c98dc7c3bcc1f2
-rw-r--r--test/openpower-pels/pel_utils.cpp24
-rw-r--r--test/openpower-pels/pel_utils.hpp3
2 files changed, 25 insertions, 2 deletions
diff --git a/test/openpower-pels/pel_utils.cpp b/test/openpower-pels/pel_utils.cpp
index 0af9bf5..4c94758 100644
--- a/test/openpower-pels/pel_utils.cpp
+++ b/test/openpower-pels/pel_utils.cpp
@@ -66,6 +66,19 @@ const std::vector<uint8_t> srcSectionNoCallouts{
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
' ', ' '};
+std::vector<uint8_t> failingMTMSSection{
+ // Header
+ 0x4D, 0x54, 0x00, 0x1C, 0x01, 0x00, 0x20, 0x00,
+
+ 'T', 'T', 'T', 'T', '-', 'M', 'M', 'M', '1', '2',
+ '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C'};
+
+std::vector<uint8_t> UserDataSection{
+ // Header
+ 0x55, 0x44, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00,
+
+ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
+
const std::vector<uint8_t> srcFRUIdentityCallout{
'I', 'D', 0x1C, 0x1D, // type, size, flags
'1', '2', '3', '4', // PN
@@ -106,7 +119,13 @@ std::vector<uint8_t> pelDataFactory(TestPELType type)
privateHeaderSection.end());
data.insert(data.end(), userHeaderSection.begin(),
userHeaderSection.end());
- data.at(sectionCountOffset) = 2;
+ data.insert(data.end(), srcSectionNoCallouts.begin(),
+ srcSectionNoCallouts.end());
+ data.insert(data.end(), failingMTMSSection.begin(),
+ failingMTMSSection.end());
+ data.insert(data.end(), UserDataSection.begin(),
+ UserDataSection.end());
+ data.at(sectionCountOffset) = 5;
break;
case TestPELType::privateHeaderSection:
data.insert(data.end(), privateHeaderSection.begin(),
@@ -149,6 +168,9 @@ std::vector<uint8_t> pelDataFactory(TestPELType type)
data.insert(data.end(), src.begin(), src.end());
break;
}
+ case TestPELType::failingMTMSSection:
+ data.insert(data.end(), failingMTMSSection.begin(),
+ failingMTMSSection.end());
}
return data;
}
diff --git a/test/openpower-pels/pel_utils.hpp b/test/openpower-pels/pel_utils.hpp
index fb608b8..78c6401 100644
--- a/test/openpower-pels/pel_utils.hpp
+++ b/test/openpower-pels/pel_utils.hpp
@@ -58,7 +58,8 @@ enum class TestPELType
privateHeaderSection,
userHeaderSection,
primarySRCSection,
- primarySRCSection2Callouts
+ primarySRCSection2Callouts,
+ failingMTMSSection
};
/**
OpenPOWER on IntegriCloud