summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas/test
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2018-06-06 13:26:03 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-06-07 23:37:23 -0400
commit3e4082b28d2afb5341ea8a7a1dda642eb4461d53 (patch)
treedcee5ed8ff3fa75dff677cb0b182f14264be8d9c /src/usr/hwas/test
parent8e9be410090ddccd61e0967d07d6163adc7e728e (diff)
downloadtalos-hostboot-3e4082b28d2afb5341ea8a7a1dda642eb4461d53.tar.gz
talos-hostboot-3e4082b28d2afb5341ea8a7a1dda642eb4461d53.zip
Look for any parent on deconfigure
There are error scenarios where a unit can get deconfigured and its parent is not considered present. This can lead to errors in the deconfig by association logic because a unit should always have a present parent. This change has the deconfig logic just find the parent. If it's considered not present or not functional then the code can handle that, it just needs the parent target. This commit also fixes a bug found in testing in the DIMM deconfig by association path. Change-Id: I98c4185192a0944543cc545277504b50bd951c3e CQ: SW431931 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60053 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/hwas/test')
-rw-r--r--src/usr/hwas/test/hwasGardTest.H103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H
index bc74bfca4..0e644b9eb 100644
--- a/src/usr/hwas/test/hwasGardTest.H
+++ b/src/usr/hwas/test/hwasGardTest.H
@@ -39,6 +39,7 @@
#include <cxxtest/TestSuite.H>
#include <errl/errlmanager.H>
#include <targeting/common/targetservice.H>
+#include <targeting/common/utilFilter.H>
#include <hwas/common/hwas.H>
#include <hwas/common/deconfigGard.H>
#include <hwas/common/hwas_reasoncodes.H>
@@ -1197,6 +1198,108 @@ public:
}
/**
+ * @brief Test Deconfiguring by Association
+ *
+ * Ensure that if a parent of an MBA being deconfigured is not present
+ * (due to some other bug) that the deconfig by association code properly
+ * handles it.
+ *
+ */
+ void testDeconfigureAssoc6()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssoc6: Started");
+#if DISABLE_MEM_UNIT_TESTS
+ // these tests deconfigure and gard targets. and even though 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");
+ HWAS_INF("testDeconfigureAssoc6: Skipped");
+#else
+ HWAS_INF("testDeconfigureAssoc6: Started");
+
+ errlHndl_t l_pErr = NULL;
+
+ do
+ {
+ // find an MEMBUF
+ Target * pSys;
+ targetService().getTopLevelTarget(pSys);
+
+ PredicateCTM predMembuf(CLASS_CHIP, TYPE_MEMBUF);
+ PredicateHwas predFunctional;
+ predFunctional.poweredOn(true).present(true).functional(true);
+ PredicatePostfixExpr checkExpr;
+ checkExpr.push(&predMembuf).push(&predFunctional).And();
+ TargetHandleList pMembuf;
+ targetService().getAssociated( pMembuf, pSys,
+ TargetService::CHILD, TargetService::ALL, &checkExpr );
+
+ if (pMembuf.empty())
+ {
+ TS_FAIL("testDeconfigureAssoc6: empty pMembuf");
+ break;
+ }
+ TargetHandle_t l_pTarget = *pMembuf.begin();
+
+ // Get the original HWAS_STATE of the target
+ HwasState l_origState = l_pTarget->getAttr<ATTR_HWAS_STATE>();
+
+ // Get it's parent DMI target
+ TargetHandleList pParentDmiList;
+ getParentAffinityTargetsByState(pParentDmiList, l_pTarget,
+ CLASS_UNIT, TYPE_DMI, UTIL_FILTER_PRESENT);
+ if (pParentDmiList.empty())
+ {
+ TS_FAIL("testDeconfigureAssoc6: empty pParentDmiList");
+ break;
+ }
+ TargetHandle_t l_parentTgt = *pParentDmiList.begin();
+
+ // Save off parent state and set to not present
+ HwasState l_parOrigState = l_parentTgt->getAttr<ATTR_HWAS_STATE>();
+ HwasState l_parTestState = l_parOrigState;
+ l_parTestState.present = 0;
+ l_parentTgt->setAttr<ATTR_HWAS_STATE>(l_parTestState);
+
+ // Deconfigure the target.
+ l_pErr = theDeconfigGard().
+ deconfigureTarget(*l_pTarget, 0xA2);
+ if (l_pErr)
+ {
+ TS_FAIL("testDeconfigureAssoc6: Error from deconfigureTarget");
+ break;
+ }
+
+ // Get the new HWAS_STATE of the target
+ HwasState l_state = l_pTarget->getAttr<ATTR_HWAS_STATE>();
+
+ if (l_state.functional)
+ {
+ TS_FAIL("testDeconfigureAssoc6: target functional after deconfigure");
+ break;
+ }
+
+ // Reset the HWAS_STATE of the target and it's parent
+ l_pTarget->setAttr<ATTR_HWAS_STATE>(l_origState);
+ l_parentTgt->setAttr<ATTR_HWAS_STATE>(l_parOrigState);
+
+ TS_TRACE(INFO_MRK "testDeconfigureAssoc6: Success");
+ }
+ while (0);
+
+ if (l_pErr)
+ {
+ errlCommit(l_pErr,HWAS_COMP_ID);
+ }
+#endif
+ }
+
+ /**
* @brief Test EX with no good cores should be deconfigured
*/
void testDeConfigEX2BadCores()
OpenPOWER on IntegriCloud