summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/test/hwpftest.H
diff options
context:
space:
mode:
authorVan Lee <vanlee@us.ibm.com>2012-01-13 09:57:41 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-02-09 09:57:37 -0600
commit8802f986037017ba5a2e3efa2cb7c054b8bcea7a (patch)
tree7cbeaa363dac607b7c9cc7b3d865e5b90f385066 /src/usr/hwpf/test/hwpftest.H
parent5b9f174f56e2dbb77178b767f7cb92668ec78e43 (diff)
downloadtalos-hostboot-8802f986037017ba5a2e3efa2cb7c054b8bcea7a.tar.gz
talos-hostboot-8802f986037017ba5a2e3efa2cb7c054b8bcea7a.zip
HWPF Attribute Support: DIMM SPD Attributes - RTC4590
Change-Id: I4557a6a67ea73f13e2bcca6e05af57cba8d5a9e1 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/613 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/test/hwpftest.H')
-rw-r--r--src/usr/hwpf/test/hwpftest.H58
1 files changed, 57 insertions, 1 deletions
diff --git a/src/usr/hwpf/test/hwpftest.H b/src/usr/hwpf/test/hwpftest.H
index 24b24db28..26f198f3e 100644
--- a/src/usr/hwpf/test/hwpftest.H
+++ b/src/usr/hwpf/test/hwpftest.H
@@ -36,6 +36,8 @@
#include <errl/errlmanager.H>
#include <targeting/targetservice.H>
#include <fapiHwpExecInitFile.H>
+#include <spd/spdenums.H>
+#include <targeting/predicates/predicatectm.H>
using namespace fapi;
using namespace TARGETING;
@@ -624,7 +626,6 @@ public:
}
}
-
// // unit test breakpoint
// void testHwpf7()
// {
@@ -637,6 +638,61 @@ public:
// FAPI_INF("RESUME from breakpoint");
// }
+ /**
+ * @brief Test case Accessing DIMM SPD Attribute from FAPI
+ *
+ */
+ void testHwpf8()
+ {
+ fapi::ReturnCode l_rc;
+
+ do
+ {
+ // Get top level system target
+ TARGETING::TargetService& tS = TARGETING::targetService();
+ TARGETING::Target * sysTarget = NULL;
+ tS.getTopLevelTarget( sysTarget );
+
+ if (sysTarget == NULL)
+ {
+ FAPI_ERR("testHwpf8: Can't obtain system target");
+ break;
+ }
+
+ // Get a DIMM Target
+ TARGETING::PredicateCTM predDimm( TARGETING::CLASS_CARD,
+ TARGETING::TYPE_DIMM );
+ TargetHandleList dimmList;
+
+ tS.getAssociated( dimmList,
+ sysTarget,
+ TARGETING::TargetService::CHILD,
+ TARGETING::TargetService::ALL,
+ &predDimm );
+
+ if (dimmList.size())
+ {
+ fapi::Target l_dTarget(TARGET_TYPE_DIMM,
+ static_cast<void *> (dimmList[0]));
+
+ uint8_t opt[18] = { 0, };
+
+ l_rc = FAPI_ATTR_GET(ATTR_SPD_MODULE_PART_NUMBER,
+ &l_dTarget, opt);
+
+ if (l_rc.ok())
+ {
+ FAPI_INF("testHwpf8: PN = %s", opt);
+ }
+ else
+ {
+ TS_FAIL("testHwpf8: ATTR_SPD_MODULE_PART_NUMBER GET fails");
+ }
+ }
+
+ } while(0);
+
+ }
};
OpenPOWER on IntegriCloud