summaryrefslogtreecommitdiffstats
path: root/src/usr/vpd/test
diff options
context:
space:
mode:
authorDean Sanner <dsanner@us.ibm.com>2014-12-09 13:21:28 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-02-19 14:28:00 -0600
commit7859f0c8e486326308c3f17200ca5ada75b71a98 (patch)
treefb49916cf4b7d73d342fa6b4d415ae406104451d /src/usr/vpd/test
parent42cfb07e424a01af1504553975503e91aee7ab98 (diff)
downloadtalos-hostboot-7859f0c8e486326308c3f17200ca5ada75b71a98.tar.gz
talos-hostboot-7859f0c8e486326308c3f17200ca5ada75b71a98.zip
Add proc vpd to devtree
Change-Id: Ic5bcb3020f68897fec7000238cda712336e94edc RTC: 120893 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14877 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/vpd/test')
-rwxr-xr-xsrc/usr/vpd/test/mvpdtest.H128
-rwxr-xr-xsrc/usr/vpd/test/spdtest.H4
2 files changed, 129 insertions, 3 deletions
diff --git a/src/usr/vpd/test/mvpdtest.H b/src/usr/vpd/test/mvpdtest.H
index b89bc3637..bec5abcdd 100755
--- a/src/usr/vpd/test/mvpdtest.H
+++ b/src/usr/vpd/test/mvpdtest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2014 */
+/* Contributors Listed Below - COPYRIGHT 2013,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -218,6 +218,17 @@ mvpdTestData mvpdData[] =
{ MVPD::MER0, MVPD::pdI },
};
+VPD::vpdRecord mvpdRecordData[] =
+{
+ MVPD::CP00,
+ MVPD::LRP4,
+ MVPD::LRP5,
+ MVPD::VINI,
+ MVPD::VWML,
+ MVPD::MER0,
+};
+
+
void getProcTargets( TargetHandleList & o_procList )
{
// Get top level system target
@@ -386,6 +397,121 @@ class MVPDTest: public CxxTest::TestSuite
}
/**
+ * @brief This function will test MVPD reads.
+ */
+ void testMvpdReadRecords ( void )
+ {
+ errlHndl_t err = NULL;
+ uint64_t cmds = 0x0;
+ uint64_t fails = 0x0;
+ uint64_t theRecord = 0x0;
+
+ TRACFCOMP( g_trac_vpd,
+ ENTER_MRK"testMvpdReadRecords()" );
+
+ do
+ {
+ TARGETING::Target * theTarget = getFunctionalProcTarget();
+ if(theTarget == NULL)
+ {
+ TS_FAIL("testMvpdReadRecords() - No Functional Targets found!");
+ break;
+ }
+
+ uint8_t * theData = NULL;
+ size_t theSize = 0;
+ const uint32_t numCmds =
+ sizeof(mvpdRecordData)/sizeof(mvpdRecordData[0]);
+ for( uint32_t curCmd = 0; curCmd < numCmds; curCmd++ )
+ {
+ cmds++;
+ theRecord = (uint64_t)mvpdRecordData[curCmd];
+ err = deviceRead( theTarget,
+ NULL,
+ theSize,
+ DEVICE_MVPD_ADDRESS( theRecord,
+ MVPD::FULL_RECORD ));
+
+ if( err )
+ {
+ fails++;
+ TRACFCOMP( g_trac_vpd,
+ ERR_MRK"testMvpdReadRecords() - failure"
+ " reading record size!! rec: 0x%04x",
+ theRecord);
+ TS_FAIL("testMvpdReadRecords() -Failure reading keyword size!");
+ errlCommit( err,
+ VPD_COMP_ID );
+ continue;
+ }
+
+ //Check for zero size, don't have a reliable way to check for too big
+ if( 0 == theSize )
+ {
+ fails++;
+ TRACFCOMP( g_trac_vpd,
+ ERR_MRK"testMvpdReadRecords() - failure"
+ " reading record 0x%04x had size of zero!",
+ theRecord);
+ TS_FAIL("testMvpdReadRecords() -Failure on keyword size of zero!");
+ continue;
+ }
+
+ theData = static_cast<uint8_t*>(malloc( theSize ));
+
+ // Read record/keyword pair
+ err = deviceRead( theTarget,
+ theData,
+ theSize,
+ DEVICE_MVPD_ADDRESS( theRecord,
+ MVPD::FULL_RECORD ));
+
+ if( err )
+ {
+ fails++;
+ TRACFCOMP( g_trac_vpd,
+ ERR_MRK"testMvpdReadRecords() - Failure on"
+ " Record: 0x%04x of size: 0x%04x - test %d",
+ theRecord,
+ theSize, curCmd );
+ TS_FAIL( "testMvpdReadRecords() - Failure during MVPD read!" );
+ errlCommit( err,
+ VPD_COMP_ID );
+
+ // Free the data
+ if( NULL != theData )
+ {
+ free( theData );
+ theData = NULL;
+ }
+ continue;
+ }
+
+ TRACDCOMP( g_trac_vpd,
+ INFO_MRK"testMvpdRead Results:" );
+ for( uint32_t i = 0; i < theSize; i++ )
+ {
+ TRACDCOMP( g_trac_vpd,
+ INFO_MRK" Byte[%d]: 0x%02x",
+ i, theData[i] );
+ }
+
+ // Free the data
+ if( NULL != theData )
+ {
+ free( theData );
+ theData = NULL;
+ }
+ }
+ } while( 0 );
+
+ TRACFCOMP( g_trac_vpd,
+ "testMvpdReadRecords - %d/%d fails",
+ fails, cmds );
+ }
+
+
+ /**
* @brief This function will test MVPD writes.
*/
void testMvpdWrite ( void )
diff --git a/src/usr/vpd/test/spdtest.H b/src/usr/vpd/test/spdtest.H
index c94e8af98..bc7ebbd5c 100755
--- a/src/usr/vpd/test/spdtest.H
+++ b/src/usr/vpd/test/spdtest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2014 */
+/* Contributors Listed Below - COPYRIGHT 2013,2015 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -737,7 +737,7 @@ class SPDTest: public CxxTest::TestSuite
// Test on first DIMM only.
theTarget = dimmList[0];
//If theData is NULL, deviceRead will return the size
- // need to give this an arbitrary size so test is still valid`
+ // need to give this an arbitrary size so test is still valid
uint8_t * theData = static_cast<uint8_t*>(malloc( 0x1 ));
size_t theSize = 0x0; // Invalid size of 0x0
OpenPOWER on IntegriCloud