From 213e5c1bf871f509d3aa7691f3f5e559c20fc805 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Fri, 11 Oct 2019 10:57:49 -0500 Subject: 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 Change-Id: I2b09fc94c32df1a6fd5bd3cb96c98dc7c3bcc1f2 --- test/openpower-pels/pel_utils.cpp | 24 +++++++++++++++++++++++- test/openpower-pels/pel_utils.hpp | 3 ++- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'test') 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 srcSectionNoCallouts{ ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}; +std::vector 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 UserDataSection{ + // Header + 0x55, 0x44, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, + + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}; + const std::vector srcFRUIdentityCallout{ 'I', 'D', 0x1C, 0x1D, // type, size, flags '1', '2', '3', '4', // PN @@ -106,7 +119,13 @@ std::vector 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 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 }; /** -- cgit v1.2.1