summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/test
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2012-08-06 14:09:37 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-08-13 13:16:54 -0500
commit5023b07888935148844de78239f07d6fa371d9e8 (patch)
treeb5295ced4bdf6ada2a778c196ec3c7bf75910df8 /src/usr/targeting/test
parent11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918 (diff)
downloadtalos-hostboot-5023b07888935148844de78239f07d6fa371d9e8.tar.gz
talos-hostboot-5023b07888935148844de78239f07d6fa371d9e8.zip
Implement attribute sync from hostboot to fsp
RTC: 41245 Change-Id: Icb7eac8cdcc6a9bc4d19bd2e307f352b835f2df9 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1485 Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/test')
-rw-r--r--src/usr/targeting/test/makefile9
-rw-r--r--src/usr/targeting/test/testattrsync.H119
2 files changed, 123 insertions, 5 deletions
diff --git a/src/usr/targeting/test/makefile b/src/usr/targeting/test/makefile
index dc33093bc..018effea2 100644
--- a/src/usr/targeting/test/makefile
+++ b/src/usr/targeting/test/makefile
@@ -1,11 +1,11 @@
-# IBM_PROLOG_BEGIN_TAG
+# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/targeting/test/makefile $
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011-2012
#
# p1
#
@@ -19,8 +19,7 @@
#
# Origin: 30
#
-# IBM_PROLOG_END
-
+# IBM_PROLOG_END_TAG
################################################################################
#
# @file src/usr/targeting/test/makefile
@@ -63,7 +62,7 @@ MODULE = testtargeting
COMMON_TESTCASE_REL_PATHS = \
$(addprefix ${COMMON_TARGETING_REL_PATH}/test/,${COMMON_TESTCASES})
-TESTS = testtargeting.H ${COMMON_TESTCASE_REL_PATHS}
+TESTS = testtargeting.H testattrsync.H ${COMMON_TESTCASE_REL_PATHS}
OBJS = attributestrings.o
diff --git a/src/usr/targeting/test/testattrsync.H b/src/usr/targeting/test/testattrsync.H
new file mode 100644
index 000000000..69e90004b
--- /dev/null
+++ b/src/usr/targeting/test/testattrsync.H
@@ -0,0 +1,119 @@
+/* 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
+ */
+#ifndef __TARGETING_TESTATTRSYNC_H
+#define __TARGETING_TESTATTRSYNC_H
+
+/**
+ * @file targeting/test/testattrsync.H
+ *
+ * @brief All unit tests which test attribute sync
+ */
+
+//******************************************************************************
+// Includes
+//******************************************************************************
+
+// STD
+#include <stdio.h>
+#include <sys/time.h>
+
+// CXXTEST
+#include <cxxtest/TestSuite.H>
+#include <errl/errlmanager.H>
+
+// This component
+#include <targeting/common/attributes.H>
+#include <targeting/common/entitypath.H>
+#include <targeting/common/target.H>
+#include <targeting/common/targetservice.H>
+#include <targeting/common/iterators/rangefilter.H>
+#include <targeting/common/predicates/predicatectm.H>
+#include <targeting/common/predicates/predicatepostfixexpr.H>
+#include <targeting/attrsync.H>
+#include <errl/errludtarget.H>
+#include <targeting/common/trace.H>
+#include <kernel/console.H>
+
+class AttrSyncTestSuite : public CxxTest::TestSuite
+{
+ public:
+
+ /**
+ * @brief Test sync of targeting attributes to FSP
+ */
+ void testAttributeSync()
+ {
+ TS_TRACE(ENTER_MRK "testAttributeSync" );
+
+ using namespace TARGETING;
+
+ AttributeSync l_attrSync;
+
+ TS_TRACE( "Sync PNOR RW" );
+
+ errlHndl_t err = l_attrSync.syncSectionToFsp(
+ TARGETING::SECTION_TYPE_PNOR_RW );
+
+ if( err )
+ {
+ if( MBOX::mailbox_enabled() )
+ {
+ TS_FAIL(" Error returned when syncing SECTION_TYPE_PNOR_RW");
+ }
+ err = NULL;
+ }
+
+ TS_TRACE("Sync PNOR INIT " );
+
+ err = l_attrSync.syncSectionToFsp(
+ TARGETING::SECTION_TYPE_HEAP_PNOR_INIT );
+
+ if( err )
+ {
+ if( MBOX::mailbox_enabled() )
+ {
+ TS_FAIL(" Error returned when syncing SECTION_TYPE_HEAP_PNOR_INIT");
+ }
+ err = NULL;
+ }
+
+ TS_TRACE( "Sync PNOR ZERO INIT" );
+
+ err = l_attrSync.syncSectionToFsp(
+ TARGETING::SECTION_TYPE_HEAP_ZERO_INIT );
+
+ if( err )
+ {
+ if( MBOX::mailbox_enabled() )
+ {
+ TS_FAIL(" Error returned when syncing SECTION_TYPE_HEAP_ZERO_INIT");
+ }
+ err = NULL;
+ }
+
+ }
+
+};
+
+#endif // End __TARGETING_TESTTARGETING_H
OpenPOWER on IntegriCloud