summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/test/testattrsync.H
diff options
context:
space:
mode:
authorCamVan Nguyen <ctnguyen@us.ibm.com>2012-12-04 10:57:51 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-02-20 16:32:05 -0600
commitdc3be407b9bbe715a23ef2e55900a4240158cfdd (patch)
tree5d9e1e48fe27a0899229523bf3b2206d302d6a9e /src/usr/targeting/test/testattrsync.H
parent7ef3dfebf8e2a38b4b810b07600c9c49921a870f (diff)
downloadtalos-hostboot-dc3be407b9bbe715a23ef2e55900a4240158cfdd.tar.gz
talos-hostboot-dc3be407b9bbe715a23ef2e55900a4240158cfdd.zip
Attribute sync from FSP to HB
Change-Id: Ia177f591c9bb295d0435ed913d11bac7a0601405 RTC: 51687 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2964 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/test/testattrsync.H')
-rw-r--r--src/usr/targeting/test/testattrsync.H114
1 files changed, 91 insertions, 23 deletions
diff --git a/src/usr/targeting/test/testattrsync.H b/src/usr/targeting/test/testattrsync.H
index 69e90004b..dc82566e9 100644
--- a/src/usr/targeting/test/testattrsync.H
+++ b/src/usr/targeting/test/testattrsync.H
@@ -1,26 +1,25 @@
-/* IBM_PROLOG_BEGIN_TAG
- * This is an automatically generated prolog.
- *
- * $Source: src/usr/targeting/test/testattrsync.H $
- *
- * IBM CONFIDENTIAL
- *
- * COPYRIGHT International Business Machines Corp. 2012
- *
- * p1
- *
- * Object Code Only (OCO) source materials
- * Licensed Internal Code Source Materials
- * IBM HostBoot Licensed Internal Code
- *
- * The source code for this program is not published or other-
- * wise divested of its trade secrets, irrespective of what has
- * been deposited with the U.S. Copyright Office.
- *
- * Origin: 30
- *
- * IBM_PROLOG_END_TAG
- */
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/targeting/test/testattrsync.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __TARGETING_TESTATTRSYNC_H
#define __TARGETING_TESTATTRSYNC_H
@@ -81,6 +80,7 @@ class AttrSyncTestSuite : public CxxTest::TestSuite
{
TS_FAIL(" Error returned when syncing SECTION_TYPE_PNOR_RW");
}
+ delete err;
err = NULL;
}
@@ -95,6 +95,7 @@ class AttrSyncTestSuite : public CxxTest::TestSuite
{
TS_FAIL(" Error returned when syncing SECTION_TYPE_HEAP_PNOR_INIT");
}
+ delete err;
err = NULL;
}
@@ -109,11 +110,78 @@ class AttrSyncTestSuite : public CxxTest::TestSuite
{
TS_FAIL(" Error returned when syncing SECTION_TYPE_HEAP_ZERO_INIT");
}
+ delete err;
err = NULL;
}
}
+ /**
+ * @brief Test sync of targeting attributes from FSP
+ */
+ void testAttributeSyncFromFsp()
+ {
+ TS_TRACE(ENTER_MRK "testAttributeSyncFromFsp" );
+
+ using namespace TARGETING;
+
+ AttributeSync l_attrSync;
+
+ errlHndl_t l_errl = NULL;
+
+ do
+ {
+
+ // create Hostboot message queue
+ msg_q_t l_hbMsgQ = msg_q_create();
+
+ // register Hostboot message queue with mailbox to receive messages
+ l_errl = MBOX::msgq_register(MBOX::HB_ATTR_SYNC_MSGQ, l_hbMsgQ);
+ if (l_errl)
+ {
+ TS_FAIL( "Error registering the Hostboot message queue with "
+ "mailbox service.");
+ delete l_errl;
+ l_errl = NULL;
+ break;
+ }
+
+ // these are the sections we want to sync
+ SECTION_TYPE section_type[] ={SECTION_TYPE_PNOR_RW,
+ SECTION_TYPE_HEAP_PNOR_INIT,
+ SECTION_TYPE_HEAP_ZERO_INIT};
+
+ size_t section_count = sizeof(section_type)/sizeof(section_type[0]);
+
+ // pull all attributes from FSP
+ AttributeSync l_Sync;
+
+ for(uint8_t i = 0; i < section_count; i++)
+ {
+ TS_TRACE( "Syncing section type %d", section_type[i] );
+
+ l_errl = l_Sync.syncSectionFromFsp( section_type[i], l_hbMsgQ );
+
+ if (l_errl)
+ {
+ if( MBOX::mailbox_enabled() )
+ {
+ TS_FAIL( "Error returned when syncing section type %d "
+ "from FSP", section_type[i]);
+ }
+
+ delete l_errl;
+ l_errl = NULL;
+ }
+ }
+
+ // unregister the Hosboot message queue from the mailbox service.
+ MBOX::msgq_unregister(MBOX::HB_ATTR_SYNC_MSGQ);
+
+ } while (0);
+
+ TS_TRACE(EXIT_MRK "testAttributeSyncFromFsp" );
+ }
};
#endif // End __TARGETING_TESTTARGETING_H
OpenPOWER on IntegriCloud