summaryrefslogtreecommitdiffstats
path: root/src/usr/fsiscom/test
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2013-08-12 10:42:41 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-09-13 13:09:17 -0500
commit907bd272887a4223e233091172a6a6e5f29cb05a (patch)
tree599d0e14d59908fdd8f1b06f202d87746ab8b122 /src/usr/fsiscom/test
parentb614caa4f28616bba6e27625e4430083f53679b8 (diff)
downloadtalos-hostboot-907bd272887a4223e233091172a6a6e5f29cb05a.tar.gz
talos-hostboot-907bd272887a4223e233091172a6a6e5f29cb05a.zip
FSI SCOM Error Handling
Change-Id: I1538fbf386d5480e473f3f0b049492d494412624 RTC: 35064 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5825 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/fsiscom/test')
-rw-r--r--src/usr/fsiscom/test/fsiscomtest.H133
-rw-r--r--src/usr/fsiscom/test/makefile32
2 files changed, 123 insertions, 42 deletions
diff --git a/src/usr/fsiscom/test/fsiscomtest.H b/src/usr/fsiscom/test/fsiscomtest.H
index 5c570793b..16481987d 100644
--- a/src/usr/fsiscom/test/fsiscomtest.H
+++ b/src/usr/fsiscom/test/fsiscomtest.H
@@ -1,43 +1,124 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/fsiscom/test/fsiscomtest.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// 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
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/fsiscom/test/fsiscomtest.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2011,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 */
#include <cxxtest/TestSuite.H>
#include <errl/errlmanager.H>
#include <errl/errlentry.H>
#include <limits.h>
#include <devicefw/driverif.H>
+#include <fsiscom/fsiscom_reasoncodes.H>
+extern trace_desc_t* g_trac_fsiscom;
class FsiScomTest : public CxxTest::TestSuite
{
public:
/**
- * @brief test1
+ * @brief Test error path and recovery
*/
- void test_fsiScom(void)
+ void test_Error(void)
{
+ TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> Start" );
- //FSISCOM testing driving by SCOM device driver. This allows for testing FSISCOM <-> XSCOM
- //coherency.
+ //@fixme: RTC:80081
+ TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> Disabling test until D892724 is in a build" );
+#if 0
+ uint64_t fails = 0;
+ uint64_t total = 0;
+ errlHndl_t l_err = NULL;
+ uint64_t regdata = 0;
+ size_t op_size = sizeof(uint64_t);
+
+ // Centaur target
+ TARGETING::EntityPath epath(TARGETING::EntityPath::PATH_PHYSICAL);
+ epath.addLast(TARGETING::TYPE_SYS,0);
+ epath.addLast(TARGETING::TYPE_NODE,0);
+ epath.addLast(TARGETING::TYPE_MEMBUF,4);
+ TARGETING::Target* fsi_target =
+ TARGETING::targetService().toTarget(epath);
+ if( fsi_target == NULL )
+ {
+ TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> Target is NULL" );
+ TS_FAIL( "FsiScomTest::test_Error> Target is NULL" );
+ }
+
+ // Bad address read
+ total++;
+ l_err = DeviceFW::deviceOp(
+ DeviceFW::READ,
+ fsi_target,
+ &regdata,
+ op_size,
+ DEVICE_FSISCOM_ADDRESS(0x11111111) );
+ if( l_err && (l_err->reasonCode() == FSISCOM::RC_READ_ERROR) )
+ {
+ delete l_err;
+ }
+ else
+ {
+ TRACFCOMP(g_trac_fsiscom, "FsiScomTest::test_Error> No/wrong error for bad address read, RC=%X", ERRL_GETRC_SAFE(l_err) );
+ TS_FAIL( "FsiScomTest::test_Error> No/wrong error for bad address read" );
+ fails++;
+ if( l_err ) { errlCommit(l_err,FSISCOM_COMP_ID); }
+ }
+
+ // Bad address write
+ total++;
+ l_err = DeviceFW::deviceOp(
+ DeviceFW::WRITE,
+ fsi_target,
+ &regdata,
+ op_size,
+ DEVICE_FSISCOM_ADDRESS(0x00222222) );
+ if( l_err && (l_err->reasonCode() == FSISCOM::RC_WRITE_ERROR) )
+ {
+ delete l_err;
+ }
+ else
+ {
+ TRACFCOMP(g_trac_fsiscom, "FsiScomTest::test_Error> No/wrong error for bad address write, RC=%X", ERRL_GETRC_SAFE(l_err) );
+ TS_FAIL( "FsiScomTest::test_Error> No/wrong error for bad address write" );
+ fails++;
+ if( l_err ) { errlCommit(l_err,FSISCOM_COMP_ID); }
+ }
+
+ // Do a good scom to prove things are working again
+ total++;
+ l_err = DeviceFW::deviceOp(
+ DeviceFW::READ,
+ fsi_target,
+ &regdata,
+ op_size,
+ DEVICE_FSISCOM_ADDRESS(0x02011403) );
+ if( l_err )
+ {
+ TRACFCOMP(g_trac_fsiscom, "FsiScomTest::test_Error> Error reading 0x02011403, RC=%X", ERRL_GETRC_SAFE(l_err) );
+ TS_FAIL( "FsiScomTest::test_Error> Error reading 0x02011403" );
+ fails++;
+ errlCommit(l_err,FSISCOM_COMP_ID);
+ }
+
+ TRACFCOMP( g_trac_fsiscom, "FsiScomTest::test_Error> %d/%d fails", fails, total );
+#endif
};
};
diff --git a/src/usr/fsiscom/test/makefile b/src/usr/fsiscom/test/makefile
index b6c001ea8..7753f9a1a 100644
--- a/src/usr/fsiscom/test/makefile
+++ b/src/usr/fsiscom/test/makefile
@@ -1,29 +1,29 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/usr/fsiscom/test/makefile $
+# $Source: src/usr/fsiscom/test/makefile $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011,2013
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# 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.
+# 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
+# Origin: 30
#
-# IBM_PROLOG_END
+# IBM_PROLOG_END_TAG
ROOTPATH = ../../../..
-#MODULE = testfsiscom Disabled as we don't currently have any tests defined.
-#TESTS = *.H
+MODULE = testfsiscom
+TESTS = *.H
include ${ROOTPATH}/config.mk
OpenPOWER on IntegriCloud