diff options
| author | Paul Nguyen <nguyenp@us.ibm.com> | 2012-10-03 13:57:02 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-10-30 14:05:30 -0500 |
| commit | bc18309697f7a711b04736a4260094377b33f478 (patch) | |
| tree | c661d34edf0e77ad7968760053cad481ec95c9c5 /src/usr/errl/test | |
| parent | c7f00b4ca316fa8296f350cddb7149c09fa21551 (diff) | |
| download | talos-hostboot-bc18309697f7a711b04736a4260094377b33f478.tar.gz talos-hostboot-bc18309697f7a711b04736a4260094377b33f478.zip | |
Report host boot error log to FSP
Change-Id: Iad4be4f0a45a607f7b56fc5d194f1812f74fbfe8
RTC: 34235
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1949
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@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/errl/test')
| -rw-r--r-- | src/usr/errl/test/errlReportTest.H | 269 |
1 files changed, 269 insertions, 0 deletions
diff --git a/src/usr/errl/test/errlReportTest.H b/src/usr/errl/test/errlReportTest.H new file mode 100644 index 000000000..2114a77ce --- /dev/null +++ b/src/usr/errl/test/errlReportTest.H @@ -0,0 +1,269 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/errl/test/errlReportTest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __ERRLREPORTTEST_H +#define __ERRLREPORTTEST_H + +/** + * @file errlReportTest.H + * + * @brief Test case for Error Logging Reporting +*/ + +#include <cxxtest/TestSuite.H> +#include <errl/errlmanager.H> +#include <errl/errlentry.H> +#include <errl/errlreasoncodes.H> +#include <trace/trace.H> +#include <hbotcompid.H> +#include <errl/errludtarget.H> +#include <targeting/common/target.H> +#include <targeting/common/iterators/rangefilter.H> +#include <targeting/common/predicates/predicates.H> +#include <hwas/common/hwasCallout.H> +#include <kernel/syscalls.H> +#include <sys/time.h> + + +class ErrlReportTest: public CxxTest::TestSuite +{ +public: + + /** + * @brief Send a small size error log to FSP + * - Create an error log with only 192 bytes + * - Verify that hostbot created error log and sent it to FSP + * - Found an issue with FSI mailbox DMA code to realign data len + * - The problem should be fixed in Feature 855338 (fips810) + */ + + void testErrlReport1(void) + { + errlHndl_t l_err = NULL; + uint64_t l_userData1 = 0xDEADBEEF; + uint64_t l_userData2 = 0xDEADBEEF; + + TS_TRACE( "test testErrlReport1"); + do + { + // Create an error log + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + HBERRL_TEST_MOD_ID, + HBERRL_TEST_REASON_CODE, + l_userData1, + l_userData2); + if (l_err == NULL) + { + TS_FAIL("testErrlReport1: createErrlLog() failed."); + break; + } + + // Commit error log. + errlCommit(l_err, CXXTEST_COMP_ID); + + } while(0); + } + + + /** + * @brief Send multiple error logs back to back to FSP + * - Create several error logs and send them to FSP in a loop. + * - Verify that error logs are created and sent to FSP + * - Verify that FSP received all the error logs and log them properly. + */ + void testErrlReport2( void ) + { + errlHndl_t l_err = NULL; + uint32_t l_loopi = 0 ; + + TS_TRACE( "test testErrlReport2"); + + do + { + for (l_loopi = 0; l_loopi < 5; l_loopi++) + { + + // Create an error log + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + HBERRL_TEST_MOD_ID, + HBERRL_TEST_REASON_CODE, + l_loopi, + l_loopi); + if (l_err == NULL) + { + TS_FAIL("testErrlReport2: createErrlLog() failed."); + break; + } + + // Commit error log + errlCommit(l_err, CXXTEST_COMP_ID); + } + } while(0); + } + + + + /** + * @brief Send an unrecoverable error log to FSP + * - Verify that an error log with severity unrecoverable created successfully + * - Verify that the error log is sent to FSP + * - Verify that FSP log the error as unrecoverable one. + * + */ + + void testErrlReport3(void) + { + errlHndl_t l_err = NULL; + uint64_t l_userData1 = 0xEEEEEEEE; + uint64_t l_userData2 = 0xEEEEEEEE; + + TS_TRACE( "test testErrlReport3"); + do + { + // Create an error log + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + HBERRL_TEST_MOD_ID, + HBERRL_TEST_REASON_CODE, + l_userData1, + l_userData2); + if (l_err == NULL) + { + TS_FAIL("testErrlReport3: createErrlLog() failed"); + break; + } + + // Commit error log. + errlCommit(l_err, CXXTEST_COMP_ID); + } while(0); + } + + + /** + * @brief Send a critical system terminate error log from Hostboot to FSP + * - Verify that hostbot errorlog is sent to FSP. + * - Verify that FSP logged the error as critical system terminate one. + * + */ + + void testErrlReport4(void) + { + errlHndl_t l_err = NULL; + uint64_t l_userData1 = 0xAAAAAAAA; + uint64_t l_userData2 = 0xBBBBBBBB; + + TS_TRACE( "test testErrlReport4"); + do + { + // Create an error log + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, + HBERRL_TEST_MOD_ID, + HBERRL_TEST_REASON_CODE, + l_userData1, + l_userData2); + if (l_err == NULL) + { + TS_FAIL("testErrlReport4: createErrlLog() failed."); + break; + } + + // Commit error log. + errlCommit(l_err, CXXTEST_COMP_ID); + } while(0); + } + + /** + * @brief Send a big size error log to FSP + * - Verfiy that an error log with ffdc and traces is created successfully + * - Verify that the error log is sent to FSP + * - Verify that FSP logged the error with correct data successfully + */ + void testErrlReport5(void) + { + bool l_rc; + ERRORLOG::ErrlUD * pffdc; + uint64_t l_userData1 = 0xFFFFFFFF; + uint64_t l_userData2 = 0xFFFFFFFF; + + TS_TRACE( "test testErrlReport5"); + do + { + // Create an error log + errlHndl_t l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + HBERRL_TEST_MOD_ID, + HBERRL_TEST_REASON_CODE, + l_userData1, + l_userData2); + + + // Make sure log is created + if (l_err == NULL) + { + TS_FAIL("testErrlReport5: createErrlLog() failed"); + break; + } + + // add FFDC + const char * l_str = "Error log report testing."; + pffdc = l_err->addFFDC( DEVFW_COMP_ID, l_str, strlen( l_str ), 0, 0); + if ( NULL == pffdc ) + { + TS_FAIL("testErrlReport5: addFFDC() failed"); + break; + } + + // Collect traces + l_rc = l_err->collectTrace( "XSCOM" , 0x7D0 ); + if( !l_rc ) + { + TS_FAIL( "testErrlReport5: collectTrace(XSCOM) returns false." ); + break; + } + + l_rc = l_err->collectTrace( "TARG" , 4003 ); + if( !l_rc ) + { + TS_FAIL( "testErrlReport5: collectTrace(TARG,4003) returns false" ); + break; + } + + // Add null data. + pffdc = l_err->addFFDC( HBERRL_COMP_ID, NULL, 0, 9, 10 ); + if ( NULL != pffdc ) + { + TS_FAIL(" addFFDC() returned non null"); + break; + } + + // Commit error log. + errlCommit(l_err, CXXTEST_COMP_ID); + + } while(0); + } + +}; + +#endif |

