From d8fdb9f6399d602c3314fe8a0a6578364e886120 Mon Sep 17 00:00:00 2001 From: Brian Horton Date: Tue, 25 Jun 2013 16:43:53 -0500 Subject: rework gard interfaces to handle new hwsv functions the FSP gard records will now be stored in the system model, so the gard functions change to support new platform specific functions. Change-Id: I9a847a3defa7e613d128b1077763640e124360a8 RTC: 73818 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5806 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell Reviewed-by: SHELDON R. BAILEY Reviewed-by: A. Patrick Williams III --- src/usr/hwas/test/hwasGardTest.H | 445 ++++++++++++++------------------------- 1 file changed, 159 insertions(+), 286 deletions(-) (limited to 'src/usr/hwas/test/hwasGardTest.H') diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H index 433180840..6a217149f 100644 --- a/src/usr/hwas/test/hwasGardTest.H +++ b/src/usr/hwas/test/hwasGardTest.H @@ -76,25 +76,25 @@ public: break; } - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testDeconfigure3a: empty pCoreList"); + TS_FAIL("testDeconfigure3a: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); + TargetHandle_t l_pTarget = *pExList.begin(); // create a deconfigure record theDeconfigGard(). @@ -165,25 +165,25 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testDeconfigure3: empty pCoreList"); + TS_FAIL("testDeconfigure3: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get the original HWAS_STATE of the target HwasState l_origState = l_pTarget->getAttr(); @@ -242,25 +242,25 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testDeconfigure4: empty pCoreList"); + TS_FAIL("testDeconfigure4: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get the current HWAS_STATE of the target HwasState l_origState = l_pTarget->getAttr(); @@ -647,25 +647,25 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testDefDeconfig1: empty pCoreList"); + TS_FAIL("testDefDeconfig1: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get any existing Deconfigure Record for the target l_pErr = theDeconfigGard(). @@ -748,103 +748,20 @@ public: errlHndl_t l_pErr = NULL; DeconfigGard::GardRecords_t l_records; - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); - TS_FAIL("testGard1: Error from getGardRecords"); + TS_FAIL("testGard1: Error from getGardRecords(NULL)"); } else { - TS_TRACE(INFO_MRK "testGard1: Success. %d records", + TS_TRACE(INFO_MRK "testGard1: get(NULL) Success. %d records", l_records.size()); } } - /** - * @brief Test getting GARD Records with a bad record ID). - */ - void testGard2() - { - TS_TRACE(INFO_MRK "testGard2: Started"); - - errlHndl_t l_pErr = NULL; - DeconfigGard::GardRecords_t l_records; - - l_pErr = theDeconfigGard().getGardRecords(0x12345678, l_records); - - if (l_pErr) - { - errlCommit(l_pErr,HWAS_COMP_ID); - TS_FAIL("testGard2: Error from getGardRecords"); - } - else - { - if (l_records.size()) - { - TS_FAIL("testGard2: %d records found for bad ID", - l_records.size()); - } - else - { - TS_TRACE(INFO_MRK "testGard2: Success"); - } - } - } - - /** - * @brief Test getting GARD Records for a specific target - */ - void testGard3() - { - TS_TRACE(INFO_MRK "testGard3: Started"); - - errlHndl_t l_pErr = NULL; - DeconfigGard::GardRecords_t l_records; - - do - { - // find a core that we can play with - Target * pSys; - targetService().getTopLevelTarget(pSys); - - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); - PredicateHwas predFunctional; - predFunctional.poweredOn(true).present(true).functional(true); - PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, - TargetService::CHILD, TargetService::ALL, &checkExpr ); - - if (pCoreList.empty()) - { - TS_FAIL("testGard3: empty pCoreList"); - break; - } - TargetHandle_t l_pTarget = *pCoreList.begin(); - - EntityPath l_id = l_pTarget->getAttr(); - - // Get all GARD Records for the Target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); - - if (l_pErr) - { - errlCommit(l_pErr,HWAS_COMP_ID); - TS_FAIL("testGard3: Error from getGardRecords"); - } - else - { - TS_TRACE(INFO_MRK "testGard3: Success. %d records", - l_records.size()); - } - } - while (0); - } - /** * @brief Test creating a GARD Record, getting the GARD Record and * clearing the GARD Record @@ -869,31 +786,28 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testGard4: empty pCoreList"); + TS_FAIL("testGard4: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); - - EntityPath l_id = l_pTarget->getAttr(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get any existing GARD Records for the target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); - + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { TS_FAIL("testGard4: Error from getGardRecords"); @@ -909,7 +823,7 @@ public: // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0x12, GARD_Predictive); + createGardRecord(l_pTarget, 0x12, GARD_Predictive); if (l_pErr) { @@ -918,7 +832,7 @@ public: } // Get the GARD Records for the target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -941,7 +855,7 @@ public: } // Clear the GARD Records for the target - l_pErr = theDeconfigGard().clearGardRecords(l_id); + l_pErr = theDeconfigGard().clearGardRecords(l_pTarget); if (l_pErr) { @@ -952,7 +866,7 @@ public: // Get the GARD Records for the target l_records.clear(); - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1001,30 +915,28 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testGard5: empty pCoreList"); + TS_FAIL("testGard5: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); - - EntityPath l_id = l_pTarget->getAttr(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get any existing GARD Records for the target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1041,7 +953,7 @@ public: // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0x23, GARD_Predictive); + createGardRecord(l_pTarget, 0x23, GARD_Predictive); if (l_pErr) { @@ -1051,7 +963,7 @@ public: // Create another GARD Record for the target l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0x45, GARD_Fatal); + createGardRecord(l_pTarget, 0x45, GARD_Fatal); if (l_pErr) { @@ -1060,7 +972,7 @@ public: } // Get the GARD Records for the target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1068,15 +980,15 @@ public: break; } - if (l_records.size() != 2) + if (l_records.size() != 1) { - TS_FAIL("testGard5: %d records for target, expected 2", + TS_FAIL("testGard5: %d records for target, expected 1", l_records.size()); break; } - // Clear the GARD Records for the target - l_pErr = theDeconfigGard().clearGardRecords(l_id); + // Clear the GARD Record for the target + l_pErr = theDeconfigGard().clearGardRecords(l_pTarget); if (l_pErr) { @@ -1087,7 +999,7 @@ public: // Get the GARD Records for the target l_records.clear(); - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1114,7 +1026,7 @@ public: } /** - * @brief Test getting and clearing GARD Records by recordID + * @brief Test creating a 2nd GARD Record overwrites manual gard */ void testGard6() { @@ -1136,30 +1048,28 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testGard6: empty pCoreList"); + TS_FAIL("testGard6: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); - - EntityPath l_id = l_pTarget->getAttr(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get any existing GARD Records for the target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1174,10 +1084,9 @@ public: break; } - // Create a GARD Record for the target. Production code will pass a - // valid PLID + // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0, GARD_Predictive); + createGardRecord(l_pTarget, 0x23, GARD_User_Manual); if (l_pErr) { @@ -1185,9 +1094,9 @@ public: break; } - // Create another GARD Record for the target + // Create another GARD Record for the target - should overwrite l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0, GARD_Fatal); + createGardRecord(l_pTarget, 0x46, GARD_Fatal); if (l_pErr) { @@ -1196,7 +1105,7 @@ public: } // Get the GARD Records for the target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1204,35 +1113,23 @@ public: break; } - if (l_records.size() != 2) + if (l_records.size() != 1) { - TS_FAIL("testGard6: %d records for target, expected 2", + TS_FAIL("testGard6: %d records for target, expected 1", l_records.size()); break; } - // Get the first GARD Record for the target by Record ID - uint32_t l_recordID = l_records[0].iv_recordId; - l_records.clear(); - - l_pErr = theDeconfigGard(). - getGardRecords(l_recordID, l_records); - - if (l_pErr) - { - TS_FAIL("testGard6: Error from getGardRecords (3)"); - break; - } - - if (l_records.size() != 1) + if ((l_records[0].iv_errlogPlid != 0x46) || + (l_records[0].iv_errorType != GARD_Fatal)) { - TS_FAIL("testGard6: %d records for target, expected 1", - l_records.size()); + TS_FAIL("testGard6: unexpected data - errl 0x%X type %x", + l_records[0].iv_errlogPlid, l_records[0].iv_errorType); break; } - // Clear the first GARD Record for the target by Record ID - l_pErr = theDeconfigGard().clearGardRecords(l_recordID); + // Clear the GARD Record for the target + l_pErr = theDeconfigGard().clearGardRecords(l_pTarget); if (l_pErr) { @@ -1243,30 +1140,21 @@ public: // Get the GARD Records for the target l_records.clear(); - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { - TS_FAIL("testGard6: Error from getGardRecords (4)"); + TS_FAIL("testGard6: Error from getGardRecords (3)"); break; } - if (l_records.size() != 1) + if (l_records.size() != 0) { - TS_FAIL("testGard6: %d records for target, expected 1 (2)", + TS_FAIL("testGard6: %d records for target, expected 0", l_records.size()); break; } - // Clear the GARD Records for the target - l_pErr = theDeconfigGard().clearGardRecords(l_id); - - if (l_pErr) - { - TS_FAIL("testGard6: Error from clearGardRecords"); - break; - } - TS_TRACE(INFO_MRK "testGard6: Success"); } while (0); @@ -1301,29 +1189,28 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testGard7: empty pCoreList"); + TS_FAIL("testGard7: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get all existing GARD Records - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { @@ -1338,10 +1225,9 @@ public: break; } - // Create a GARD Record for the target. Production code will pass a - // valid PLID + // Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0, GARD_Predictive); + createGardRecord(l_pTarget, 0x71, GARD_Predictive); if (l_pErr) { @@ -1349,31 +1235,19 @@ public: break; } - // Create another GARD Record for the target - l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0, GARD_Fatal); - - if (l_pErr) - { - TS_FAIL("testGard7: Error from createGardRecord (2)"); - break; - } - // Clear all GARD Records - l_pErr = theDeconfigGard(). - clearGardRecords(DeconfigGard::CLEAR_ALL_GARD_RECORDS); + l_pErr = theDeconfigGard().clearGardRecords(NULL); if (l_pErr) { - TS_FAIL("testGard7: Error from clearGardRecords"); + TS_FAIL("testGard7: Error from clearGardRecords(NULL)"); break; } // Get the GARD Records l_records.clear(); - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { @@ -1423,8 +1297,7 @@ public: do { - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); @@ -1439,40 +1312,39 @@ public: break; } - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); + checkExpr.push(&predEx).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testGard8: empty pCoreList"); + TS_FAIL("testGard8: empty pExList"); break; } - TargetHandle_t l_target = *pCoreList.begin(); + TargetHandle_t l_target = *pExList.begin(); // create GARD record, call 'doGard' step and confirm target is // deconfigured l_pErr = theDeconfigGard(). - createGardRecord( *l_target, 0x12, GARD_User_Manual); + createGardRecord(l_target, 0x12, GARD_User_Manual); if (l_pErr) { TS_FAIL("testGard8: Error from createGardRecord"); break; } - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); @@ -1514,8 +1386,7 @@ public: break; } - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); @@ -1570,30 +1441,28 @@ public: do { - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + checkExpr.push(&predEx).push(&predFunctional).And(); + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testGard9: empty pCoreList"); + TS_FAIL("testGard9: empty pExList"); break; } - TargetHandle_t l_pTarget = *pCoreList.begin(); - - EntityPath l_id = l_pTarget->getAttr(); + TargetHandle_t l_pTarget = *pExList.begin(); // Get any existing GARD Records for the target - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1617,7 +1486,7 @@ public: // (try to) Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0x12, GARD_Fatal); + createGardRecord(l_pTarget, 0x12, GARD_Fatal); if (l_pErr) { @@ -1626,7 +1495,7 @@ public: } // Get the GARD Records for the target - shouldn't be any - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1648,7 +1517,7 @@ public: // (try to) Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0x12, GARD_Predictive); + createGardRecord(l_pTarget, 0x12, GARD_Predictive); if (l_pErr) { @@ -1657,7 +1526,7 @@ public: } // Get the GARD Records for the target - shouldn't be any - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1679,7 +1548,7 @@ public: // (try to) Create a GARD Record for the target. l_pErr = theDeconfigGard(). - createGardRecord(*l_pTarget, 0x12, GARD_Func); + createGardRecord(l_pTarget, 0x12, GARD_Func); if (l_pErr) { @@ -1688,7 +1557,7 @@ public: } // Get the GARD Records for the target - shouldn't be any - l_pErr = theDeconfigGard().getGardRecords(l_id, l_records); + l_pErr = theDeconfigGard().getGardRecords(l_pTarget, l_records); if (l_pErr) { @@ -1739,8 +1608,7 @@ public: do { - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); @@ -1755,40 +1623,39 @@ public: break; } - // find a core that we can play with + // find a ex unit that we can play with Target * pSys; targetService().getTopLevelTarget(pSys); - PredicateCTM predCore(CLASS_UNIT, TYPE_CORE); + PredicateCTM predEx(CLASS_UNIT, TYPE_EX); PredicateHwas predFunctional; predFunctional.poweredOn(true).present(true).functional(true); PredicatePostfixExpr checkExpr; - checkExpr.push(&predCore).push(&predFunctional).And(); + checkExpr.push(&predEx).push(&predFunctional).And(); - TargetHandleList pCoreList; - targetService().getAssociated( pCoreList, pSys, + TargetHandleList pExList; + targetService().getAssociated( pExList, pSys, TargetService::CHILD, TargetService::ALL, &checkExpr ); - if (pCoreList.empty()) + if (pExList.empty()) { - TS_FAIL("testGard10: empty pCoreList"); + TS_FAIL("testGard10: empty pExList"); break; } - TargetHandle_t l_target = *pCoreList.begin(); + TargetHandle_t l_target = *pExList.begin(); // create GARD record, set Policy, call 'doGard' step and confirm // target is NOT deconfigured l_pErr = theDeconfigGard(). - createGardRecord( *l_target, 0x12, GARD_Predictive); + createGardRecord(l_target, 0x12, GARD_Predictive); if (l_pErr) { TS_FAIL("testGard10: Error from createGardRecord"); break; } - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); @@ -1843,11 +1710,14 @@ public: } // Clear all GARD Records - l_pErr = theDeconfigGard(). - clearGardRecords(DeconfigGard::CLEAR_ALL_GARD_RECORDS); + l_pErr = theDeconfigGard().clearGardRecords(NULL); + if (l_pErr) + { + TS_FAIL("testGard7: Error from clearGardRecords(NULL)"); + break; + } - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); @@ -1864,15 +1734,14 @@ public: // create GARD record, set Policy, call 'doGard' step and confirm // target is NOT deconfigured l_pErr = theDeconfigGard(). - createGardRecord( *l_target, 0x12, GARD_Func); + createGardRecord(l_target, 0x12, GARD_Func); if (l_pErr) { TS_FAIL("testGard10: Error from createGardRecord"); break; } - l_pErr = theDeconfigGard().getGardRecords( - DeconfigGard::GET_ALL_GARD_RECORDS, l_records); + l_pErr = theDeconfigGard().getGardRecords(NULL, l_records); if (l_pErr) { errlCommit(l_pErr,HWAS_COMP_ID); @@ -1906,8 +1775,12 @@ public: } // Clear all GARD Records - l_pErr = theDeconfigGard(). - clearGardRecords(DeconfigGard::CLEAR_ALL_GARD_RECORDS); + l_pErr = theDeconfigGard().clearGardRecords(NULL); + if (l_pErr) + { + TS_FAIL("testGard7: Error from clearGardRecords(NULL)"); + break; + } // restore l_policies = 0; -- cgit v1.2.1