diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-02-23 12:30:15 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-02-23 12:30:15 +0000 |
commit | a94a21c4b5a34386a8133087f80e3d84cad31b79 (patch) | |
tree | 573993447a9bd60136a1226ea0a0ecac3b7b233e | |
parent | 0bda2fd002c7e22cbc2c75c09df40ae7179a51c8 (diff) | |
download | ATCD-a94a21c4b5a34386a8133087f80e3d84cad31b79.tar.gz |
Thu Feb 23 12:27:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/ciao_tests.lst:
* ciao/Base/CIAO_Properties.idl:
* ciao/Containers/Container_Base.idl:
* ciao/Containers/Container_Base_T.h:
* ciao/Containers/Container_Base_T.cpp:
* ciao/Containers/Extension/Extension_Container.h:
* ciao/Containers/Extension/Extension_Container.cpp:
* ciao/Containers/Session/Session_Container.h:
* ciao/Containers/Session/Session_Container.cpp:
* ciao/Deployment/Handlers/Component_Handler.cpp:
* ciao/Deployment/Handlers/Container_Handler.cpp:
* ciao/Deployment/Handlers/Home_Handler.cpp:
Added support for new ciao config property "edu.vanderbilt.dre.CIAO.OpenMode"
which controls the mode that is used to load the shared libraries for
a home or component. By default we use ACE_DEFAULT_SHLIB_MODE
which can be controlled through config.h, but now it can also
be controlled using the deployment plan. This property is of type long
* tests/DAnCE/LocalityManager/CommandlinePassage/Component_OpenMode.cdp:
* tests/DAnCE/LocalityManager/CommandlinePassage/run_test_openmode.pl:
Example cdp using the new open mode property
-rw-r--r-- | CIAO/ChangeLog | 24 | ||||
-rw-r--r-- | CIAO/bin/ciao_tests.lst | 3 | ||||
-rw-r--r-- | CIAO/ciao/Base/CIAO_Properties.idl | 1 | ||||
-rw-r--r-- | CIAO/ciao/Containers/Container_Base.idl | 6 | ||||
-rw-r--r-- | CIAO/ciao/Containers/Container_Base_T.cpp | 11 | ||||
-rw-r--r-- | CIAO/ciao/Containers/Container_Base_T.h | 6 | ||||
-rw-r--r-- | CIAO/ciao/Containers/Extension/Extension_Container.cpp | 8 | ||||
-rw-r--r-- | CIAO/ciao/Containers/Extension/Extension_Container.h | 6 | ||||
-rw-r--r-- | CIAO/ciao/Containers/Session/Session_Container.cpp | 8 | ||||
-rw-r--r-- | CIAO/ciao/Containers/Session/Session_Container.h | 6 | ||||
-rw-r--r-- | CIAO/ciao/Deployment/Handlers/Component_Handler.cpp | 40 | ||||
-rw-r--r-- | CIAO/ciao/Deployment/Handlers/Container_Handler.cpp | 2 | ||||
-rw-r--r-- | CIAO/ciao/Deployment/Handlers/Home_Handler.cpp | 37 | ||||
-rw-r--r-- | CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/Component_OpenMode.cdp | 154 | ||||
-rwxr-xr-x | CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_openmode.pl | 246 |
15 files changed, 502 insertions, 56 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 898739fd6a1..04580abc3fa 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,27 @@ +Thu Feb 23 12:27:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl> + + * bin/ciao_tests.lst: + * ciao/Base/CIAO_Properties.idl: + * ciao/Containers/Container_Base.idl: + * ciao/Containers/Container_Base_T.h: + * ciao/Containers/Container_Base_T.cpp: + * ciao/Containers/Extension/Extension_Container.h: + * ciao/Containers/Extension/Extension_Container.cpp: + * ciao/Containers/Session/Session_Container.h: + * ciao/Containers/Session/Session_Container.cpp: + * ciao/Deployment/Handlers/Component_Handler.cpp: + * ciao/Deployment/Handlers/Container_Handler.cpp: + * ciao/Deployment/Handlers/Home_Handler.cpp: + Added support for new ciao config property "edu.vanderbilt.dre.CIAO.OpenMode" + which controls the mode that is used to load the shared libraries for + a home or component. By default we use ACE_DEFAULT_SHLIB_MODE + which can be controlled through config.h, but now it can also + be controlled using the deployment plan. This property is of type long + + * tests/DAnCE/LocalityManager/CommandlinePassage/Component_OpenMode.cdp: + * tests/DAnCE/LocalityManager/CommandlinePassage/run_test_openmode.pl: + Example cdp using the new open mode property + Tue Feb 21 15:36:44 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl> * ciao/Containers/Container_Base_T.h: diff --git a/CIAO/bin/ciao_tests.lst b/CIAO/bin/ciao_tests.lst index 0076b228f46..edf0f0ce582 100644 --- a/CIAO/bin/ciao_tests.lst +++ b/CIAO/bin/ciao_tests.lst @@ -173,6 +173,7 @@ TAO/CIAO/tests/IDL3_to_XMI/XMI_For_Sequence/run_test.pl: !STATIC !MINIMUM !CORBA TAO/CIAO/tests/IDL3_to_XMI/IDL2XMI_Test/run_test.pl: !FIXED_BUGS_ONLY !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !NO_IDL3_TO_XMI !CCM_NOEVENT TAO/CIAO/tests/DAnCE/LocalityManager/CPUAffinity/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST LINUX TAO/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST -TAO/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_cmd.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !Win32 +TAO/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_openmode.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !Win32 +TAO/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST TAO/CIAO/tests/DAnCE/Threading/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST diff --git a/CIAO/ciao/Base/CIAO_Properties.idl b/CIAO/ciao/Base/CIAO_Properties.idl index 22ff63e9e57..a1bf30c6bab 100644 --- a/CIAO/ciao/Base/CIAO_Properties.idl +++ b/CIAO/ciao/Base/CIAO_Properties.idl @@ -15,6 +15,7 @@ module CIAO const string SVNT_ENTRYPT = "edu.vanderbilt.dre.CIAO.ServantEntrypoint"; const string SVNT_ARTIFACT = "edu.vanderbilt.dre.CIAO.ServantArtifact"; const string EXEC_ARTIFACT = "edu.vanderbilt.dre.CIAO.ExecutorArtifact"; + const string OPEN_MODE = "edu.vanderbilt.dre.CIAO.OpenMode"; const string COMPONENT_FACTORY = "component factory"; const string HOME_FACTORY = "home factory"; const string COMPONENT_HOME = "edu.vanderbilt.dre.CIAO.ComponentHomeId"; diff --git a/CIAO/ciao/Containers/Container_Base.idl b/CIAO/ciao/Containers/Container_Base.idl index 7795456c6c4..8d8f516112d 100644 --- a/CIAO/ciao/Containers/Container_Base.idl +++ b/CIAO/ciao/Containers/Container_Base.idl @@ -77,7 +77,8 @@ module CIAO in string entry_point, in string servant_artifact, in string servant_entrypoint, - in string name); + in string name, + in long open_mode); void uninstall_home (in Components::CCMHome homeptr); @@ -85,7 +86,8 @@ module CIAO in string entry_point, in string servant_artifact, in string servant_entrypoint, - in string name); + in string name, + in long open_mode); void set_attributes (in Object name, in Components::ConfigValues values); diff --git a/CIAO/ciao/Containers/Container_Base_T.cpp b/CIAO/ciao/Containers/Container_Base_T.cpp index f6d05c3ae22..9144d3b376c 100644 --- a/CIAO/ciao/Containers/Container_Base_T.cpp +++ b/CIAO/ciao/Containers/Container_Base_T.cpp @@ -267,9 +267,11 @@ namespace CIAO (LM_TRACE, CLINFO "Container_i::prepare_installation <%C> - " - "Executor DLL [%C] successfully opened\n", + "Executor DLL [%C] successfully opened with mode <%d>\n", entity, - primary_artifact)); + primary_artifact, + open_mode + )); } if (servant_dll.open (ACE_TEXT_CHAR_TO_TCHAR (servant_artifact), @@ -298,9 +300,10 @@ namespace CIAO (LM_TRACE, CLINFO "Container_i::prepare_installation <%C> - " - "Servant DLL [%C] successfully openend\n", + "Servant DLL [%C] successfully opened with mode <%d>\n", entity, - servant_artifact)); + servant_artifact, + open_mode)); } } diff --git a/CIAO/ciao/Containers/Container_Base_T.h b/CIAO/ciao/Containers/Container_Base_T.h index ab04d27b319..5301aa033d4 100644 --- a/CIAO/ciao/Containers/Container_Base_T.h +++ b/CIAO/ciao/Containers/Container_Base_T.h @@ -64,7 +64,8 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name) = 0; + const char *name, + CORBA::Long open_mode) = 0; /// Uninstall a servant for component or home. virtual void uninstall_home (Components::CCMHome_ptr homeref); @@ -73,7 +74,8 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name) = 0; + const char *name, + CORBA::Long open_mode) = 0; virtual void set_attributes (CORBA::Object_ptr compref, const ::Components::ConfigValues & values); diff --git a/CIAO/ciao/Containers/Extension/Extension_Container.cpp b/CIAO/ciao/Containers/Extension/Extension_Container.cpp index fcdcfcbf620..61481d0c0e5 100644 --- a/CIAO/ciao/Containers/Extension/Extension_Container.cpp +++ b/CIAO/ciao/Containers/Extension/Extension_Container.cpp @@ -74,13 +74,13 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name) + const char *name, + CORBA::Long open_mode) { CIAO_TRACE ("Extension_Container_i::install_home"); ACE_DLL executor_dll; ACE_DLL servant_dll; - int open_mode = ACE_DEFAULT_SHLIB_MODE; Container_i < ::CIAO::Extension_Container>::prepare_installation ("Extension Home", primary_artifact, @@ -203,13 +203,13 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name) + const char *name, + CORBA::Long open_mode) { CIAO_TRACE ("Extension_Container_i::install_component"); ACE_DLL executor_dll; ACE_DLL servant_dll; - int open_mode = ACE_DEFAULT_SHLIB_MODE; Container_i < ::CIAO::Extension_Container>::prepare_installation ("Extension Component", primary_artifact, diff --git a/CIAO/ciao/Containers/Extension/Extension_Container.h b/CIAO/ciao/Containers/Extension/Extension_Container.h index 657d4241ab4..8d3f4b5e20f 100644 --- a/CIAO/ciao/Containers/Extension/Extension_Container.h +++ b/CIAO/ciao/Containers/Extension/Extension_Container.h @@ -77,14 +77,16 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name); + const char *name, + CORBA::Long open_mode); /// Install a new component virtual Components::CCMObject_ptr install_component (const char *primary_artifact, const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name); + const char *name, + CORBA::Long open_mode); // @{ /// Inherited from extension context. diff --git a/CIAO/ciao/Containers/Session/Session_Container.cpp b/CIAO/ciao/Containers/Session/Session_Container.cpp index 1700d3ed4b1..92b004c184f 100644 --- a/CIAO/ciao/Containers/Session/Session_Container.cpp +++ b/CIAO/ciao/Containers/Session/Session_Container.cpp @@ -44,13 +44,13 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name) + const char *name, + CORBA::Long open_mode) { CIAO_TRACE ("Session_Container_i::install_home"); ACE_DLL executor_dll; ACE_DLL servant_dll; - int open_mode = ACE_DEFAULT_SHLIB_MODE; Container_i < ::CIAO::Session_Container>::prepare_installation ("Session Home", primary_artifact, @@ -178,13 +178,13 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name) + const char *name, + CORBA::Long open_mode) { CIAO_TRACE ("Session_Container_i::install_component"); ACE_DLL executor_dll; ACE_DLL servant_dll; - int open_mode = ACE_DEFAULT_SHLIB_MODE; Container_i < ::CIAO::Session_Container>::prepare_installation ("Session Component", primary_artifact, diff --git a/CIAO/ciao/Containers/Session/Session_Container.h b/CIAO/ciao/Containers/Session/Session_Container.h index d25d1cd3878..6fe494379f2 100644 --- a/CIAO/ciao/Containers/Session/Session_Container.h +++ b/CIAO/ciao/Containers/Session/Session_Container.h @@ -70,14 +70,16 @@ namespace CIAO const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name); + const char *name, + CORBA::Long open_mode); /// Install a new component virtual Components::CCMObject_ptr install_component (const char *primary_artifact, const char *entry_point, const char *servant_artifact, const char *servant_entrypoint, - const char *name); + const char *name, + CORBA::Long open_mode); private: /// Not allowed to be diff --git a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp index 6973ffac406..3c7289f5fa4 100644 --- a/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp +++ b/CIAO/ciao/Deployment/Handlers/Component_Handler.cpp @@ -87,34 +87,34 @@ namespace CIAO CORBA::String_var exec_art, exec_entry, svnt_art, svnt_entry, cont_id; - using namespace CIAO::Deployment; CORBA::Any val; const char *tmp = 0; + int open_mode = ACE_DEFAULT_SHLIB_MODE; - if (pmap->find (SVNT_ENTRYPT, val) == 0) + if (pmap->find (CIAO::Deployment::SVNT_ENTRYPT, val) == 0) { val >>= tmp; svnt_entry = tmp; CIAO_DEBUG (9, (LM_TRACE, CLINFO "Component_Handler_i::install_instance - " - "Found Servant entrypoint %C\n", svnt_entry.in ())); + "Found Servant entrypoint <%C>\n", svnt_entry.in ())); } - else + + if (pmap->find (CIAO::Deployment::OPEN_MODE, val) == 0) { - CIAO_ERROR (1, (LM_ERROR, CLINFO - "Component_Handler_i::install_instance - " - "Error: No Servant entrypoint provided, aborting installation\n")); - throw ::Deployment::PlanError (idd.name.in (), - "No servant entrypoint identified."); + val >>= open_mode; + CIAO_DEBUG (9, (LM_TRACE, CLINFO + "Component_Handler_i::install_instance - " + "Found open mode <%d>\n", open_mode)); } - if (pmap->find (SVNT_ARTIFACT, val) == 0) + if (pmap->find (CIAO::Deployment::SVNT_ARTIFACT, val) == 0) { val >>= tmp; svnt_art = Deployment_Common::get_implementation (tmp, plan); CIAO_DEBUG (9, (LM_TRACE, CLINFO "Component_Handler_i::install_instance - " - "Found Servant artifact %C\n", svnt_art.in ())); + "Found Servant artifact <%C>\n", svnt_art.in ())); } else { @@ -126,13 +126,13 @@ namespace CIAO } - if (pmap->find (EXEC_ARTIFACT, val) == 0) + if (pmap->find (CIAO::Deployment::EXEC_ARTIFACT, val) == 0) { val >>= tmp; exec_art = Deployment_Common::get_implementation (tmp, plan); CIAO_DEBUG (9, (LM_TRACE, CLINFO "Component_Handler_i::install_instance - " - "Found executor artifact: %C\n", exec_art.in ())); + "Found executor artifact: <%C>\n", exec_art.in ())); } else { @@ -143,13 +143,13 @@ namespace CIAO "No executory artifact identified.\n"); } - if (pmap->find (COMPONENT_FACTORY, val) == 0) + if (pmap->find (CIAO::Deployment::COMPONENT_FACTORY, val) == 0) { val >>= tmp; exec_entry = tmp; CIAO_DEBUG (9, (LM_TRACE, CLINFO "Component_Handler_i::install_instance - " - "Found executor entrypoint: %C\n", exec_entry.in ())); + "Found executor entrypoint: <%C>\n", exec_entry.in ())); } else { @@ -160,13 +160,13 @@ namespace CIAO "No executor entrypoint provided\n"); } - if (pmap->find (CONTAINER_ID, val) == 0) + if (pmap->find (CIAO::Deployment::CONTAINER_ID, val) == 0) { val >>= tmp; cont_id = tmp; CIAO_DEBUG (9, (LM_TRACE, CLINFO "Component_Handler_i::install_instance - " - "Found executor entrypoint: %C\n", exec_entry.in ())); + "Found executor entrypoint: <%C>\n", exec_entry.in ())); } else { @@ -197,14 +197,14 @@ namespace CIAO exec_entry, svnt_art, svnt_entry, - idd.name.in ()); + idd.name.in (), + open_mode); ::Components::ConfigValues attr_config; Deployment_Common::create_attribute_configuration (idd.configProperty, attr_config); - container->set_attributes (comp_ref.in (), - attr_config); + container->set_attributes (comp_ref.in (), attr_config); } catch (::CIAO::InvalidComponent &ex) { diff --git a/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp index 7d00837775d..7072ea3a262 100644 --- a/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp +++ b/CIAO/ciao/Deployment/Handlers/Container_Handler.cpp @@ -247,7 +247,7 @@ namespace CIAO } void - Container_Handler_i::configure (const ::Deployment::Properties &props ) + Container_Handler_i::configure (const ::Deployment::Properties &props) { CIAO_DEBUG (6, (LM_DEBUG, CLINFO "Container_Handler_i::configure - " diff --git a/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp b/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp index 2fec16f3e8b..2a809df70f3 100644 --- a/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp +++ b/CIAO/ciao/Deployment/Handlers/Home_Handler.cpp @@ -84,11 +84,19 @@ namespace CIAO CORBA::String_var exec_art, exec_entry, svnt_art, svnt_entry, cont_id; - using namespace CIAO::Deployment; CORBA::Any val; const char *tmp = 0; + int open_mode = ACE_DEFAULT_SHLIB_MODE; - if ((pmap->find (SVNT_ENTRYPT, val)) == 0) + if (pmap->find (CIAO::Deployment::OPEN_MODE, val) == 0) + { + val >>= open_mode; + CIAO_DEBUG (9, (LM_TRACE, CLINFO + "Home_Handler_i::install_instance - " + "Found open mode <%d>\n", open_mode)); + } + + if ((pmap->find (CIAO::Deployment::SVNT_ENTRYPT, val)) == 0) { val >>= tmp; svnt_entry = tmp; @@ -100,18 +108,18 @@ namespace CIAO { CIAO_ERROR (1, (LM_ERROR, CLINFO "Home_Handler_i::install_instance - " - "Error: No Servant entrypoint (%C) provided, aborting installation\n", - SVNT_ENTRYPT)); + "Error: No Servant entrypoint <%C> provided, aborting installation\n", + CIAO::Deployment::SVNT_ENTRYPT)); throw ::Deployment::InvalidComponentExecParameter (idd.name.in (), "No servant entrypoint identified."); } - if (pmap->find (SVNT_ARTIFACT, val) == 0) + if (pmap->find (CIAO::Deployment::SVNT_ARTIFACT, val) == 0) { val >>= tmp; CIAO_DEBUG (9, (LM_TRACE, CLINFO "Home_Handler_i::install_instance - " - "Found Servant artifact %C\n", tmp)); + "Found Servant artifact <%C>\n", tmp)); svnt_art = Deployment_Common::get_implementation (tmp, plan); } else @@ -124,13 +132,13 @@ namespace CIAO } - if (pmap->find (EXEC_ARTIFACT, val) == 0) + if (pmap->find (CIAO::Deployment::EXEC_ARTIFACT, val) == 0) { val >>= tmp; exec_art = Deployment_Common::get_implementation (tmp, plan); CIAO_DEBUG (9, (LM_TRACE, CLINFO "Home_Handler_i::install_instance - " - "Found executor artifact: %C\n", exec_art.in ())); + "Found executor artifact: <%C>\n", exec_art.in ())); } else { @@ -141,13 +149,13 @@ namespace CIAO "No executory artifact identified.\n"); } - if (pmap->find (HOME_FACTORY, val) == 0) + if (pmap->find (CIAO::Deployment::HOME_FACTORY, val) == 0) { val >>= tmp; exec_entry = tmp; CIAO_DEBUG (9, (LM_TRACE, CLINFO "Home_Handler_i::install_instance - " - "Found executor entrypoint: %C\n", exec_entry.in ())); + "Found executor entrypoint: <%C>\n", exec_entry.in ())); } else { @@ -158,13 +166,13 @@ namespace CIAO "No executor entrypoint provided\n"); } - if (pmap->find (CONTAINER_ID, val) == 0) + if (pmap->find (CIAO::Deployment::CONTAINER_ID, val) == 0) { val >>= tmp; cont_id = tmp; CIAO_DEBUG (9, (LM_TRACE, CLINFO "Home_Handler_i::install_instance - " - "Found executor entrypoint: %C\n", exec_entry.in ())); + "Found executor entrypoint: <%C>\n", exec_entry.in ())); } else { @@ -177,7 +185,7 @@ namespace CIAO ::CIAO::Container_var container = DEPLOYMENT_STATE::instance ()->fetch_container (cont_id); - if (CORBA::is_nil (container)) + if (CORBA::is_nil (container.in ())) { CIAO_ERROR (1, (LM_INFO, CLINFO "Home_Handler_i::install_instance - " @@ -195,7 +203,8 @@ namespace CIAO exec_entry, svnt_art, svnt_entry, - idd.name.in ()); + idd.name.in (), + open_mode); ::Components::ConfigValues attr_config; Deployment_Common::create_attribute_configuration (idd.configProperty, diff --git a/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/Component_OpenMode.cdp b/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/Component_OpenMode.cdp new file mode 100644 index 00000000000..20eb56b05ac --- /dev/null +++ b/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/Component_OpenMode.cdp @@ -0,0 +1,154 @@ +<!-- $Id$ --> +<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 Deployment.xsd"> + <label>Hello_DDS_Deployment_1</label> + <UUID>Hello_DDS_Deployment_1</UUID> + + <!-- Implementations declarations --> + + <!-- Home implementation --> + + <implementation xmi:id="CompSvrImpl"> + <name>CompSvr</name> + <source /> + <artifact xmi:idref="CompSvrArt" /> + <execParameter> + <name>edu.vanderbilt.dre.DAnCE.ImplementationType</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>edu.vanderbilt.dre.DAnCE.LocalityManager</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="CommandlinePassageComponentImplementation"> + <name>CommandlinePassageComponentImplementation</name> + <source/> + <artifact xmi:idref="CommandlinePassage_ExecArtifact" /> + <artifact xmi:idref="CommandlinePassage_SvntArtifact" /> + <execParameter> + <!-- entrypoint as exec parameter (see 10.6.1) --> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Component_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_command_line_test_A_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.OpenMode</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>3</long> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CommandlinePassage_svnt</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>CommandlinePassage_exec</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="CompSvrInst"> + <name>ComponentServerInstance</name> + <node>CommandlinePassageNode</node> + <source /> + <implementation xmi:idref="CompSvrImpl" /> + </instance> + + <instance xmi:id="CommandlinePassageComponentInstance"> + <name>CommandlinePassageComponent</name> + <node>CommandlinePassageNode</node> + <!-- hostname --> + <source/> + <implementation xmi:idref="CommandlinePassageComponentImplementation" /> + <!-- set both edu.vanderbilt.dre.CIAO.ComponentServer.Args and + tc_max to the same number --> + <configProperty> + <name>tc_max</name> + <value> + <type> + <kind>tk_long</kind> + </type> + <value> + <long>33</long> + </value> + </value> + </configProperty> + </instance> + + <!-- Artifacts declarations --> + <artifact xmi:id="CompSvrArt"> + <name>CompoSvrArtifactName</name> + <source /> + <node /> + <location>dance_locality_manager</location> + </artifact> + <artifact xmi:id="CommandlinePassage_ExecArtifact"> + <name>CommandlinePassage_exec</name> + <source/> + <node/> + <location>CommandlinePassage_exec</location> + </artifact> + <artifact xmi:id="CommandlinePassage_SvntArtifact"> + <name>CommandlinePassage_svnt</name> + <source/> + <node/> + <location>CommandlinePassage_svnt</location> + </artifact> + <artifact xmi:id="CommandlinePassage_StubArtifact"> + <name>CommandlinePassage_stub</name> + <source/> + <node/> + <location>CommandlinePassage_stub</location> + </artifact> + + <localityConstraint> + <constraint>SameProcess</constraint> + <constrainedInstance xmi:idref="CompSvrInst" /> + <constrainedInstance xmi:idref="CommandlinePassageComponentInstance" /> + </localityConstraint> + +</Deployment:DeploymentPlan> diff --git a/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_openmode.pl b/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_openmode.pl new file mode 100755 index 00000000000..f430ff05152 --- /dev/null +++ b/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_openmode.pl @@ -0,0 +1,246 @@ +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'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DANCE_ROOT = "$ENV{'DANCE_ROOT'}"; + +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; + +$nr_daemon = 1; +@ports = ( 60001 ); +@iorbases = ( "CommandlinePassage.ior" ); +@iorfiles = 0; +@nodenames = ( "CommandlinePassageNode" ); + +# ior files other than daemon +# ior files other than daemon +$ior_nsbase = "ns.ior"; +$ior_nsfile = 0; +$ior_embase = "EM.ior"; +$ior_emfile = 0; + +# Processes +$E = 0; +$EM = 0; +$NS = 0; +@DEAMONS = 0; + +# targets +@tg_daemons = 0; +$tg_naming = 0; +$tg_exe_man = 0; +$tg_executor = 0; + +$status = 0; +$cdp_file = "Component_cmd.cdp"; + + +sub create_targets { + # naming service + $tg_naming = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n"; + $tg_naming->AddLibPath ('.'); + # daemon + for ($i = 0; $i < $nr_daemon; ++$i) { + $tg_daemons[$i] = PerlACE::TestTarget::create_target ($i+1) || die "Create target for daemon $i failed\n"; + $tg_daemons[$i]->AddLibPath ('.'); + } + # execution manager + $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n"; + $tg_exe_man->AddLibPath ('.'); + # executor (plan_launcher) + $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n"; + $tg_executor->AddLibPath ('.'); +} + +sub init_ior_files { + $ior_nsfile = $tg_naming->LocalFile ($ior_nsbase); + $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_naming->DeleteFile ($ior_nsbase); + $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); + } + + if ($ns_running == 1) { + $NS->Kill (); $NS->TimedWait (1); + } + # in case shutdown did not perform as expected + $tg_executor->KillAll ('dance_locality_manager'); +} + +sub run_node_daemons { + for ($i = 0; $i < $nr_daemon; ++$i) { + $iorbase = $iorbases[$i]; + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + $nodename = $nodenames[$i]; + $iiop = "iiop://localhost:$port"; + $node_app = $tg_daemons[$i]->GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager"; + $cmd_server_args = "--server-args '\"-ORBSvcConfDirective\" \"static Resource_Factory \\'-ORBConnectionCacheMax 33\\'\"'"; + + $d_cmd = "$DANCE_ROOT/bin/dance_node_manager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService $cmd_server_args"; + + 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; + } + } + return 0; +} + +create_targets (); +init_ior_files (); + +# Invoke naming service + +$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile"); + +print STDERR "Starting Naming Service with -ORBEndpoint iiop://localhost:60003 -o ns.ior\n"; + +$ns_status = $NS->Spawn (); + +if ($ns_status != 0) { + print STDERR "ERROR: Unable to execute the naming service\n"; + kill_open_processes (); + exit 1; +} + +if ($tg_naming->WaitForFileTimed ($ior_nsbase, + $tg_naming->ProcessStartWaitInterval ()) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); $NS->TimedWait (1); + exit 1; +} + +$ns_running = 1; +# Set up NamingService environment +$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + +# Invoke node daemon. +print "Invoking node daemon\n"; +$status = run_node_daemons (); + +if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemon\n"; + kill_open_processes (); + exit 1; +} + +$daemons_running = 1; + +# Invoke execution manager. +print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n"; +$EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager", + "-e$ior_emfile --domain-nc corbaloc:rir:/NameService"); +$em_status = $EM->Spawn (); + +if ($em_status != 0) { + print STDERR "ERROR: dance_execution_manager returned $em_status"; + exit 1; +} + +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 - launch the application -\n"; + +print "Start dance_plan_launcher.exe with -x $cdp_file -k file://$ior_emfile\n"; +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x $cdp_file -k file://$ior_emfile"); + +$pl_status = $E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +for ($i = 0; $i < $nr_daemon; ++$i) { + if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i], + $tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) { + print STDERR "ERROR: The ior file of daemon $i could not be found\n"; + kill_open_processes (); + exit 1; + } +} + +print "Sleeping 10 seconds to allow task to complete\n"; +sleep (10); + +# Invoke executor - stop the application -. +print "Invoking executor - stop the application -\n"; +print "by running dance_plan_launcher.exe with -k file://$ior_emfile -x $cdp_file\n"; + +$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$ior_emfile -x $cdp_file -s"); +$pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ()); + +if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; +} + +print "Executor returned.\n"; +print "Shutting down rest of the processes.\n"; + +delete_ior_files (); +kill_open_processes (); + +exit $status; |