summaryrefslogtreecommitdiffstats
path: root/src/usr/fapi2/test/fapi2GetChildrenTest.H
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/fapi2/test/fapi2GetChildrenTest.H')
-rw-r--r--src/usr/fapi2/test/fapi2GetChildrenTest.H135
1 files changed, 53 insertions, 82 deletions
diff --git a/src/usr/fapi2/test/fapi2GetChildrenTest.H b/src/usr/fapi2/test/fapi2GetChildrenTest.H
index 3971c1270..961579e1f 100644
--- a/src/usr/fapi2/test/fapi2GetChildrenTest.H
+++ b/src/usr/fapi2/test/fapi2GetChildrenTest.H
@@ -32,7 +32,6 @@
#include <functional>
#include <plat_utils.H>
#include <error_scope.H>
-#include <config.h>
namespace fapi2
{
@@ -66,7 +65,6 @@ void test_fapi2GetChildren()
uint32_t l_targetHuid = 0xFFFFFFFF;
uint32_t l_actualSize = 0;
uint32_t l_expectedSize = 0;
- errlHndl_t l_err = nullptr;
int numTests = 0;
int numFails = 0;
@@ -225,7 +223,7 @@ void test_fapi2GetChildren()
numTests++;
if(l_actualSize != l_expectedSize)
{
- TS_FAIL("test_fapi2GetChildren:: OMIs per proc mismatch");
+ TS_FAIL("test_fapi2GetChildren:: OMIs per proc mismatch. Actual size: %d, Expected size: %d", l_actualSize, l_expectedSize);
numFails++;
break;
}
@@ -611,17 +609,25 @@ void test_fapi2GetChildren()
TARGET_STATE_PRESENT).size(); } },
// CAPP pervasive has 1 CAPP child
- {PERV_CAPP_CUMULUS_CHILDREN,
+ {PERV_CAPP_AXONE_CHILDREN,
[](TARGETING::ATTR_CHIP_UNIT_type i_unit)
{ return ((i_unit == CAPP0_RANGE) || (i_unit == CAPP1_RANGE));},
[](Target<fapi2::TARGET_TYPE_PERV>& i_perv)
{ return i_perv.getChildren<fapi2::TARGET_TYPE_CAPP>(
TARGET_STATE_PRESENT).size(); } },
- // OBUS pervasive has 3 OBUS BRICK children
- {PERV_OBUS_BRICK_CHILDREN,
+ // OBUS0,3 pervasive has 2 OBUS BRICK children
+ {PERV_OBUS_BRICK03_AXONE_CHILDREN,
[](TARGETING::ATTR_CHIP_UNIT_type i_unit)
- { return ((i_unit >= OBUS_LOW) && (i_unit <= OBUS_HIGH)); },
+ { return ((i_unit == OBUS_LOW+0) || (i_unit == OBUS_LOW+3)); },
+ [](Target<fapi2::TARGET_TYPE_PERV>& i_perv)
+ { return i_perv.getChildren<fapi2::TARGET_TYPE_OBUS_BRICK>(
+ TARGET_STATE_PRESENT).size(); } },
+
+ // OBUS1,2 pervasive has 1 OBUS BRICK child
+ {PERV_OBUS_BRICK12_AXONE_CHILDREN,
+ [](TARGETING::ATTR_CHIP_UNIT_type i_unit)
+ { return ((i_unit == OBUS_LOW+1) || (i_unit == OBUS_LOW+2)); },
[](Target<fapi2::TARGET_TYPE_PERV>& i_perv)
{ return i_perv.getChildren<fapi2::TARGET_TYPE_OBUS_BRICK>(
TARGET_STATE_PRESENT).size(); } },
@@ -699,7 +705,7 @@ void test_fapi2GetChildren()
TARGET_STATE_PRESENT).size(); } },
};
- pervasiveChildTestRec* ptr;
+ pervasiveChildTestRec* ptr = nullptr;
int numPervTests = 0;
TARGETING::ATTR_MODEL_type l_model = l_proc->getAttr<TARGETING::ATTR_MODEL>();
if (l_model == TARGETING::MODEL_NIMBUS)
@@ -750,9 +756,9 @@ void test_fapi2GetChildren()
if(candidateTarget == nullptr)
{
- TS_FAIL("test_fapi2GetChildren:: candidateTarget not found");
+ TS_FAIL("test_fapi2GetChildren:: candidateTarget not found - test %d", i);
numFails++;
- break;
+ continue;
}
l_targetHuid = TARGETING::get_huid(candidateTarget);
@@ -764,9 +770,9 @@ void test_fapi2GetChildren()
if(l_actualSize != l_expectedSize)
{
- TS_FAIL("test_fapi2GetChildren:: children of pervasive mismatch");
+ TS_FAIL("test_fapi2GetChildren:: children of pervasive mismatch for %.8X (exp=%d,act=%d)",
+ l_targetHuid,l_expectedSize,l_actualSize);
numFails++;
- break;
}
}
@@ -780,31 +786,6 @@ void test_fapi2GetChildren()
}while(0);
- if(l_actualSize != l_expectedSize)
- {
- /*@
- * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid fapi2::MOD_FAPI2_PLAT_GET_CHILDREN_TEST
- * @reasoncode fapi2::RC_INVALID_CHILD_COUNT
- * @userdata1[0:31] Expected Child Count
- * @userdata1[32:63] Actual Child Count
- * @userdata2 Parent HUID
- * @devdesc Invalid amount of child cores found
- * on a proc
- */
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- fapi2::MOD_FAPI2_PLAT_GET_CHILDREN_TEST,
- fapi2::RC_INVALID_CHILD_COUNT,
- TWO_UINT32_TO_UINT64(
- TO_UINT32(
- l_expectedSize),
- TO_UINT32(
- l_actualSize)),
- l_targetHuid,
- true/*SW Error*/);
- errlCommit(l_err,HWPF_COMP_ID);
- TS_FAIL("test_fapi2GetChildren Fail, for HUID: %d , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize );
- }
FAPI_INF("fapi2GetChildrenTest:: Test Complete. %d/%d fails", numFails , numTests);
}
@@ -818,7 +799,6 @@ void test_fapi2GetChildrenFilter()
uint32_t l_targetHuid = 0xFFFFFFFF;
uint32_t l_actualSize = 0;
uint32_t l_expectedSize = 0;
- errlHndl_t l_err = nullptr;
TARGETING::Target * l_proc = nullptr;
TARGETING::TargetHandleList l_chipList;
do
@@ -835,7 +815,7 @@ void test_fapi2GetChildrenFilter()
}
else
{
- TS_FAIL("test_fapi2GetChildren Fail: could not find any proc, skipping tests");
+ TS_FAIL("test_fapi2GetChildrenFilter Fail: could not find any proc, skipping tests");
numFails++;
break;
}
@@ -876,7 +856,7 @@ void test_fapi2GetChildrenFilter()
if(l_actualSize != l_expectedSize)
{
numFails++;
- break;
+ TS_FAIL("test_fapi2GetChildrenFilter Fail on PERV/ALL_CORES, for HUID: 0x%.8X , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize );
}
// PERV - TARGET_FILTER_CORE1
@@ -890,7 +870,7 @@ void test_fapi2GetChildrenFilter()
if(l_actualSize != l_expectedSize)
{
numFails++;
- break;
+ TS_FAIL("test_fapi2GetChildrenFilter Fail on PERV/CORE1, for HUID: 0x%.8X , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize );
}
if (isHwValid(l_proc, MY_MC))
@@ -906,13 +886,26 @@ void test_fapi2GetChildrenFilter()
if(l_actualSize != l_expectedSize)
{
numFails++;
- break;
+ TS_FAIL("test_fapi2GetChildrenFilter Fail on PERV/ALL_MC, for HUID: 0x%.8X , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize );
}
}
// PERV - SYNC_MODE_ALL_IO_EXCEPT_NEST
- // NOTE: 2 of 4 OBUS are Cumulus only, so expect 8 instead of 10 returned
- l_expectedSize = 8;
+ l_expectedSize = 0;
+ TARGETING::ATTR_MODEL_type l_model = l_proc->getAttr<TARGETING::ATTR_MODEL>();
+ if (l_model == TARGETING::MODEL_NIMBUS)
+ {
+ // NOTE: 2 of 4 OBUS are Cumulus only, so expect 8 instead of 10 returned
+ l_expectedSize = 8;
+ }
+ else if (l_model == TARGETING::MODEL_CUMULUS)
+ {
+ l_expectedSize = 10;
+ }
+ else if (l_model == TARGETING::MODEL_AXONE)
+ {
+ l_expectedSize = 10;
+ }
l_childPERVs = fapi2_procTarget.getChildren<fapi2::TARGET_TYPE_PERV>(
TARGET_FILTER_SYNC_MODE_ALL_IO_EXCEPT_NEST,
TARGET_STATE_PRESENT);
@@ -922,37 +915,11 @@ void test_fapi2GetChildrenFilter()
if(l_actualSize != l_expectedSize)
{
numFails++;
- break;
+ TS_FAIL("test_fapi2GetChildrenFilter Fail on PERV/ALL_IO_EXCEPT_NEST, for HUID: 0x%.8X , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize );
}
}while(0);
- if(l_actualSize != l_expectedSize)
- {
- /*@
- * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
- * @moduleid fapi2::MOD_FAPI2_PLAT_GET_CHILDREN_FILTER_TEST
- * @reasoncode fapi2::RC_INVALID_CHILD_COUNT
- * @userdata1[0:31] Expected Child Count
- * @userdata1[32:63] Actual Child Count
- * @userdata2 Parent HUID
- * @devdesc Invalid amount of child cores found
- * on a proc
- */
- l_err = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- fapi2::MOD_FAPI2_PLAT_GET_CHILDREN_FILTER_TEST,
- fapi2::RC_INVALID_CHILD_COUNT,
- TWO_UINT32_TO_UINT64(
- TO_UINT32(
- l_expectedSize),
- TO_UINT32(
- l_actualSize)),
- l_targetHuid,
- true/*SW Error*/);
- errlCommit(l_err,HWPF_COMP_ID);
- TS_FAIL("test_fapi2GetChildrenFilter Fail, for HUID: 0x%X , expected %d children , found %d ", l_targetHuid,l_expectedSize,l_actualSize );
- }
-
FAPI_INF("test_fapi2GetChildrenFilter: Test Complete. %d/%d fails", numFails , numTests);
}
@@ -966,10 +933,12 @@ void test_fapi2getChildTargetsForCDG()
int numFails = 0;
TARGETING::Target * l_proc = nullptr;
size_t l_expectedDimms = 0;
+ TARGETING::TargetHandleList l_chipList;
+// These port and socket arguments are not valid for Axone targets
+#ifndef CONFIG_AXONE
size_t l_expectedDimmsUnderPort0 = 0;
size_t l_expectedDimmsUnderPort1 = 0;
- TARGETING::TargetHandleList l_chipList;
-
+#endif
do
{
FAPI_DBG("start of test_fapi2getChildTargetsForCDG()");
@@ -992,20 +961,24 @@ void test_fapi2getChildTargetsForCDG()
if (l_proc->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_NIMBUS)
{
l_expectedDimms = 16;
+// These port and socket arguments are not valid for Axone targets
+#ifndef CONFIG_AXONE
l_expectedDimmsUnderPort0 = l_expectedDimms;
l_expectedDimmsUnderPort1 = 0;
+#endif
}
else if (l_proc->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_CUMULUS)
{
l_expectedDimms = 8;
+// These port and socket arguments are not valid for Axone targets
+#ifndef CONFIG_AXONE
l_expectedDimmsUnderPort0 = l_expectedDimms/2;
l_expectedDimmsUnderPort1 = l_expectedDimms/2;
+#endif
}
else if (l_proc->getAttr<TARGETING::ATTR_MODEL>() == TARGETING::MODEL_AXONE)
{
l_expectedDimms = 9;
- l_expectedDimmsUnderPort0 = 0xFF; //wrong
- l_expectedDimmsUnderPort1 = 0xFF; //wrong
}
else //both are nullptr
{
@@ -1035,6 +1008,9 @@ void test_fapi2getChildTargetsForCDG()
numFails++;
}
+// These port and socket arguments are not valid for Axone targets
+// so skip testing them
+#ifndef CONFIG_AXONE
// All dimms under port 0
fapi2::getChildTargetsForCDG(fapi2_procTarget,
fapi2::TARGET_TYPE_DIMM,
@@ -1047,11 +1023,9 @@ void test_fapi2getChildTargetsForCDG()
if(l_dimmList.size() != l_expectedDimmsUnderPort0)
{
-#ifndef CONFIG_AXONE_BRING_UP
TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under port 0 not equal expected %d",
l_dimmList.size(),l_expectedDimmsUnderPort0);
numFails++;
-#endif
}
// All dimms under port 1
@@ -1066,11 +1040,9 @@ void test_fapi2getChildTargetsForCDG()
if(l_dimmList.size() != l_expectedDimmsUnderPort1)
{
-#ifndef CONFIG_AXONE_BRING_UP
TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under port 1 not equal expected %d",
l_dimmList.size(),l_expectedDimmsUnderPort1);
numFails++;
-#endif
}
// All dimms under socket 0
@@ -1084,11 +1056,9 @@ void test_fapi2getChildTargetsForCDG()
numTests++;
if(l_dimmList.size() != l_expectedDimms)
{
-#ifndef CONFIG_AXONE_BRING_UP
- TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under socket 0 not equal expected %d",
+ TS_FAIL("test_fapi2getChildTargetsForCDG: Dimm count %d under socket 0x0, all ports, not equal expected %d",
l_dimmList.size(),l_expectedDimms);
numFails++;
-#endif
}
// All dimms under socket 1
@@ -1106,6 +1076,7 @@ void test_fapi2getChildTargetsForCDG()
l_dimmList.size(),0);
numFails++;
}
+#endif
}while(0);
OpenPOWER on IntegriCloud