summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas/test
diff options
context:
space:
mode:
authorRick Ward <rward15@us.ibm.com>2018-03-29 13:47:19 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-04-04 10:47:20 -0400
commitad517636c3d03b685abc57a5eb3a54ce22c8f2e8 (patch)
treea4de939449aa526cbee6239a5fcb44fb2455a5f5 /src/usr/hwas/test
parent3a4e19354e06e9ff07a11aac205164ac21a5509d (diff)
downloadtalos-hostboot-ad517636c3d03b685abc57a5eb3a54ce22c8f2e8.tar.gz
talos-hostboot-ad517636c3d03b685abc57a5eb3a54ce22c8f2e8.zip
Verify deconfig-by-association assumptions still apply to CDIMM scenario.
Corrected the deconfig code so that it will only deconfig a MBA if all of its DIMMs have been deconfig'd. Added a testcase to confirm the behavior. Change-Id: Iaf1111073c7229e3d3b72f17b9b905dd244ceb9a RTC: 176408 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56481 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: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: SWATHI M. BHATTIPROLU <bhmadhur@in.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/hwas/test')
-rw-r--r--src/usr/hwas/test/hwasGardTest.H118
1 files changed, 117 insertions, 1 deletions
diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H
index 5a5486c27..7d1fcc5fa 100644
--- a/src/usr/hwas/test/hwasGardTest.H
+++ b/src/usr/hwas/test/hwasGardTest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2017 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -1060,6 +1060,122 @@ public:
#endif
}
+ /**
+ * @brief Test Deconfiguring by Association
+ */
+ void testDeconfigureAssoc5()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssoc5: Started");
+#if 1
+ // 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 adversely 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 adversely affected");
+#else
+
+ errlHndl_t l_pErr = NULL;
+
+ do
+ {
+ // find a MBA, deconfigure the attached DIMMs
+ Target * pSys;
+ targetService().getTopLevelTarget(pSys);
+
+ PredicateCTM predMba(CLASS_UNIT, TYPE_MBA);
+ PredicateHwas predFunctional;
+ predFunctional.poweredOn(true).present(true).functional(true);
+ PredicatePostfixExpr funcMbas;
+ funcMbas.push(&predMba).push(&predFunctional).And();
+
+ TargetHandleList pMbaList;
+ targetService().getAssociated(pMbaList, pSys,
+ TargetService::CHILD, TargetService::ALL,
+ &funcMbas);
+
+ if (pMbaList.empty())
+ {
+ TS_FAIL("testDeconfigureAssoc5: empty MBA list");
+ break;
+ }
+ TargetHandle_t l_pMba = pMbaList[0];
+
+ // Get the original HWAS_STATE of the MBA
+ HwasState l_origState = l_pMba->getAttr<ATTR_HWAS_STATE>();
+
+ // find all DIMM targets
+ PredicateCTM predDimm(CLASS_LOGICAL_CARD, TYPE_DIMM);
+ PredicatePostfixExpr funcDimms;
+ funcDimms.push(&predDimm).push(&predFunctional).And();
+ TargetHandleList pDimmList;
+ targetService().getAssociated(pDimmList, l_pMba,
+ TargetService::CHILD_BY_AFFINITY, TargetService::ALL,
+ &funcDimms);
+ if (pDimmList.empty())
+ {
+ TS_FAIL("testDeconfigureAssoc5: empty DIMM list");
+ break;
+ }
+
+ // deconfigure all but one DIMM
+ for (auto i = pDimmList.size() - 1;i > 0;--i)
+ {
+ TargetHandle_t l_pDimm = pDimmList[i];
+
+ // Deconfigure the DIMM.
+ l_pErr = theDeconfigGard().
+ deconfigureTarget(*l_pDimm, 0xA5);
+ if (l_pErr)
+ {
+ TS_FAIL("testDeconfigureAssoc5: Error from deconfigureTarget");
+ break;
+ }
+ }
+ // Check the HWAS_STATE of the MBA
+ HwasState l_state = l_pMba->getAttr<ATTR_HWAS_STATE>();
+ if (!l_state.functional)
+ {
+ TS_FAIL("testDeconfigureAssoc5: MBA not functional after deconfiguring most DIMMS");
+ break;
+ }
+
+ // deconfigure last functional DIMM
+ TargetHandle_t l_pLastDimm = pDimmList[0];
+ l_pErr = theDeconfigGard().deconfigureTarget(*l_pLastDimm, 0xA6);
+ if (l_pErr)
+ {
+ TS_FAIL("testDeconfigureAssoc5: Error from deconfigureTarget");
+ break;
+ }
+ // Check the HWAS_STATE of the MBA
+ l_state = l_pMba->getAttr<ATTR_HWAS_STATE>();
+ if (l_state.functional)
+ {
+ TS_FAIL("testDeconfigureAssoc5: MBA functional after deconfiguring all DIMMS");
+ break;
+ }
+
+ // Reset the HWAS_STATE of the DIMMs and MBA
+ ATTR_HWAS_STATE_type functionalHwasState = {0};
+ functionalHwasState.functional = true;
+ for (auto l_pDimm: pDimmList)
+ l_pDimm->setAttr<ATTR_HWAS_STATE>(functionalHwasState);
+ l_pMba->setAttr<ATTR_HWAS_STATE>(l_origState);
+
+ TS_TRACE(INFO_MRK "testDeconfigureAssoc5: Success");
+ }
+ while (0);
+
+ if (l_pErr)
+ {
+ errlCommit(l_pErr, HWAS_COMP_ID);
+ }
+#endif
+ }
/**
* @brief Test EX with no good cores should be deconfigured
OpenPOWER on IntegriCloud