summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-01-06 15:34:25 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-01-17 13:52:41 -0500
commit9210adf7289e68243ce181f24ce2dd6225228375 (patch)
treee8b1f78d82bda5608fbec6b9527f51196ff7d148 /src/usr/fapi2
parentec6e46d87faca9cada3a365d2e0c8a125875ad90 (diff)
downloadtalos-hostboot-9210adf7289e68243ce181f24ce2dd6225228375.tar.gz
talos-hostboot-9210adf7289e68243ce181f24ce2dd6225228375.zip
Improve testcase for MR data
Needed a way to verify the FFDC from the HWP call so I added a failure path. I also fixed the test data and a bad if check that didn't notice a change to the data format. Change-Id: I2b5428099ddbd9fc85ee40b77820c3c927a70029 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/34524 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2')
-rw-r--r--src/usr/fapi2/test/getVpdTest.C61
1 files changed, 44 insertions, 17 deletions
diff --git a/src/usr/fapi2/test/getVpdTest.C b/src/usr/fapi2/test/getVpdTest.C
index 93f9bb524..81114d8ee 100644
--- a/src/usr/fapi2/test/getVpdTest.C
+++ b/src/usr/fapi2/test/getVpdTest.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,6 +39,7 @@
#include <getVpdTest.H>
#include <p9_get_mem_vpd_keyword.H>
#include <attribute_service.H>
+#include <errl/errlmanager.H>
//The following commented out section can be restored for unit testing
//#undef FAPI_DBG
@@ -204,27 +205,30 @@ void testDecode_MR(void)
// set up VPDInfo
fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> l_info(fapi2::MR);
- l_info.iv_freq_mhz = 2133; // index = 0
+ l_info.iv_freq_mhz = 2133; // bit1
l_info.iv_rank_count_dimm_0 = 1;
l_info.iv_rank_count_dimm_1 = 4;
fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;
// set up the mapping data
uint8_t l_pMapping[VPD_KEYWORD_SIZE] = {
- // Header: version=1, num entries=5, reserved
- 1,5,0,
- // miss: mcs match, pair match, freq miss
- 0xff,0xff,0xff,0xff,0x7f,'0',
- // miss: mcs match, pair missing, freq match
- 0xff,0xff,0xfe,0xff,0xff,'1',
- // miss: mcs miss, pair match, freq match
- 0x7f,0xff,0xff,0xff,0xff,'2',
- // match:
- 0x80,0x00,0x01,0x00,0x80,'3', // <-- should be this one
- // match everything
- 0xff,0xff,0xff,0xff,0xff,'4',
- // zero out rest
- 0};
+ // Header: version=1, num entries=5, reserved
+ 1,5,0,
+ //Rows are : mcs,mcs, rank,rank, freq, kw
+
+ // miss: mcs match, pair match, freq miss
+ 0xff,0xff,0xff,0xff,0x80,'0',
+ // miss: mcs match, pair missing, freq match
+ 0xff,0xff,0xfe,0xff,0x40,'1',
+ // miss: mcs miss, pair match, freq match
+ 0x7f,0xff,0xff,0xff,0xff,'2',
+ // match:
+ 0x80,0x00,0x01,0x00,0x40,'3', // <-- should be this one
+ // match everything
+ 0xff,0xff,0xff,0xff,0xff,'4',
+ // zero out rest
+ 0
+ };
// decode keyword
keywordInfo_t l_keywordInfo = {0};
@@ -246,7 +250,7 @@ void testDecode_MR(void)
// compare to expected test data
numTests++;
- if ( (l_keywordInfo.kwName[0] != 'J' ) &&
+ if ( (l_keywordInfo.kwName[0] != 'J' ) ||
(l_keywordInfo.kwName[1] != '3' ) )
{
TS_FAIL ("testDecode_MR:: unexpected keyword name returned"
@@ -255,6 +259,29 @@ void testDecode_MR(void)
numFails++;
}
+ // force a bad path by removing good entry
+ l_pMapping[1] = 3; //num entries
+ l_keywordInfo = {0};
+ numTests++;
+
+ FAPI_EXEC_HWP(l_rc,
+ p9_get_mem_vpd_keyword,
+ l_fapiTarget,
+ l_info,
+ l_pMapping,
+ VPD_KEYWORD_SIZE,
+ l_keywordInfo);
+ if(!l_rc)
+ {
+ TS_FAIL("testDecode_MR:: p9_get_mem_vpd_keyword did not fail as expected");
+ FAPI_INF("testDecode_MR> keyword=%c%c", l_keywordInfo.kwName[0], l_keywordInfo.kwName[1] );
+ numFails++;
+ break; // decode failed
+ }
+ // commit the log so we can inspect the FFDC manually
+ errlHndl_t l_err = fapi2::rcToErrl(l_rc);
+ errlCommit( l_err, CXXTEST_COMP_ID );
+
}
while(0);
OpenPOWER on IntegriCloud