summaryrefslogtreecommitdiffstats
path: root/src/usr/util/test
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2017-10-25 10:07:40 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2017-11-06 13:06:35 -0500
commit94b12d2ea05031aecf05601575608f781bf9e526 (patch)
treedbccb6dacfa2a63f9bc9d16601262aa997df1687 /src/usr/util/test
parent97f6525326d7ad9fa099be2b503a971c9325f503 (diff)
downloadblackbird-hostboot-94b12d2ea05031aecf05601575608f781bf9e526.tar.gz
blackbird-hostboot-94b12d2ea05031aecf05601575608f781bf9e526.zip
Enable preverified lid loading from pnor and Master Container Lid
Change-Id: Ic6bc381148796c49c928eb1d3586039203eea822 RTC:125304 RTC:178163 CMVC-Prereq: 1036742 CMVC-Prereq: 1037898 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48825 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/util/test')
-rw-r--r--src/usr/util/test/testmclmgr.H71
1 files changed, 66 insertions, 5 deletions
diff --git a/src/usr/util/test/testmclmgr.H b/src/usr/util/test/testmclmgr.H
index 9f425a285..290c73d5c 100644
--- a/src/usr/util/test/testmclmgr.H
+++ b/src/usr/util/test/testmclmgr.H
@@ -32,6 +32,7 @@
#include "../utilbase.H"
#include <usr/vmmconst.h>
#include <runtime/preverifiedlidmgr.H>
+#include <util/util_reasoncodes.H>
namespace MCL
{
@@ -224,9 +225,9 @@ public:
/**
* @brief Test that MCL manager properly parses a MCL
*/
- void testMCLparser(void)
+ void testMclParser(void)
{
- UTIL_FT(ENTER_MRK"testMCLparser start" );
+ UTIL_FT(ENTER_MRK"testMclParser start" );
// Generate test MCL
TestMcl l_TestMcl{};
@@ -237,10 +238,10 @@ public:
// Ensure the Comp Info Caches match
if (l_TestMcl.iv_compInfoCache != l_mcl.iv_compInfoCache)
{
- TS_FAIL("testMCLparser> Comp Info Caches do not match");
+ TS_FAIL("testMclParser> Comp Info Caches do not match");
}
- UTIL_FT(EXIT_MRK"testMCLparser complete");
+ UTIL_FT(EXIT_MRK"testMclParser complete");
}
void testProcessMclComponents()
@@ -291,7 +292,7 @@ public:
errlHndl_t l_errl = nullptr;
// Generate test MCL with Secure Lids
- TestMcl l_TestMcl { {Util::TEST_LIDID, Util::TEST_LIDID},
+ TestMcl l_TestMcl { {Util::TEST_LIDID},
{{COMP_TEST2,true}}
};
@@ -324,6 +325,66 @@ public:
UTIL_FT(EXIT_MRK"testProcessSecureMclComponents complete");
}
+
+ void testMclSizeMismatch()
+ {
+ UTIL_FT(ENTER_MRK"testMclSizeMismatch start" );
+
+ errlHndl_t l_errl = nullptr;
+
+ // Generate test MCL with Secure Lids
+ // Add 2 secure sections.
+ // The secure header for the first one will only have the size of 1 lid
+ // So we will get a mismatch between the Secure header's total container
+ // size and what the UtilLidMgr reads out.
+ TestMcl l_TestMcl { {Util::TEST_LIDID, Util::TEST_LIDID},
+ {{COMP_TEST2,true}}
+ };
+
+ // Pass test MCL to MCL manager
+ MasterContainerLidMgr l_mcl(l_TestMcl.iv_bufferStart,
+ l_TestMcl.iv_size);
+
+ // Ensure the Comp Info Caches match
+ if (l_TestMcl.iv_compInfoCache != l_mcl.iv_compInfoCache)
+ {
+ TS_FAIL("testMclSizeMismatch> Comp Info Caches do not match");
+ }
+
+ PreVerifiedLidMgr::initLock(PREVERLIDMGR_TEST_ADDR);
+
+ // Get Instance of Pre-Verified lid manager
+ auto l_preVerLidMgr = PreVerifiedLidMgr::getInstance();
+
+ // Clear lids loaded cache as other test cases fill it in.
+ l_preVerLidMgr.cv_lidsLoaded.clear();
+
+ l_errl = l_mcl.processComponents();
+ if(l_errl)
+ {
+ // Expected Error
+ if(l_errl->reasonCode() == Util::UTIL_MCL_SIZE_MISMATCH)
+ {
+ delete l_errl;
+ l_errl = nullptr;
+ UTIL_FT("testMclSizeMismatch expected error");
+ }
+ // Not Expected Error
+ else
+ {
+ errlCommit(l_errl,UTIL_COMP_ID);
+ TS_FAIL("testMclSizeMismatch> processComponents returned an unexpected error");
+ }
+ }
+ else
+ {
+ TS_FAIL("testMclSizeMismatch> processComponents did not return expected error");
+ }
+
+ PreVerifiedLidMgr::unlock();
+
+ UTIL_FT(EXIT_MRK"testMclSizeMismatch complete");
+ }
};
#endif \ No newline at end of file
OpenPOWER on IntegriCloud