summaryrefslogtreecommitdiffstats
path: root/src/usr/util/runtime/test/testruncommand.H
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2017-01-31 12:37:00 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-02-27 12:37:26 -0500
commit71d3e7f06404203885ae2b4a96676e5c1f921b42 (patch)
tree2122686a91305522d8008f750ce0e7314db1bca6 /src/usr/util/runtime/test/testruncommand.H
parent9b5f6cece30b2ce9b36768bb4b70fb128ba7bfa6 (diff)
downloadtalos-hostboot-71d3e7f06404203885ae2b4a96676e5c1f921b42.tar.gz
talos-hostboot-71d3e7f06404203885ae2b4a96676e5c1f921b42.zip
Add several test/debug interfaces for HBRT run_cmd
getattr : read an attribute readpnor : read data from pnor flash getscom : read a scom register putscom : write a scom register errorlog : create and commit an error log Change-Id: Id401915c998e5b59b0d940a51a4c60a593efe3e7 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35739 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Elizabeth K. Liner <eliner@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/util/runtime/test/testruncommand.H')
-rw-r--r--src/usr/util/runtime/test/testruncommand.H51
1 files changed, 50 insertions, 1 deletions
diff --git a/src/usr/util/runtime/test/testruncommand.H b/src/usr/util/runtime/test/testruncommand.H
index 5e2383fe4..9bdb15981 100644
--- a/src/usr/util/runtime/test/testruncommand.H
+++ b/src/usr/util/runtime/test/testruncommand.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -80,4 +80,53 @@ class RunCommandTest : public CxxTest::TestSuite
TS_FAIL( "testRunCommandBad> Error from no args" );
}
}
+
+
+ /**
+ * @brief Test scom operations
+ */
+ void testRunCommandScom(void)
+ {
+ int rc = 0;
+ char* outstr = NULL;
+
+ char arg0[10]; memcpy( arg0, "getscom", 8 );
+ char arg1[15]; memcpy( arg1, "0x00050000", 11 );//proc0
+ char arg2[15]; memcpy( arg2, "0x02010803", 11 );//CXA FIR Mask
+ char arg3[30]; memcpy( arg3, "0x1122334455667788", 19 );
+ const char* argv[] = { arg0, arg1, arg2, arg3 };
+
+ // do a read
+ rc = (getRuntimeInterfaces()->run_command)( 3, argv, &outstr );
+ if( rc )
+ {
+ TS_FAIL( "testRunCommandScom1> rc=%d", rc );
+ }
+ TRACFCOMP( Util::g_util_trace, "testRunCommandScom1> rc=%d :: %s",
+ rc, outstr == NULL ? "null" : outstr );
+ if( outstr ) delete[] outstr;
+
+ // do a write
+ memcpy( arg0, "putscom", 8 );
+ rc = (getRuntimeInterfaces()->run_command)( 4, argv, &outstr );
+ if( rc )
+ {
+ TS_FAIL( "testRunCommandScom2> rc=%d", rc );
+ }
+ TRACFCOMP( Util::g_util_trace, "testRunCommandScom2> rc=%d :: %s",
+ rc, outstr == NULL ? "null" : outstr );
+ if( outstr ) delete[] outstr;
+
+ // read again to check data (in trace only)
+ memcpy( arg0, "getscom", 8 );
+ rc = (getRuntimeInterfaces()->run_command)( 3, argv, &outstr );
+ if( rc )
+ {
+ TS_FAIL( "testRunCommandScom3> rc=%d", rc );
+ }
+ TRACFCOMP( Util::g_util_trace, "testRunCommandScom3> rc=%d :: %s",
+ rc, outstr == NULL ? "null" : outstr );
+ if( outstr ) delete[] outstr;
+
+ }
};
OpenPOWER on IntegriCloud