diff options
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 |