diff options
author | Matt Ploetz <maploetz@us.ibm.com> | 2017-03-28 11:27:00 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2017-04-20 14:46:43 -0400 |
commit | 4123391467fb0ddaee6d4239ec19c8b42712eaf5 (patch) | |
tree | 2a39b06b0585c615845fcf62d0ab09ffdb353e0c /src/usr/errl | |
parent | 6a14dc6b0fea1b8ddb96cacff8ef19efdcc86c7b (diff) | |
download | talos-hostboot-4123391467fb0ddaee6d4239ec19c8b42712eaf5.tar.gz talos-hostboot-4123391467fb0ddaee6d4239ec19c8b42712eaf5.zip |
Skip callouts if error log is informational
Change-Id: Iadee72553fd4d1829b82f8549cfd42b253cb3301
RTC:169696
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38531
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>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/errl')
-rw-r--r-- | src/usr/errl/test/errltest.H | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/src/usr/errl/test/errltest.H b/src/usr/errl/test/errltest.H index 9dace8d04..eb756f4f0 100644 --- a/src/usr/errl/test/errltest.H +++ b/src/usr/errl/test/errltest.H @@ -933,7 +933,147 @@ public: while(0); #endif } + /** + * @brief Test No Gard on Informational error logs + */ + void testdeconfigNoGardInformational() + { +#if 1 + // these tests deconfigure and gard targets. and even tho they + // restore their state after the tests, since the cxxtests are + // all run in parallel, during the time that a target is non- + // functional due to this test, another test may be running that + // might be adversly affected. + // tests are left in the code so that a developer can enable them + // to test these specific functions - just keep in mind that there + // could be side effects in other cxxtests. + TS_TRACE( " - SKIPPING -- other tests could be adversly affected"); +#else + do + { + // find a ex unit that we can play with + TARGETING::Target * pSys; + TARGETING::targetService().getTopLevelTarget(pSys); + + TARGETING::PredicateCTM predEx(TARGETING::CLASS_UNIT, TARGETING::TYPE_EX); + TARGETING::PredicateHwas predFunctional; + predFunctional.poweredOn(true).present(true).functional(true); + TARGETING::PredicatePostfixExpr checkExpr; + checkExpr.push(&predEx).push(&predFunctional).And(); + TARGETING::TargetHandleList pExList; + TARGETING::targetService().getAssociated( pExList, pSys, + TARGETING::TargetService::CHILD, TARGETING::TargetService::ALL, &checkExpr ); + + if (pExList.empty()) + { + TS_FAIL("testdeconfigNoGardInformational: empty pExList"); + break; + } + + errlHndl_t errl = NULL; + HWAS::DeconfigGard::DeconfigureRecords_t l_deconfigRecords; + HWAS::DeconfigGard::GardRecords_t l_gardRecords; + HWAS::DeconfigGard::DeconfigureRecords_t l_deconfigRecordsAfter; + HWAS::DeconfigGard::GardRecords_t l_gardRecordsAfter; + // make sure there aren't any existing deconfigure or gard records + errl = HWAS::theDeconfigGard()._getDeconfigureRecords(NULL, + l_deconfigRecords); + if (errl) + { + TS_FAIL("testdeconfigNoGardInformational: Error from " + "_getDeconfigureRecords"); + errlCommit(errl,HWAS_COMP_ID); + break; + } + if (l_deconfigRecords.size() != 0) + { + TS_INFO("testdeconfigNoGardInformational: %d existing " + "Deconfigure Records, skipping test", + l_deconfigRecords.size()); + break; + } + + errl = HWAS::theDeconfigGard().getGardRecords( + NULL, l_gardRecords); + if (errl) + { + TS_FAIL("testdeconfigNoGardInformational: Error from " + "getGardRecords"); + errlCommit(errl,HWAS_COMP_ID); + break; + } + if (l_gardRecords.size() != 0) + { + TS_INFO("testdeconfigNoGardInformational: %d existing " + "GARD Records, skipping test", l_gardRecords.size()); + break; + } + + errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + ERRORLOG::ERRL_TEST_MOD_ID, + ERRORLOG::ERRL_TEST_REASON_CODE); + + + // Part callout using deconfig/GARD parameters + errl->addHwCallout( + pExList[0], + HWAS::SRCI_PRIORITY_LOW, + HWAS::DECONFIG, + HWAS::GARD_Fatal); + + errlCommit(errl, CXXTEST_COMP_ID); + + // Flush out errorlogs so we make sure deconfigs/gards are logged + // before we check for them + ERRORLOG::ErrlManager::callFlushErrorLogs(); + + // Check gard and deconfigs - should be none. + errlHndl_t gard_errl = NULL; + + gard_errl = HWAS::theDeconfigGard()._getDeconfigureRecords(NULL, + l_deconfigRecordsAfter); + + if (gard_errl) + { + TS_FAIL("testdeconfigNoGardInformational: Error from " + "_getDeconfigureRecords - post deconfigs"); + errlCommit(errl,HWAS_COMP_ID); + break; + } + if (l_deconfigRecordsAfter.size() != l_deconfigRecords.size()) + { + TS_INFO("testdeconfigNoGardInformational: %d " + "Deconfigure Records, expecting none. TEST FAILED", + l_deconfigRecordsAfter.size()); + TS_FAIL("testdeconfigNoGardInformational: Deconfig records " + "present, expecting none."); + break; + } + + gard_errl = HWAS::theDeconfigGard().getGardRecords( + NULL, l_gardRecordsAfter); + + if (gard_errl) + { + TS_FAIL("testdeconfigNoGardInformational: Error from " + "getGardRecords - post deconfigs"); + errlCommit(errl,HWAS_COMP_ID); + break; + } + if (l_gardRecords.size() != l_gardRecordsAfter.size()) + { + TS_INFO("testdeconfigNoGardInformational: %d GARD Records " + "present, expecting none. TEST FAILED", + l_gardRecordsAfter.size()); + TS_FAIL("testdeconfigNoGardInformational: GARD records " + "present, expecting none."); + break; + } + }while(0); +#endif + } }; } |