diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2019-02-11 11:47:13 -0600 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2019-02-28 09:51:50 -0600 |
commit | 7c0b8df175832b8ffb7510977283c0c390be9c8c (patch) | |
tree | 643df1eae00336f48392d36e2a7e40250831ad4c /src/usr/runtime | |
parent | cbea08dbf1b3609db30637d554f5cb47897f034f (diff) | |
download | talos-hostboot-7c0b8df175832b8ffb7510977283c0c390be9c8c.tar.gz talos-hostboot-7c0b8df175832b8ffb7510977283c0c390be9c8c.zip |
Method to execute testcases early in the boot
A new CONFIG variable has been created that will trigger the
istep dispatcher to start the CXX unit test execution at some
point during the boot rather than waiting until the end. This
is useful for quick targeted testing and also for early bringup
of new platforms.
CONFIG_EARLY_TESTCASES is the new flag, and it uses
ATTR_EARLY_TESTCASES_ISTEP to determine where in the boot to stop.
Changes were required in several testcases to either skip the
test completely (typically due to not having enough memory) or
to add additional logic to load new support libraries on demand.
The Axone platform has this flag enabled by default to execute
testcases at the end of istep 6.9 (host_gard).
Change-Id: I1da9479e2147d68102f44d60e064c3b79cc41bb6
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71693
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/runtime')
-rw-r--r-- | src/usr/runtime/test/hdatservicetest.H | 41 | ||||
-rw-r--r-- | src/usr/runtime/test/makefile | 4 | ||||
-rw-r--r-- | src/usr/runtime/test/test_checkHbResMemLimit.H | 38 | ||||
-rw-r--r-- | src/usr/runtime/test/testpreverifiedlidmgr.H | 37 |
4 files changed, 117 insertions, 3 deletions
diff --git a/src/usr/runtime/test/hdatservicetest.H b/src/usr/runtime/test/hdatservicetest.H index cfd70ddfb..0fff39e5b 100644 --- a/src/usr/runtime/test/hdatservicetest.H +++ b/src/usr/runtime/test/hdatservicetest.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -38,6 +40,7 @@ #include "../hdatstructs.H" #include "../errlud_hdat.H" #include <runtime/runtime_reasoncodes.H> +#include <vfs/vfs.H> /* * To test with a custom HDAT do the following: @@ -441,6 +444,42 @@ class HdatServiceTest: public CxxTest::TestSuite #endif } + // Handle the case where we are running the testcases before the + // libruntime.so module has been loaded + bool iv_loaded_libruntime; + + HdatServiceTest() + : CxxTest::TestSuite(), iv_loaded_libruntime(false) + { + // Need to load up the runtime module if it isn't already loaded + if ( !VFS::module_is_loaded( "libruntime.so" ) ) + { + errlHndl_t errhdl = VFS::module_load( "libruntime.so" ); + if ( errhdl ) + { + TS_FAIL("HdatServiceTest> Failed to load libruntime.so"); + errlCommit(errhdl,RUNTIME_COMP_ID); + } + else + { + iv_loaded_libruntime = true; + } + } + } + + ~HdatServiceTest() + { + if( iv_loaded_libruntime ) + { + errlHndl_t errhdl = VFS::module_unload( "libruntime.so" ); + if ( errhdl ) + { + TS_FAIL("HdatServiceTest> Failed to unload libruntime.so"); + errlCommit(errhdl,RUNTIME_COMP_ID); + } + } + } + }; diff --git a/src/usr/runtime/test/makefile b/src/usr/runtime/test/makefile index b948c1a16..a5fec043d 100644 --- a/src/usr/runtime/test/makefile +++ b/src/usr/runtime/test/makefile @@ -5,7 +5,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2018 +# Contributors Listed Below - COPYRIGHT 2012,2019 # [+] International Business Machines Corp. # # @@ -24,7 +24,7 @@ # IBM_PROLOG_END_TAG ROOTPATH = ../../../.. MODULE = testruntime -TESTS += testpreverifiedlidmgr.H +TESTS += $(if $(CONFIG_EARLY_TESTCASES),,testpreverifiedlidmgr.H) TESTS += test_checkHbResMemLimit.H #@TODO RTC 132750 #TESTS += hdatservicetest.H diff --git a/src/usr/runtime/test/test_checkHbResMemLimit.H b/src/usr/runtime/test/test_checkHbResMemLimit.H index e2ab9ca41..234f26426 100644 --- a/src/usr/runtime/test/test_checkHbResMemLimit.H +++ b/src/usr/runtime/test/test_checkHbResMemLimit.H @@ -32,6 +32,7 @@ #include <runtime/interface.h> #include <runtime/runtime_reasoncodes.H> #include <vmmconst.h> +#include <vfs/vfs.H> extern trace_desc_t* g_trac_runtime; @@ -151,6 +152,43 @@ public: }while(0); TRACFCOMP(g_trac_runtime, "testAddressBelowHbResMemRange finished"); } + + + // Handle the case where we are running the testcases before the + // libruntime.so module has been loaded + bool iv_loaded_libruntime; + + CheckHbResMemLimitTest() + : CxxTest::TestSuite(), iv_loaded_libruntime(false) + { + // Need to load up the runtime module if it isn't already loaded + if ( !VFS::module_is_loaded( "libruntime.so" ) ) + { + errlHndl_t errhdl = VFS::module_load( "libruntime.so" ); + if ( errhdl ) + { + TS_FAIL("CheckHbResMemLimitTest> Failed to load libruntime.so"); + errlCommit(errhdl,RUNTIME_COMP_ID); + } + else + { + iv_loaded_libruntime = true; + } + } + } + + ~CheckHbResMemLimitTest() + { + if( iv_loaded_libruntime ) + { + errlHndl_t errhdl = VFS::module_unload( "libruntime.so" ); + if ( errhdl ) + { + TS_FAIL("CheckHbResMemLimitTest> Failed to unload libruntime.so"); + errlCommit(errhdl,RUNTIME_COMP_ID); + } + } + } }; diff --git a/src/usr/runtime/test/testpreverifiedlidmgr.H b/src/usr/runtime/test/testpreverifiedlidmgr.H index 78fcbd95c..7b47bf98f 100644 --- a/src/usr/runtime/test/testpreverifiedlidmgr.H +++ b/src/usr/runtime/test/testpreverifiedlidmgr.H @@ -33,6 +33,7 @@ #include <runtime/populate_hbruntime.H> #include <pnor/pnorif.H> #include <runtime/common/runtime_utils.H> +#include <vfs/vfs.H> extern trace_desc_t* g_trac_runtime; @@ -138,6 +139,42 @@ class PreVerifiedLidMgrTest : public CxxTest::TestSuite TRACFCOMP( g_trac_runtime, EXIT_MRK"testLoadFromPnor complete" ); } + + // Handle the case where we are running the testcases before the + // libruntime.so module has been loaded + bool iv_loaded_libruntime; + + PreVerifiedLidMgrTest() + : CxxTest::TestSuite(), iv_loaded_libruntime(false) + { + // Need to load up the runtime module if it isn't already loaded + if ( !VFS::module_is_loaded( "libruntime.so" ) ) + { + errlHndl_t errhdl = VFS::module_load( "libruntime.so" ); + if ( errhdl ) + { + TS_FAIL("PreVerifiedLidMgrTest> Failed to load libruntime.so"); + errlCommit(errhdl,RUNTIME_COMP_ID); + } + else + { + iv_loaded_libruntime = true; + } + } + } + + ~PreVerifiedLidMgrTest() + { + if( iv_loaded_libruntime ) + { + errlHndl_t errhdl = VFS::module_unload( "libruntime.so" ); + if ( errhdl ) + { + TS_FAIL("PreVerifiedLidMgrTest> Failed to unload libruntime.so"); + errlCommit(errhdl,RUNTIME_COMP_ID); + } + } + } }; #endif |