summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice/extinitsvc
diff options
context:
space:
mode:
authorTerry J. Opie <opiet@us.ibm.com>2012-05-17 13:22:48 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-06-12 12:41:41 -0500
commitdec09123e59a74c471ab967cd662a57a53b16800 (patch)
tree04b78fe1863b4d72f91fdb3acbf12e1b292b4ed0 /src/usr/initservice/extinitsvc
parentc57e10754ce222368b371355509e2f505e724893 (diff)
downloadtalos-hostboot-dec09123e59a74c471ab967cd662a57a53b16800.tar.gz
talos-hostboot-dec09123e59a74c471ab967cd662a57a53b16800.zip
Host Start Payload
- Start Payload - System attributes for payload base/entry - Execute Cxx Unit tests before starting payload - Send mailbox messages to signal Fsp Change-Id: I314920c64d4c9deaa781696e02231ff8dc8de678 RTC: 39892 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1075 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/initservice/extinitsvc')
-rw-r--r--src/usr/initservice/extinitsvc/extinitsvc.C201
-rw-r--r--src/usr/initservice/extinitsvc/extinitsvc.H11
-rw-r--r--src/usr/initservice/extinitsvc/extinitsvctasks.H2
3 files changed, 117 insertions, 97 deletions
diff --git a/src/usr/initservice/extinitsvc/extinitsvc.C b/src/usr/initservice/extinitsvc/extinitsvc.C
index 0c42e9678..f90e97651 100644
--- a/src/usr/initservice/extinitsvc/extinitsvc.C
+++ b/src/usr/initservice/extinitsvc/extinitsvc.C
@@ -133,102 +133,6 @@ void ExtInitSvc::init( errlHndl_t &io_rtaskRetErrl )
task_end2( l_errl );
}
- TRACFCOMP( g_trac_initsvc,
- "ExtInitSvc finished OK.");
-
-
- // =====================================================================
- // ----- Unit Tests -------------------------------------------------
- // =====================================================================
- /**
- * @note run all of the unit tests after we finish the rest
- * There are 2 images generated in the build:
- * hbicore.bin (HostBoot shippable image)
- * hbicore_test.bin (runs all unit tests)
- * Only hbicore_test.bin has the libcxxtest.so module, so that's
- * how we test whether to run this.
- */
-
- // If the test task does not exist then don't run it.
- if ( VFS::module_exists( cxxTestTask.taskname ) )
- {
- printk( "CxxTest entry.\n" );
-
- // Pass it a set of args so we can wait on the barrier
- errlHndl_t l_cxxerrl = NULL;
- const TaskInfo *l_pcxxtask = &cxxTestTask;
-
- TRACDCOMP( g_trac_initsvc,
- "Run CxxTest Unit Tests: %s",
- l_pcxxtask->taskname );
-
- l_cxxerrl = InitService::getTheInstance().startTask( l_pcxxtask,
- NULL );
- // process any errorlogs from cxxtestexec (not sure there are any...)
- if ( l_cxxerrl )
- {
-#if 0
- // @todo detach this task and just do task_end()
- // First commit the errorlog...
- TRACFCOMP( g_trac_initsvc,
- "Committing errorlog %p from cxxtask",
- l_cxxerrl );
- errlCommit( l_cxxerrl, INITSVC_COMP_ID );
-
- // Tell the kernel to shut down. This will not actually
- // happen until the last thread has ended.
- InitService::getTheInstance().doShutdown( SHUTDOWN_STATUS_UT_FAILED);
-
- // end the task.
- end_task();
-#endif
-
- // end the task and pass the errorlog to initservice to be committed.
- // initservice should do the shutdown.
- TRACFCOMP( g_trac_initsvc,
- "CxxTest: ERROR: return to initsvc with errlog %p",
- l_cxxerrl );
-
- task_end2( l_cxxerrl );
- } // endif l_cxxerrl
-
-
- // make up and post an errorlog if any tests failed.
- if ( CxxTest::g_FailedTests )
- {
- // some unit tests failed, post an errorlog
- /*@ errorlog tag
- * @errortype ERRL_SEV_CRITICAL_SYS_TERM
- * @moduleid CXXTEST_MOD_ID
- * @reasoncode CXXTEST_FAILED_TEST
- * @userdata1 number of failed tests
- * @userdata2 0
- *
- * @devdesc One or more CxxTest Unit Tests failed.
- *
- */
- l_cxxerrl = new ERRORLOG::ErrlEntry(
- ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM,
- INITSERVICE::CXXTEST_MOD_ID,
- INITSERVICE::CXXTEST_FAILED_TEST,
- CxxTest::g_FailedTests,
- 0 );
- TRACFCOMP( g_trac_initsvc,
- "CxxTest ERROR: %d failed tests, build errlog %p.",
- CxxTest::g_FailedTests,
- l_cxxerrl );
-
- // end the task and pass the errorlog to initservice to be committed.
- // initservice should do the shutdown.
- TRACFCOMP( g_trac_initsvc, "CxxTest: return to initsvc with errlog" );
-
- task_end2( l_cxxerrl );
- } // endif g_FailedTest
-
- printk( "CxxTest exit.\n" );
-
- } // endif cxxtest module exists.
-
// finish things up, return to initservice with goodness.
TRACFCOMP( g_trac_initsvc,
"ExtInitSvc finished OK, return to initsvc with NULL.");
@@ -253,4 +157,109 @@ ExtInitSvc::~ExtInitSvc()
{ }
+//
+// Execute CXX Unit Tests
+// NOTE: This should be done right before doShutDown is called.
+//
+errlHndl_t executeUnitTests ( void )
+{
+ return Singleton<ExtInitSvc>::instance().executeUnitTests();
+}
+
+errlHndl_t ExtInitSvc::executeUnitTests ( void )
+{
+ errlHndl_t err = NULL;
+
+ TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ ENTER_MRK"executeUnitTests()" );
+
+ do
+ {
+ // ---------------------------------------------------------------------
+ // ----- Unit Tests -------------------------------------------------
+ // ---------------------------------------------------------------------
+ /**
+ * @note run all of the unit tests after we finish the rest
+ * There are 2 images generated in the build:
+ * hbicore.bin (HostBoot shippable image)
+ * hbicore_test.bin (runs all unit tests)
+ * Only hbicore_test.bin has the libcxxtest.so module, so that's
+ * how we test whether to run this.
+ */
+ // If the test task does not exist then don't run it.
+ if ( VFS::module_exists( cxxTestTask.taskname ) )
+ {
+ printk( "CxxTest entry.\n" );
+
+ // Pass it a set of args so we can wait on the barrier
+ errlHndl_t l_cxxerrl = NULL;
+ const INITSERVICE::TaskInfo *l_pcxxtask = &cxxTestTask;
+
+ TRACFCOMP( g_trac_initsvc,
+ "Run CxxTest Unit Tests: %s",
+ l_pcxxtask->taskname );
+
+ INITSERVICE::InitService &is
+ = INITSERVICE::InitService::getTheInstance();
+ l_cxxerrl = is.startTask( l_pcxxtask,
+ NULL );
+
+ // process any errorlogs from cxxtestexec (not sure there are any...)
+ if ( l_cxxerrl )
+ {
+ // end the task and pass the errorlog to initservice to be
+ // committed. initservice should do the shutdown.
+ TRACFCOMP( g_trac_initsvc,
+ "CxxTest: ERROR: return to host_start_payload istep "
+ "with errlog %p",
+ l_cxxerrl );
+
+ err = l_cxxerrl;
+ break;
+ } // endif l_cxxerrl
+
+
+ // make up and post an errorlog if any tests failed.
+ if ( CxxTest::g_FailedTests )
+ {
+ // some unit tests failed, post an errorlog
+ /*@ errorlog tag
+ * @errortype ERRL_SEV_CRITICAL_SYS_TERM
+ * @moduleid CXXTEST_MOD_ID
+ * @reasoncode CXXTEST_FAILED_TEST
+ * @userdata1 number of failed tests
+ * @userdata2 <UNUSED>
+ * @devdesc One or more CxxTest Unit Tests failed.
+ */
+ l_cxxerrl = new ERRORLOG::ErrlEntry(
+ ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM,
+ INITSERVICE::CXXTEST_MOD_ID,
+ INITSERVICE::CXXTEST_FAILED_TEST,
+ CxxTest::g_FailedTests,
+ 0 );
+
+ TRACFCOMP( g_trac_initsvc,
+ "CxxTest ERROR: %d failed tests, build errlog %p.",
+ CxxTest::g_FailedTests,
+ l_cxxerrl );
+
+ // end the task and pass the errorlog to initservice to be
+ // committed. initservice should do the shutdown.
+ TRACFCOMP( g_trac_initsvc,
+ "CxxTest: return to host_start_payload with errlog!" );
+
+ err = l_cxxerrl;
+ break;
+ } // endif g_FailedTest
+
+ printk( "CxxTest exit.\n" );
+ } // endif cxxtest module exists.
+ } while( 0 );
+
+ TRACDCOMP( g_trac_initsvc,
+ EXIT_MRK"executeUnitTests()" );
+
+ return err;
+}
+
} // namespace
diff --git a/src/usr/initservice/extinitsvc/extinitsvc.H b/src/usr/initservice/extinitsvc/extinitsvc.H
index 7c6acec1b..f2643812a 100644
--- a/src/usr/initservice/extinitsvc/extinitsvc.H
+++ b/src/usr/initservice/extinitsvc/extinitsvc.H
@@ -91,6 +91,17 @@ public:
void init( errlHndl_t &io_rtaskRetErrl );
+ /**
+ * @brief This function will execute the Cxx Unit tests for Hostboot. It is
+ * to be done here, instead of in Initservice, because when this istep
+ * completes the Payload will be started.
+ *
+ * @return errlHndl_t - NULL if successfule, otherwise a pointer to the error
+ * log.
+ */
+ errlHndl_t executeUnitTests ( void );
+
+
protected:
/**
* @brief Constructor for the InitService object.
diff --git a/src/usr/initservice/extinitsvc/extinitsvctasks.H b/src/usr/initservice/extinitsvc/extinitsvctasks.H
index 7b4da54c7..f9cbb9ff8 100644
--- a/src/usr/initservice/extinitsvc/extinitsvctasks.H
+++ b/src/usr/initservice/extinitsvc/extinitsvctasks.H
@@ -84,7 +84,7 @@ const TaskInfo g_exttaskinfolist[] = {
"libmbox.so", // taskname
NULL, // no ptr to fnct
{
-
+
START_TASK, // task type
EXT_IMAGE, // Extended Module
}
OpenPOWER on IntegriCloud