summaryrefslogtreecommitdiffstats
path: root/src/usr/util/runtime/test
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2014-12-19 14:16:51 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-01-22 17:19:04 -0600
commit32c1363b48266e3c10a37345225d35f06c863073 (patch)
tree37161ddaf45dad2f26dbfb17dac015e05beb4eb3 /src/usr/util/runtime/test
parentf8569146fb30162c9bc9d4730d0476f209071fac (diff)
downloadtalos-hostboot-32c1363b48266e3c10a37345225d35f06c863073.tar.gz
talos-hostboot-32c1363b48266e3c10a37345225d35f06c863073.zip
allow lid to be read from pnor at runtime
RTC:116595 Change-Id: I446c314e6675227293e50121b47d091276b817b0 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15000 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/util/runtime/test')
-rw-r--r--src/usr/util/runtime/test/makefile6
-rw-r--r--src/usr/util/runtime/test/testlidmgr_rt.H57
2 files changed, 60 insertions, 3 deletions
diff --git a/src/usr/util/runtime/test/makefile b/src/usr/util/runtime/test/makefile
index 34fb0964c..1dd45b135 100644
--- a/src/usr/util/runtime/test/makefile
+++ b/src/usr/util/runtime/test/makefile
@@ -5,7 +5,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2013,2014
+# Contributors Listed Below - COPYRIGHT 2013,2015
+# [+] International Business Machines Corp.
+#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -24,7 +26,7 @@ HOSTBOOT_RUNTIME = 1
ROOTPATH = ../../../../..
MODULE = testutil_rt
-
+EXTRAINCDIR += ${ROOTPATH}/src/usr/util/
TESTS = *.H
include $(ROOTPATH)/config.mk
diff --git a/src/usr/util/runtime/test/testlidmgr_rt.H b/src/usr/util/runtime/test/testlidmgr_rt.H
index 47b16605c..451468422 100644
--- a/src/usr/util/runtime/test/testlidmgr_rt.H
+++ b/src/usr/util/runtime/test/testlidmgr_rt.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -23,6 +23,9 @@
/* */
/* IBM_PROLOG_END_TAG */
#include <util/utillidmgr.H>
+#include <cxxtest/TestSuite.H>
+#include <errl/errlmanager.H>
+#include <utilbase.H>
class LidMgrRtTest : public CxxTest::TestSuite
{
@@ -44,4 +47,56 @@ class LidMgrRtTest : public CxxTest::TestSuite
l_errl = NULL;
}
}
+
+ /**
+ * @brief Test to check if the structure that maps lidID's to pnor
+ * sections is working correctly
+ */
+ void testLidInPnor(void)
+ {
+ errlHndl_t l_errl = NULL;
+
+ do
+ {
+ size_t l_lidSize = 0;
+
+ UtilLidMgr l_lidMgr(Util::TEST_LIDID);
+
+ PNOR::SectionInfo_t l_lidPnorInfo;
+ l_errl = PNOR::getSectionInfo(PNOR::TEST, l_lidPnorInfo);
+ // Section only present in openPOWER systems
+ if (l_errl)
+ {
+ delete l_errl;
+ l_errl = NULL;
+ break;
+ }
+
+ l_errl = l_lidMgr.getLidSize(l_lidSize);
+ if(l_errl)
+ {
+ errlCommit(l_errl,UTIL_COMP_ID);
+ TS_FAIL("testLidInPnor: Error getting lidId=0x%.8x",
+ Util::TEST_LIDID);
+ break;
+ }
+
+ if (l_lidSize != l_lidPnorInfo.size)
+ {
+ TS_FAIL("testLidInPnor: lidSize does not match pnor TEST"
+ " section size 0x%.8X != 0x%.8X",
+ l_lidSize, l_lidPnorInfo.size);
+ break;
+ }
+
+ char * l_ptr = new char[l_lidPnorInfo.size];
+ l_errl = l_lidMgr.getLid(l_ptr, l_lidPnorInfo.size);
+ if(l_errl)
+ {
+ errlCommit(l_errl, UTIL_COMP_ID);
+ TS_FAIL("testLidInPnor: failed to get lid from PNOR");
+ }
+ delete[] l_ptr;
+ }while(0);
+ }
};
OpenPOWER on IntegriCloud