summaryrefslogtreecommitdiff
path: root/modules/CIAO/tests/Bug_2130_Regression
diff options
context:
space:
mode:
Diffstat (limited to 'modules/CIAO/tests/Bug_2130_Regression')
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/Logs/PROBLEM-REPORT-FORM93
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.idl27
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc121
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPointEI.idl18
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp592
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h244
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp197
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/descriptors/DeploymentPlan.cdp117
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/descriptors/TestNodeManagerMap.dat1
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/descriptors/rt-config-example.csr30
-rwxr-xr-xmodules/CIAO/tests/Bug_2130_Regression/descriptors/run_test.pl210
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.idl52
-rw-r--r--modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc44
13 files changed, 1746 insertions, 0 deletions
diff --git a/modules/CIAO/tests/Bug_2130_Regression/Logs/PROBLEM-REPORT-FORM b/modules/CIAO/tests/Bug_2130_Regression/Logs/PROBLEM-REPORT-FORM
new file mode 100644
index 00000000000..df98c63f06d
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/Logs/PROBLEM-REPORT-FORM
@@ -0,0 +1,93 @@
+To: ciao-users@cs.wustl.edu
+Subject: RTComponentServer: Session_Container::get_objref blocks
+
+ CIAO VERSION: 0.4.7
+ TAO VERSION : 1.4.7
+ ACE VERSION : 5.4.7
+
+ HOST MACHINE and OPERATING SYSTEM:
+ Intel(R) Pentium(R) D CPU 3.00GHZ
+ Microsoft Windows XP Professional Version 2002 Service Pack 2
+
+ COMPILER NAME AND VERSION (AND PATCHLEVEL):
+ Microsoft Visual C++ .NET 2003
+ Microsoft (R) 32-Bit C/C++-Optimierungscompiler Version 13.10.3077
+
+ THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
+ specific file, simply state which one]:
+ #include "ace/config-win32.h"
+
+ THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
+ use a link to a platform-specific file, simply state which one
+ (unless this isn't used in this case, e.g., with Microsoft Visual
+ C++)]:
+
+ CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
+ ssl=0
+ qos=1
+ cidl=0
+ rwho=0
+ sctp=0
+ qt=1
+
+ AREA/CLASS/EXAMPLE AFFECTED:
+ CIAO/ciao/Session_Container::get_objref
+
+
+ DOES THE PROBLEM AFFECT:
+ COMPILATION?
+ No
+ LINKING?
+ No
+ EXECUTION?
+ Yes
+ OTHER (please specify)?
+[Please indicate whether ACE/TAO/CIAO, your application, or both are affected.]
+
+ SYNOPSIS:
+ A call of Session_Container::get_objref blocks forever.
+
+ DESCRIPTION:
+ I'm running two clients simultaneously callings the methods acquireSession
+ and releaseSession of the CORBA component TSEC_CheckPoint ( please see
+ sample code in TSEC_CheckPoint_exec.cpp lines 233... and 283... and also
+ controller.cpp line 150... ) configured with realtime policies. After the
+ start of the second client the component TSEC_CheckPoint blocks in the
+ method Session_Container::get_objref ( please see the log file
+ DebuggerCallStack.log ).
+
+ The serious code line of TSEC_CheckPoint_exec.cpp is:
+ CORBA::Object_var obj = this->getObjRef( p_sessionImpl) ;
+
+ If only one client is calling acquireSession every thing works fine.
+ But if I start a second client which is calling acquireSession then the
+ block happens.
+
+ I'm using the patch from 20051612 for the files
+ Container_Base.cpp and Container_Base.h which I merge with the CIAO
+ version 047.
+
+ If i use CIAO version < 043 everythings works fine with no blocks.
+
+ REPEAT BY:
+ Please build the sample code:
+ - cd interfaces
+ - mwc.pl -type nmake
+ - nmake realclean clean depend all
+ - touch *.idl
+ - nmake
+ - cd SEC_CheckPoint
+ - mwc.pl -type nmake
+ - nmake realclean clean depend all
+
+ Please run the sample:
+ - cd descriptors
+ - start_da.bat
+ - start_am.bat
+ - start_test.bat
+ - start_testcase_1.bat
+ - start_testcase_2.bat
+
+
+ SAMPLE FIX/WORKAROUND:
+[If available ]
diff --git a/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.idl b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.idl
new file mode 100644
index 00000000000..83d68fc4353
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.idl
@@ -0,0 +1,27 @@
+//$Id$
+
+#ifndef TSEC_CHECKPOINT_IDL
+#define TSEC_CHECKPOINT_IDL
+
+#include "../interfaces/ENW.idl"
+
+
+module ENW
+{
+ component TSEC_CheckPoint supports ISessionService
+ {
+ provides ISessionService sessionService;
+
+ consumes ET_LifeToken lifeTokenIn;
+ publishes ET_LifeToken lifeTokenOut;
+
+ };
+
+ home TSEC_CheckPointHome manages TSEC_CheckPoint
+ {
+ factory new_TSEC_CheckPoint( in string Version );
+ };
+};
+
+
+#endif // TSEC_CHECKPOINT_IDL
diff --git a/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc
new file mode 100644
index 00000000000..9e7a1102f55
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint.mpc
@@ -0,0 +1,121 @@
+//$Id$
+
+project(TSEC_CheckPoint_idl_gen) : componentidldefaults {
+ custom_only = 1
+ idlflags += -Wb,stub_export_macro=TSEC_CHECKPOINT_STUB_Export \
+ -Wb,stub_export_include=TSEC_CheckPoint_stub_export.h \
+ -Wb,skel_export_macro=TSEC_CHECKPOINT_SVNT_Export \
+ -Wb,skel_export_include=TSEC_CheckPoint_svnt_export.h \
+ -Wb,exec_export_macro=TSEC_CHECKPOINT_EXEC_Export \
+ -Wb,exec_export_include=TSEC_CheckPoint_exec_export.h \
+ -Glfa
+ requires += dummy_label
+
+ IDL_Files {
+ TSEC_CheckPoint.idl
+ }
+}
+
+project(TSEC_CheckPoint_lem_gen) : ciaoidldefaults {
+ custom_only = 1
+ after += TSEC_CheckPoint_idl_gen
+ idlflags += -SS -St \
+ -Wb,export_macro=TSEC_CHECKPOINT_EXEC_Export \
+ -Wb,export_include=TSEC_CheckPoint_exec_export.h
+
+ requires += dummy_label
+ IDL_Files {
+ TSEC_CheckPointE.idl
+ }
+}
+
+
+project(TSEC_CheckPoint_stub): ccm_stub, event {
+ after += ENW_stub TSEC_CheckPoint_idl_gen
+ libpaths += ../interfaces
+ libs += ENW_stub
+ sharedname = TSEC_CheckPoint_stub
+ dynamicflags = TSEC_CHECKPOINT_STUB_BUILD_DLL
+ requires += dummy_label
+ IDL_Files {
+ }
+
+ Source_Files {
+ TSEC_CheckPointC.cpp
+ }
+
+ Header_Files {
+ TSEC_CheckPointC.h
+ TSEC_CheckPoint_stub_export.h
+ }
+
+ Inline_Files {
+ TSEC_CheckPointC.inl
+ }
+}
+
+project(TSEC_CheckPoint_svnt) : ciao_servant, event {
+ after += TSEC_CheckPoint_skel TSEC_CheckPoint_exec
+ after += ENW_skel ENW_stub
+ sharedname = TSEC_CheckPoint_svnt
+ libpaths += ../interfaces
+ libs += TSEC_CheckPoint_stub TSEC_CheckPoint_exec
+ libs += ENW_stub ENW_skel
+ requires += dummy_label
+ dynamicflags = TSEC_CHECKPOINT_SVNT_BUILD_DLL
+ requires += dummy_label
+ IDL_Files {
+ }
+
+ Source_Files {
+ TSEC_CheckPointS.cpp
+ TSEC_CheckPoint_svnt.cpp
+ }
+}
+
+
+project(TSEC_CheckPoint_exec) : ciao_executor, event, ccm_svnt, ciao_session_container, naming {
+ after += TSEC_CheckPoint_stub TSEC_CheckPoint_lem_gen
+ after += ENW_skel ENW_stub
+ requires += dummy_label
+ includes += ../interfaces
+
+ sharedname = TSEC_CheckPoint_exec
+ libpaths += ../interfaces
+ libs += TSEC_CheckPoint_stub
+ libs += ENW_stub ENW_skel
+
+ idlflags -= -GT
+ idlflags += -SS -St \
+ -Wb,export_macro=TSEC_CHECKPOINT_EXEC_Export \
+ -Wb,export_include=TSEC_CheckPoint_exec_export.h
+ dynamicflags = TSEC_CHECKPOINT_EXEC_BUILD_DLL
+
+ IDL_Files {
+ TSEC_CheckPointEI.idl
+ }
+
+ Source_Files {
+ TSEC_CheckPointEC.cpp
+ TSEC_CheckPointEIC.cpp
+ TSEC_CheckPoint_exec.cpp
+ }
+}
+
+
+project(TSEC_CheckPoint_controller) : ccm_stub, valuetype, event {
+ exename = controller
+ after += TSEC_CheckPoint_stub
+ libs += TSEC_CheckPoint_stub ENW_stub
+ libpaths += ../interfaces
+ requires += dummy_label
+ IDL_Files {
+ }
+
+ Source_Files {
+ controller.cpp
+ }
+}
+
+
+
diff --git a/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPointEI.idl b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPointEI.idl
new file mode 100644
index 00000000000..c2b2a15b719
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPointEI.idl
@@ -0,0 +1,18 @@
+// $Id$
+
+#ifndef TSEC_CHECKPOINTEI_IDL
+#define TSEC_CHECKPOINTEI_IDL
+
+#include "TSEC_CheckPoint.idl"
+
+module ENW
+{
+ local interface TSEC_CheckPoint_Exec :
+ CCM_TSEC_CheckPoint,
+ CCM_ISessionService,
+ Components::SessionComponent
+ {
+ };
+};
+
+#endif /* TSEC_CHECKPOINTEI_IDL */
diff --git a/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp
new file mode 100644
index 00000000000..8f2b0c02d3d
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.cpp
@@ -0,0 +1,592 @@
+//$Id$
+
+//-------------------------------------------------------------------
+// Includes
+//-------------------------------------------------------------------
+
+#include "ace/Timer_Queue.h"
+#include "ace/Reactor.h"
+#include "ace/os_include/os_assert.h"
+
+#include "tao/LocalObject.h"
+#include <orbsvcs/CosNamingC.h>
+
+#include "ciao/Version.h"
+#include "ciao/Containers/Session/Session_Container.h"
+#include "TSEC_CheckPoint_exec.h"
+#include "TSEC_CheckPoint_svnt.h"
+
+
+//-------------------------------------------------------------------
+// Defines
+//-------------------------------------------------------------------
+
+#define SEPARATION_LINE "----------------------------------------" \
+ "----------------------------------------\n"
+
+
+//-------------------------------------------------------------------
+// Statics
+//-------------------------------------------------------------------
+
+static const char* argv[] =
+{
+ "TSEC_CheckPoint"
+};
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_SessionEntry::TSEC_SessionEntry()
+: _p_sessionImpl( 0 )
+{
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_SessionEntry::TSEC_SessionEntry
+(
+ TSEC_Session_impl* pSessionImpl,
+ ENW::TSession_ptr Session
+)
+: _p_sessionImpl( pSessionImpl )
+{
+ if( !CORBA::is_nil( Session ) )
+ {
+ _session = ENW::TSession::_duplicate( Session );
+ }
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_Session_impl::TSEC_Session_impl
+(
+ TSEC_CheckPoint_exec_i& Parent,
+ CORBA::Long Ident
+)
+ : _isInUse(0),_ident( Ident ),_parent( Parent )
+{
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_Session_impl::~TSEC_Session_impl()
+{
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+CORBA::ULong
+Impl::TSEC_Session_impl::hash
+(
+ CORBA::ULong Maximum
+)
+{
+ CORBA::ULong hash =
+ static_cast <CORBA::ULong> (reinterpret_cast <ptrdiff_t> (this));
+
+ return hash % Maximum;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+CORBA::Long
+Impl::TSEC_Session_impl::getIdent
+(
+)
+{
+ //ACE_GUARD_RETURN( TMutex, guard, _parent.getMutex(), -1 );
+
+ return _ident;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+CORBA::Boolean
+Impl::TSEC_Session_impl::isInUse
+(
+)
+{
+ //ACE_GUARD_RETURN( TMutex, guard, _parent.getMutex(), FALSE );
+ return _isInUse;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_CheckPoint_exec_i::TSEC_CheckPoint_exec_i()
+: _p_sessionContainer( 0 ),
+ _isActivated( false )
+{
+ ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::"
+ "TSEC_CheckPoint_exec_i\n" ) );
+
+ this->init();
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_CheckPoint_exec_i::TSEC_CheckPoint_exec_i
+(
+ const char* /*Version*/
+)
+: _p_sessionContainer( 0 ),
+ _isActivated( false )
+{
+ ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::"
+ "TSEC_CheckPoint_exec_i\n" ) );
+ this->init();
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_CheckPoint_exec_i::~TSEC_CheckPoint_exec_i()
+{
+ ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::"
+ "~TSEC_CheckPoint_exec_i\n" ) );
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+CORBA::Object_ptr
+Impl::TSEC_CheckPoint_exec_i::getObjRef
+(
+ PortableServer::Servant Servant
+)
+{
+ return this->_p_sessionContainer->get_objref( Servant );
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+int
+Impl::TSEC_CheckPoint_exec_i::init
+(
+)
+{
+ ACE_DEBUG ((LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::init\n"));
+
+ int argc = sizeof( argv ) / sizeof( argv[0] );
+
+ CORBA::ORB_var orb = CORBA::ORB_init( argc,
+ const_cast<char **> (argv)
+ );
+ _orb = CORBA::ORB::_duplicate( orb.in () );
+
+ return 0;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+CORBA::Object_ptr
+Impl::TSEC_CheckPoint_exec_i::installServant
+(
+ PortableServer::Servant Servant
+)
+{
+ assert( this->_p_sessionContainer );
+ PortableServer::ObjectId_var oid;
+ return this->_p_sessionContainer->install_servant( Servant,
+ CIAO::Container_Types::COMPONENT_t, oid.out ());
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+void
+Impl::TSEC_CheckPoint_exec_i::uninstallServant
+(
+ CORBA::Object_ptr ObjRef
+)
+{
+ assert( this->_p_sessionContainer );
+
+ this->_p_sessionContainer->uninstall( ObjRef, CIAO::Container_Types::COMPONENT_t);
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+ENW::TSession_ptr
+Impl::TSEC_CheckPoint_exec_i::createSession
+(
+)
+{
+ static long cnt = 0L;
+
+ ENW::TSession_var session = ENW::TSession::_nil();
+
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::createSession...\n" ) );
+
+ TSEC_Session_impl* p_sessionImpl = new TSEC_Session_impl( *this, ++cnt );
+ PortableServer::ServantBase_var safe_servant( p_sessionImpl );
+ CORBA::Object_var obj = this->installServant( p_sessionImpl
+ );
+ session = ENW::TSession::_narrow ( obj.in () );
+
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::createSession...[DONE]\n" ) );
+
+ return session._retn();
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+::CORBA::Boolean
+Impl::TSEC_CheckPoint_exec_i::destroySession
+(
+ ENW::TSession_ptr Session
+)
+{
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::destroySession...\n" ) );
+
+ if( CORBA::is_nil( Session ) )
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::destroySession...[ERROR]\n" ) );
+ return 0;
+ }
+
+ this->uninstallServant( Session );
+
+ return 1;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+ENW::TSession_ptr
+Impl::TSEC_CheckPoint_exec_i::acquireSession
+(
+ CORBA::Long Ident
+)
+{
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::acquireSession...\n" ) );
+
+ if( Ident <= 0 || Ident > TSEC_SESSION_MAX_IDENT )
+ {
+ if( Ident != -1 )
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...[ERROR]\n" ) );
+ throw ENW::EUnknownIdent();
+ }
+ }
+
+ ENW::TSession_var session = ENW::TSession::_nil();
+ TSEC_Session_impl* p_sessionImpl = 0;
+
+ try
+ {
+ {
+ //ACE_GUARD_RETURN( TMutex, guard, _mutex, ENW::TSession::_nil() );
+ p_sessionImpl = sessionVector[Ident-1]._p_sessionImpl;
+ }
+
+ p_sessionImpl->isInUse( 1 );
+ CORBA::Object_var obj = this->getObjRef( p_sessionImpl) ;
+ session = ENW::TSession::_narrow ( obj.in () );
+ //session = sessionVector[Ident-1]._session;
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Reason\n");
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...[ERROR]\n" ) );
+
+ return session._retn();
+ }
+
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...[DONE]\n" ) );
+
+ return session._retn();
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+::CORBA::Boolean
+Impl::TSEC_CheckPoint_exec_i::releaseSession
+(
+ CORBA::Long Ident,
+ ENW::TSession_ptr Session
+)
+{
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...\n" ) );
+
+ if( CORBA::is_nil( Session ) )
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...[ERROR]\n" ) );
+ throw ENW::EUnknownSession();
+ }
+
+ //CORBA::Long ident = Session->getIdent();
+ CORBA::Long ident = Ident;
+
+ if( ident <= 0 || ident > TSEC_SESSION_MAX_IDENT )
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...[ERROR]\n" ) );
+ return 0;;
+ }
+
+ TSEC_Session_impl* p_sessionImpl = 0;
+
+ {
+ //ACE_GUARD_RETURN( TMutex, guard, _mutex, FALSE );
+
+ p_sessionImpl = sessionVector[ident-1]._p_sessionImpl;
+ }
+
+ assert( p_sessionImpl );
+
+
+ if( !p_sessionImpl->isInUse() )
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...[ERROR]\n" ) );
+ return 0;
+ }
+
+ p_sessionImpl->isInUse( 0);
+
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) TSEC_CheckPoint_exec_i::releaseSession...[DONE]\n" ) );
+
+ return 1;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+ENW::CCM_ISessionService_ptr
+Impl::TSEC_CheckPoint_exec_i::get_sessionService
+(
+)
+{
+ return ENW::CCM_ISessionService::_duplicate( this );
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+void
+Impl::TSEC_CheckPoint_exec_i::set_session_context
+(
+ Components::SessionContext_ptr Ctx
+)
+{
+ ACE_DEBUG( ( LM_DEBUG,
+ "Impl::TSEC_CheckPoint_exec_i::set_session_context\n" ) );
+
+ this->_context =
+ ENW::CCM_TSEC_CheckPoint_Context::_narrow( Ctx
+ );
+
+ if( CORBA::is_nil( this->_context.in() ) )
+ {
+ throw CORBA::INTERNAL();
+ }
+
+ CIAO_ENW_TSEC_CheckPoint_Impl::TSEC_CheckPoint_Context* p_checkPoint_Context =
+ CIAO_ENW_TSEC_CheckPoint_Impl::TSEC_CheckPoint_Context::_narrow( Ctx );
+
+ if( !p_checkPoint_Context )
+ {
+ throw CORBA::INTERNAL();
+ }
+
+ this->_p_sessionContainer = dynamic_cast < ::CIAO::Session_Container*>(p_checkPoint_Context->_ciao_the_Container());
+
+ if( !_p_sessionContainer )
+ {
+ throw CORBA::INTERNAL();
+ }
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+void
+Impl::TSEC_CheckPoint_exec_i::push_lifeTokenIn
+(
+ ENW::ET_LifeToken* /* Event */
+)
+{
+ _awaitingLifeToken = false;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+void
+Impl::TSEC_CheckPoint_exec_i::configuration_complete
+(
+)
+{
+ ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::configuration_complete\n" ) );
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+void
+Impl::TSEC_CheckPoint_exec_i::ccm_activate
+(
+)
+{
+ ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::ccm_activate\n" ) );
+
+ TSEC_Session_impl* p_sessionImpl = 0;
+
+ for( CORBA::Long i = 0; i < TSEC_SESSION_MAX_IDENT; ++i )
+ {
+ p_sessionImpl = new TSEC_Session_impl( *this, i + 1 );
+ PortableServer::ServantBase_var safe_servant( p_sessionImpl );
+ CORBA::Object_var obj = this->installServant( p_sessionImpl
+ );
+ ENW::TSession_var session =
+ ENW::TSession::_narrow ( obj.in () );
+ sessionVector[i] = TSEC_SessionEntry( p_sessionImpl, session.in () );
+ }
+
+ _isActivated = true;
+}
+
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+void
+Impl::TSEC_CheckPoint_exec_i::ccm_passivate
+(
+)
+{
+ ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::ccm_passivate\n" ) );
+ _isActivated = false;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+void
+Impl::TSEC_CheckPoint_exec_i::ccm_remove
+(
+)
+{
+ ACE_DEBUG( ( LM_DEBUG, "Impl::TSEC_CheckPoint_exec_i::ccm_remove\n" ) );
+ _isActivated = false;
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_CheckPointHome_exec_i::TSEC_CheckPointHome_exec_i()
+{
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+Impl::TSEC_CheckPointHome_exec_i::~TSEC_CheckPointHome_exec_i()
+{
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+::Components::EnterpriseComponent_ptr
+Impl::TSEC_CheckPointHome_exec_i::new_TSEC_CheckPoint
+(
+ const char* Version
+ )
+{
+ return new Impl::TSEC_CheckPoint_exec_i( Version );
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+::Components::EnterpriseComponent_ptr
+Impl::TSEC_CheckPointHome_exec_i::create
+(
+)
+{
+
+ return new Impl::TSEC_CheckPoint_exec_i();
+}
+
+
+//-------------------------------------------------------------------
+// Operation
+//-------------------------------------------------------------------
+
+extern "C" TSEC_CHECKPOINT_EXEC_Export ::Components::HomeExecutorBase_ptr
+createTSEC_CheckPointHome_Impl()
+{
+ return new Impl::TSEC_CheckPointHome_exec_i();
+}
+
diff --git a/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h
new file mode 100644
index 00000000000..7f09543ea32
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec.h
@@ -0,0 +1,244 @@
+//$Id$
+
+//===================================================================
+/**
+ * @file TSEC_CheckPoint_exec.h
+ *
+ * Header file for the Executor implementation.
+ */
+//===================================================================
+
+#ifndef TSEC_CheckPoint_EXEC_H
+#define TSEC_CheckPoint_EXEC_H
+
+//-------------------------------------------------------------------
+// Includes
+//-------------------------------------------------------------------
+
+#include "ace/Thread_Manager.h"
+#include "ace/Task.h"
+
+#include "tao/LocalObject.h"
+
+#include "ENWS.h"
+#include "TSEC_CheckPointEIC.h"
+#include "TSEC_CheckPoint_exec_export.h"
+
+
+//-------------------------------------------------------------------
+// Defines
+//-------------------------------------------------------------------
+
+#define TSEC_SESSION_ID_MAX 0xffffffff
+#define TSEC_SESSION_MAX_IDENT 2
+
+
+//-------------------------------------------------------------------
+// Type definitions
+//-------------------------------------------------------------------
+
+
+//-------------------------------------------------------------------
+// Forward declarations
+//-------------------------------------------------------------------
+
+
+//-------------------------------------------------------------------
+// Classes
+//-------------------------------------------------------------------
+
+namespace Impl
+{
+ typedef TAO_SYNCH_MUTEX TMutex;
+
+ class TSEC_CheckPoint_exec_i;
+
+ class TSEC_Session_impl :
+ public virtual POA_ENW::TSession,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+
+ TSEC_Session_impl
+ (
+ TSEC_CheckPoint_exec_i& Parent,
+ CORBA::Long Ident
+ );
+
+ virtual ~TSEC_Session_impl();
+
+ CORBA::Long getIdent();
+ CORBA::Boolean isInUse();
+ void isInUse( CORBA::Boolean Flag ) { _isInUse = Flag; }
+
+ protected:
+ CORBA::Boolean _isInUse;
+ CORBA::Long _ident;
+
+ TSEC_CheckPoint_exec_i& _parent;
+
+ CORBA::ULong hash
+ (
+ CORBA::ULong Maximum
+ );
+
+ TSEC_CheckPoint_exec_i& getParent() { return _parent; }
+
+ };
+
+ struct TSEC_SessionEntry
+ {
+ TSEC_SessionEntry();
+
+ TSEC_SessionEntry
+ (
+ TSEC_Session_impl* pSessionImpl,
+ ENW::TSession_ptr Session
+ );
+
+ TSEC_Session_impl* _p_sessionImpl;
+ ENW::TSession_var _session;
+ };
+
+ class TSEC_CHECKPOINT_EXEC_Export TSEC_CheckPoint_exec_i :
+ public virtual ENW::TSEC_CheckPoint_Exec,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+ TSEC_CheckPoint_exec_i();
+ TSEC_CheckPoint_exec_i( const char* Version );
+
+ virtual ~TSEC_CheckPoint_exec_i();
+
+ // Attribute Operationen:
+ //
+
+
+ // Interface ISessionService
+ //
+
+ virtual ENW::CCM_ISessionService_ptr get_sessionService
+ (
+ );
+
+
+ virtual ENW::TSession_ptr createSession
+ (
+ );
+
+ virtual CORBA::Boolean destroySession
+ (
+ ENW::TSession_ptr Session
+ );
+
+ virtual ENW::TSession_ptr acquireSession
+ (
+ CORBA::Long Ident
+ );
+
+ virtual CORBA::Boolean releaseSession
+ (
+ CORBA::Long Ident,
+ ENW::TSession_ptr Session
+ );
+
+
+ // Events
+ //
+
+ virtual void push_lifeTokenIn
+ (
+ ENW::ET_LifeToken* Event
+ );
+
+
+ // Operations from Components::SessionComponent
+ //
+
+ virtual void set_session_context
+ (
+ Components::SessionContext_ptr ctx
+ );
+
+ virtual void configuration_complete
+ (
+ );
+
+ virtual void ccm_activate
+ (
+ );
+
+ virtual void ccm_passivate
+ (
+ );
+
+ virtual void ccm_remove
+ (
+ );
+
+ CORBA::Object_ptr getObjRef
+ (
+ PortableServer::Servant Servant
+ );
+
+ int init(
+ );
+
+ CORBA::Object_ptr installServant
+ (
+ PortableServer::Servant Servant
+ );
+
+ void uninstallServant
+ (
+ CORBA::Object_ptr ObjRef
+ );
+
+ TMutex& getMutex() { return _mutex; }
+
+ protected:
+ // Copmponent specific context
+
+ ENW::CCM_TSEC_CheckPoint_Context_var _context;
+ ::CIAO::Session_Container* _p_sessionContainer;
+ TMutex _mutex;
+ CORBA::ORB_var _orb;
+
+ private:
+ bool _awaitingLifeToken;
+ bool _isActivated;
+
+ //TSEC_Session_impl* sessionVector[TSEC_SESSION_MAX_IDENT];
+ TSEC_SessionEntry sessionVector[TSEC_SESSION_MAX_IDENT];
+ };
+
+ /**
+ * home executor implementation class.
+ */
+ class TSEC_CHECKPOINT_EXEC_Export TSEC_CheckPointHome_exec_i :
+ public virtual ENW::CCM_TSEC_CheckPointHome,
+ public virtual ::CORBA::LocalObject
+ {
+ public:
+
+ TSEC_CheckPointHome_exec_i();
+
+ virtual ~TSEC_CheckPointHome_exec_i();
+
+ // Explicit home operations.
+ virtual ::Components::EnterpriseComponent_ptr new_TSEC_CheckPoint
+ (
+ const char* Version
+ );
+
+ // Implicit home operations.
+ virtual ::Components::EnterpriseComponent_ptr create
+ (
+ );
+ };
+} // Impl
+
+extern "C" TSEC_CHECKPOINT_EXEC_Export ::Components::HomeExecutorBase_ptr
+createTSEC_CheckPointHome_Impl();
+
+#endif // TSEC_CheckPoint_EXEC_H
diff --git a/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp
new file mode 100644
index 00000000000..8901cdbf20a
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/controller.cpp
@@ -0,0 +1,197 @@
+//$Id$
+
+
+/**
+ * @file controller.cpp
+ *
+ * This program interact with a TSEC_CheckPoint component, using its supported
+ * interface "ISessionService"
+ */
+
+
+//-------------------------------------------------------------------
+// Includes
+//-------------------------------------------------------------------
+
+#include "ace/streams.h"
+#include "ace/Get_Opt.h"
+
+#include "TSEC_CheckPointC.h"
+
+
+//-------------------------------------------------------------------
+// Defines
+//-------------------------------------------------------------------
+
+#define SEPARATION_LINE "----------------------------------------" \
+ "----------------------------------------\n"
+
+#define TESTCASE_NOT_DEFINED 0
+#define TESTCASE_ACQUIRE_RELEASE_SESSION 1
+#define TESTCASE_CREATE_DESTROY_SESSION 2
+
+
+//-------------------------------------------------------------------
+// Statics
+//-------------------------------------------------------------------
+
+static int _testcase = TESTCASE_NOT_DEFINED;
+static int _loop = 0;
+static int _ident = 1;
+static const ACE_TCHAR* _sessionService_ior = 0;
+
+
+//-------------------------------------------------------------------
+// Function
+//-------------------------------------------------------------------
+
+int
+parse_args
+(
+ int argc,
+ ACE_TCHAR* argv[]
+)
+{
+ ACE_Get_Opt get_opts( argc, argv, ACE_TEXT("i:k:l:t:") );
+ int c;
+
+ while( ( c = get_opts() ) != -1 )
+ {
+ switch( c )
+ {
+ case 'i':
+ _ident = ACE_OS::atoi( get_opts.opt_arg() );
+ break;
+
+ case 'k':
+ _sessionService_ior = get_opts.opt_arg();
+ break;
+
+ case 'l':
+ _loop = ACE_OS::atoi( get_opts.opt_arg() );
+ break;
+
+ case 't':
+ _testcase = ACE_OS::atoi( get_opts.opt_arg() );
+ break;
+
+ case '?': // display help for use of the server.
+ default:
+ ACE_ERROR_RETURN( ( LM_ERROR,
+ "usage: %s\n"
+ "-i <Ident> (default is 1)\n"
+ "-k <TSEC_CheckPoint IOR> (default is file://TSEC_CheckPoint.ior)\n"
+ "-t <testcase number> (default is 1)\n"
+ "\n",
+ argv[0] ),
+ -1 );
+ break;
+ }
+ }
+
+ if ( _sessionService_ior == 0 )
+ {
+ _sessionService_ior = ACE_TEXT("file://TSEC_CheckPoint.ior");
+ }
+
+ if( _testcase == 0 )
+ {
+ _testcase = TESTCASE_ACQUIRE_RELEASE_SESSION;
+ }
+
+ return 0;
+}
+
+
+//-------------------------------------------------------------------
+// Function
+//-------------------------------------------------------------------
+
+int
+ACE_TMAIN
+(
+ int argc,
+ ACE_TCHAR* argv[]
+)
+{
+ try
+ {
+ // Initialize orb
+ CORBA::ORB_var orb =
+ CORBA::ORB_init( argc, argv);
+
+ if( parse_args( argc, argv ) != 0 )
+ {
+ return -1;
+ }
+
+ CORBA::Object_var obj = orb->string_to_object( _sessionService_ior
+ );
+
+ ENW::ISessionService_var sessionService =
+ ENW::ISessionService::_narrow (obj.in () );
+
+ if( CORBA::is_nil( sessionService.in() ) )
+ {
+ ACE_ERROR_RETURN( ( LM_ERROR,
+ "Unable to acquire 'SessionService' objref\n" ),
+ -1 );
+ }
+
+ ACE_DEBUG( ( LM_DEBUG, SEPARATION_LINE ) );
+
+ for( int i = 0; i < _loop; ++i )
+ {
+ switch( _testcase )
+ {
+ case TESTCASE_ACQUIRE_RELEASE_SESSION:
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) Executing testcase acquire release session...[running]\n" ) );
+
+ ENW::TSession_var session = sessionService->acquireSession( _ident );
+ //CORBA::Long ident = session->getIdent();
+ sessionService->releaseSession( _ident, session.in () );
+
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) Executing testcase acquire release session...[ready]\n" ) );
+ }
+
+ break;
+
+ case TESTCASE_CREATE_DESTROY_SESSION:
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) Executing testcase create destroy session...[running]\n" ) );
+
+ ENW::TSession_var session = sessionService->createSession();
+ CORBA::Long ident = session->getIdent();
+ ACE_DEBUG(( LM_DEBUG, "(%P|%t@%T) Ident: %d\n", ident ) );
+
+ if( !sessionService->destroySession( session.in () ) )
+ {
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) Executing testcase create destroy session...[ERROR]\n" ) );
+ }
+
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) Executing testcase create destroy session...[ready]\n" ) );
+ }
+
+ break;
+
+ default:
+ ACE_DEBUG( ( LM_DEBUG, "(%P|%t@%T) Testcase is undefined!\n" ) );
+ break;
+
+ }
+ }
+
+ orb->destroy( );
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Who is the culprit\n");
+ cerr << "Uncaught CORBA exception" << endl;
+
+ return 1;
+ }
+
+ return 0;
+}
+
diff --git a/modules/CIAO/tests/Bug_2130_Regression/descriptors/DeploymentPlan.cdp b/modules/CIAO/tests/Bug_2130_Regression/descriptors/DeploymentPlan.cdp
new file mode 100644
index 00000000000..d814af11a50
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/descriptors/DeploymentPlan.cdp
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Deployment:deploymentPlan
+ xmlns:Deployment="http://www.omg.org/Deployment"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.omg.org/Deployment Modified_Deployment.xsd">
+
+ <label>CheckPoint-DeploymentPlan</label>
+
+ <UUID>CheckPoint_Plan_UUID_0001</UUID>
+
+ <realizes>
+ <label>CheckPoint-realizes-cid</label>
+ <UUID>c0965470-7b83-11d9-9669-0800200c9a66</UUID>
+ <specificType/>
+ <supportedType>IDL:ENW/Sender:1.0</supportedType>
+ <port>
+ <name>read_message</name>
+ <specificType>IDL:ENW/ISessionService:1.0</specificType>
+ <supportedType>IDL:ENW/ISessionService:1.0</supportedType>
+ <provider>false</provider>
+ <exclusiveProvider>false</exclusiveProvider>
+ <exclusiveUser>true</exclusiveUser>
+ <optional>false</optional>
+ <kind>SimplexReceptacle</kind>
+ </port>
+ </realizes>
+
+ <implementation id="CheckPoint-TSEC_CheckPoint-mdd">
+ <name>CheckPoint-TSEC_CheckPoint-mdd</name>
+ <source><!-- @@ Don't know what goes here --></source>
+ <artifact>CheckPoint-TSEC_CheckPoint_exec</artifact>
+ <artifact>CheckPoint-TSEC_CheckPoint_svnt</artifact>
+ </implementation>
+
+ <instance id="CheckPoint-TSEC_CheckPoint-idd">
+ <name>CheckPoint-TSEC_CheckPoint-idd</name>
+ <node>CheckPointNode</node>
+ <source/>
+ <implementation>CheckPoint-TSEC_CheckPoint-mdd</implementation>
+ <configProperty>
+ <name>ComponentIOR</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>TSEC_CheckPoint.ior</string>
+ </value>
+ </value>
+ </configProperty>
+
+ <deployedResource>
+ <resourceUsage>InstanceUsesResource</resourceUsage>
+ <requirementName>CIAO:PolicySet</requirementName>
+ <resourceName>test_server_resource_id</resourceName>
+ <resourceValue>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>test_policy_set_id</string>
+ </value>
+ </resourceValue>
+ </deployedResource>
+ </instance>
+
+ <artifact id="CheckPoint-TSEC_CheckPoint_exec">
+ <name>TSEC_CheckPoint_exec</name>
+ <source/>
+ <node/>
+ <location>TSEC_CheckPoint_exec</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>createTSEC_CheckPointHome_Impl</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <artifact id="CheckPoint-TSEC_CheckPoint_svnt">
+ <name>TSEC_CheckPoint_svnt</name>
+ <source/>
+ <node/>
+ <location>TSEC_CheckPoint_svnt</location>
+ <execParameter>
+ <name>entryPoint</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>create_ENW_TSEC_CheckPointHome_Servant</string>
+ </value>
+ </value>
+ </execParameter>
+ </artifact>
+
+ <infoProperty>
+ <name>CIAOServerResources</name>
+ <value>
+ <type>
+ <kind>tk_string</kind>
+ </type>
+ <value>
+ <string>rt-config-example.csr</string>
+ </value>
+ </value>
+ </infoProperty>
+
+</Deployment:deploymentPlan>
+
diff --git a/modules/CIAO/tests/Bug_2130_Regression/descriptors/TestNodeManagerMap.dat b/modules/CIAO/tests/Bug_2130_Regression/descriptors/TestNodeManagerMap.dat
new file mode 100644
index 00000000000..9ec03384ec9
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/descriptors/TestNodeManagerMap.dat
@@ -0,0 +1 @@
+CheckPointNode corbaloc:iiop:localhost:30000/NodeManager \ No newline at end of file
diff --git a/modules/CIAO/tests/Bug_2130_Regression/descriptors/rt-config-example.csr b/modules/CIAO/tests/Bug_2130_Regression/descriptors/rt-config-example.csr
new file mode 100644
index 00000000000..e1d120352aa
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/descriptors/rt-config-example.csr
@@ -0,0 +1,30 @@
+
+<CIAO:ServerResources
+ xmlns:CIAO="http://www.dre.vanderbilt.edu/ServerResources"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.dre.vanderbilt.edu/ServerResources CIAOServerResources.xsd"
+ id="test_server_resource_id">
+
+ <orbConfigs>
+ <resources>
+ <threadpool id="threadpool-1">
+ <stacksize>0</stacksize>
+ <static_threads>6</static_threads>
+ <dynamic_threads>0</dynamic_threads>
+ <default_priority>2</default_priority>
+ <allow_request_buffering>false</allow_request_buffering>
+ <max_buffered_requests>0</max_buffered_requests>
+ <max_request_buffered_size>0</max_request_buffered_size>
+ </threadpool>
+ </resources>
+
+ <policySet id="test_policy_set_id">
+ <priorityModel server_priority="2">
+ <priority_model>SERVER_DECLARED</priority_model>
+ </priorityModel>
+ <threadpool>threadpool-1</threadpool>
+ </policySet>
+
+ </orbConfigs>
+</CIAO:ServerResources> \ No newline at end of file
diff --git a/modules/CIAO/tests/Bug_2130_Regression/descriptors/run_test.pl b/modules/CIAO/tests/Bug_2130_Regression/descriptors/run_test.pl
new file mode 100755
index 00000000000..d31d6f9c562
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/descriptors/run_test.pl
@@ -0,0 +1,210 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{'ACE_ROOT'}/bin";
+use PerlACE::TestTarget;
+
+$CIAO_ROOT = "$ENV{'CIAO_ROOT'}";
+$DANCE_ROOT = "$ENV{'DANCE_ROOT'}";
+
+$daemons_running = 0;
+$em_running = 0;
+
+$nr_daemon = 1;
+@ports = ( 30000 );
+@iorbases = ( "NodeApp.ior" );
+@iorfiles = 0;
+
+$controller_exec = "../SEC_CheckPoint/controller";
+
+$ior_embase = "EM.ior";
+$ior_emfile = 0;
+
+# Processes
+$E = 0;
+$EM = 0;
+@DEAMONS = 0;
+
+# targets
+@tg_daemons = 0;
+$tg_exe_man = 0;
+$tg_executor = 0;
+
+$status = 0;
+$dat_file = "TestNodeManagerMap.dat";
+$cdp_file = "DeploymentPlan.cdp";
+
+sub create_targets {
+ # daemon
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $tg_daemons[$i] = PerlACE::TestTarget::create_target ($i+1) || die "Create target for deamon $i failed\n";
+ $tg_daemons[$i]->AddLibPath ('../SEC_CheckPoint');
+ }
+ # execution manager
+ $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n";
+ $tg_exe_man->AddLibPath ('../SEC_CheckPoint');
+ # executor (plan_launcher)
+ $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n";
+ $tg_executor->AddLibPath ('../SEC_CheckPoint');
+}
+
+sub init_ior_files {
+ $ior_emfile = $tg_exe_man->LocalFile ($ior_embase);
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]);
+ }
+ delete_ior_files ();
+}
+
+# Delete if there are any .ior files.
+sub delete_ior_files {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $tg_daemons[$i]->DeleteFile ($iorbases[$i]);
+ }
+ $tg_exe_man->DeleteFile ($ior_embase);
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]);
+ }
+}
+
+sub kill_node_daemon {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
+ }
+}
+
+sub kill_open_processes {
+ if ($daemons_running == 1) {
+ kill_node_daemon ();
+ }
+
+ if ($em_running == 1) {
+ $EM->Kill (); $EM->TimedWait (1);
+ }
+ # in case shutdown did not perform as expected
+ $tg_executor->KillAll ('ciao_componentserver');
+}
+
+sub run_node_daemons {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $iorbase = $iorbases[$i];
+ $iorfile = $iorfiles[$i];
+ $port = $ports[$i];
+ $iiop = "iiop://localhost:$port";
+ $node_app = "$CIAO_ROOT/bin/ciao_componentserver";
+
+ $d_cmd = "$DANCE_ROOT/bin/dance_node_manager";
+ $d_param = "-ORBEndpoint $iiop -s $node_app -o $iorfile -a \"-r\"";
+
+ print "Run dance_node_manager with $d_param\n";
+
+ $DEAMONS[$i] = $tg_daemons[$i]->CreateProcess ($d_cmd, $d_param);
+ $DEAMONS[$i]->Spawn ();
+
+ if ($tg_daemons[$i]->WaitForFileTimed($iorbase,
+ $tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) {
+ print STDERR
+ "ERROR: The ior $iorfile file of node daemon $i could not be found\n";
+ for (; $i >= 0; --$i) {
+ $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
+ }
+ return -1;
+ }
+ }
+ $daemons_running = 1;
+ return 0;
+}
+
+create_targets ();
+init_ior_files ();
+
+
+# Invoke node daemons.
+print "Invoking node daemons\n";
+$status = run_node_daemons ();
+
+if ($status != 0) {
+ print STDERR "ERROR: Unable to execute the node daemons\n";
+ exit 1;
+}
+
+# Invoke execution manager.
+print "Invoking execution manager\n";
+$EM = $tg_exe_man->CreateProcess ("$CIAO_ROOT/bin/Execution_Manager",
+ "-o $ior_emfile -i $dat_file");
+$EM->Spawn ();
+
+if ($tg_exe_man->WaitForFileTimed ($ior_embase,
+ $tg_exe_man->ProcessStartWaitInterval ()) == -1) {
+ print STDERR
+ "ERROR: The ior file of execution manager could not be found\n";
+ kill_open_processes ();
+ exit 1;
+}
+
+$em_running = 1;
+
+# Invoke executor - start the application -.
+print "Invoking executor - start the application -\n";
+$E = $tg_executor->CreateProcess ("$CIAO_ROOT/bin/plan_launcher",
+ "-p $cdp_file -k file://$ior_emfile -o DAM.ior");
+
+$E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ());
+
+
+if ($tg_exe_man->WaitForFileTimed ("TSEC_CheckPoint.ior",
+ $tg_exe_man->ProcessStartWaitInterval ()) == -1) {
+ print STDERR "ERROR: The ior file of sender could not be found\n";
+ kill_open_processes ();
+ exit 1;
+}
+
+print "Running testcase 1\n";
+
+$controller = $tg_daemons[0]->CreateProcess ("$controller_exec", "-i 1 -k file://TSEC_CheckPoint.ior -t 1 -l 100000");
+$result = $controller->SpawnWaitKill ($tg_daemons[0]->ProcessStopWaitInterval ());
+
+if ($result != 0) {
+ print STDERR "ERROR: The controller returned $result\n";
+ $status = 1;
+}
+
+
+print "Running testcase 2\n";
+
+$controller = $tg_daemons[0]->CreateProcess ("$controller_exec", "-i 2 -k file://TSEC_CheckPoint.ior -t 1 -l 100000");
+$result = $controller->SpawnWaitKill ($tg_daemons[0]->ProcessStopWaitInterval ());
+
+if ($result != 0) {
+ print STDERR "ERROR: The controller returned $result\n";
+ $status = 1;
+}
+
+print "Running testcase 3\n";
+
+$controller = $tg_daemons[0]->CreateProcess ("$controller_exec", "-k file://TSEC_CheckPoint.ior -t 2 -l 100000");
+$result = $controller->SpawnWaitKill ($tg_daemons[0]->ProcessStopWaitInterval ());
+
+if ($result != 0) {
+ print STDERR "ERROR: The controller returned $result\n";
+ $status = 1;
+}
+
+
+# Invoke executor - stop the application -.
+print "Invoking executor - stop the application -\n";
+$E = $tg_executor->CreateProcess ("$CIAO_ROOT/bin/plan_launcher",
+ "-k file://EM.ior -i file://DAM.ior");
+$E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ());
+
+print "Executor returned.\n";
+print "Shutting down rest of the processes.\n";
+
+delete_ior_files ();
+kill_open_processes ();
+
+exit $status;
diff --git a/modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.idl b/modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.idl
new file mode 100644
index 00000000000..f62febba8a3
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.idl
@@ -0,0 +1,52 @@
+//$Id$
+
+#ifndef ENW_IDL
+#define ENW_IDL
+
+#include <Components.idl>
+
+
+module ENW
+{
+ exception EUnknownIdent
+ {
+ };
+
+ exception EUnknownSession
+ {
+ };
+
+ eventtype ET_LifeToken
+ {
+ };
+
+ //////////////////////////////////////////////////////////////////////////////
+ //
+ // ICheckPoint-Interfaces
+ //
+
+ const long IdNotDefined = -1;
+
+ interface TSession
+ {
+ long getIdent();
+ boolean isInUse();
+ };
+
+ interface ISessionService
+ {
+ TSession createSession();
+ boolean destroySession( in TSession Session );
+
+ TSession acquireSession( in long Ident )
+ raises( EUnknownIdent );
+
+ boolean releaseSession( in long Ident,
+ in TSession Session )
+ raises( EUnknownSession );
+ };
+
+};
+
+
+#endif //ENW_IDL
diff --git a/modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc b/modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc
new file mode 100644
index 00000000000..d6881188b2c
--- /dev/null
+++ b/modules/CIAO/tests/Bug_2130_Regression/interfaces/ENW.mpc
@@ -0,0 +1,44 @@
+//$Id$
+
+project(ENW_stub): ccm_stub, event {
+ sharedname = ENW_stub
+ idlflags -= -GT
+ idlflags += -Wb,stub_export_macro=ENW_STUB_Export \
+ -Wb,stub_export_include=ENW_stub_export.h \
+ -Wb,skel_export_macro=ENW_SKEL_Export \
+ -Wb,skel_export_include=ENW_skel_export.h -Gxhst -Gxhsk
+ dynamicflags = ENW_STUB_BUILD_DLL
+
+ IDL_Files {
+ ENW.idl
+ }
+
+ Source_Files {
+ ENWC.cpp
+ }
+}
+
+project(ENW_skel) : ciao_servant, event {
+ after += ENW_stub
+ sharedname = ENW_skel
+ libs += ENW_stub
+ idlflags -= -GT
+ idlflags += -Wb,stub_export_macro=ENW_STUB_Export \
+ -Wb,stub_export_include=ENW_stub_export.h \
+ -Wb,skel_export_macro=ENW_SKEL_Export \
+ -Wb,skel_export_include=ENW_skel_export.h
+
+ dynamicflags = ENW_SKEL_BUILD_DLL
+
+ IDL_Files {
+ ENW.idl
+ }
+
+ Source_Files {
+ ENWS.cpp
+ }
+}
+
+
+
+