diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-11-11 11:25:27 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-11-11 11:25:27 +0000 |
commit | a26c6ba31ab9af662573cd6e83813b5d2f19abb2 (patch) | |
tree | dacbd5c64cbfcb176760e347fae8c92827827da4 /CIAO/connectors/ami4ccm/examples/Hello | |
parent | 76ad38de2d406e6a751ac0ad18f1d21d9fdd8510 (diff) | |
download | ATCD-a26c6ba31ab9af662573cd6e83813b5d2f19abb2.tar.gz |
Thu Nov 10 14:15:13 UTC 2011 Martin Corino <mcorino@remedy.nl>
* bin/ciao_tests.lst:
* connectors/ami4ccm/examples/Hello/descriptors/PlanFullBlock.cdp:
* connectors/ami4ccm/examples/Hello/descriptors/run_fullblock_test.pl:
Added variant of test using full blocking container servers
(LocalityManager).
Diffstat (limited to 'CIAO/connectors/ami4ccm/examples/Hello')
-rw-r--r-- | CIAO/connectors/ami4ccm/examples/Hello/descriptors/PlanFullBlock.cdp | 447 | ||||
-rwxr-xr-x | CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_fullblock_test.pl | 244 |
2 files changed, 691 insertions, 0 deletions
diff --git a/CIAO/connectors/ami4ccm/examples/Hello/descriptors/PlanFullBlock.cdp b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/PlanFullBlock.cdp new file mode 100644 index 00000000000..36c1fe288d1 --- /dev/null +++ b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/PlanFullBlock.cdp @@ -0,0 +1,447 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<!-- $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"> + + <UUID>6D382DAE-9024-4C4D-B91B-A0F9176AFACF</UUID> + + <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="Hello_ReceiverHomeImplementation"> + <name>Hello_ReceiverHomeImplementation</name> + <source/> + <artifact xmi:idref="Hello_Receiver_ExecArtifact"/> + <artifact xmi:idref="Hello_Receiver_SvntArtifact"/> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI_Receiver_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_exec</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_Receiver_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_svnt</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="Hello_SenderHomeImplementation"> + <name>Hello_SenderHomeImplementation</name> + <source/> + <artifact xmi:idref="Hello_Sender_ExecArtifact"/> + <artifact xmi:idref="Hello_Sender_SvntArtifact"/> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_Sender_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello.ImplementationArtifacts.SenderArtifacts.Sender_exec</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_Sender_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello.ImplementationArtifacts.SenderArtifacts.Sender_svnt</string> + </value> + </value> + </execParameter> + </implementation> + + <implementation xmi:id="Hello_AMIHomeImplementation"> + <name>Hello_AMIHomeImplementation</name> + <source/> + <artifact xmi:idref="Hello_AMI_ExecArtifact"/> + <artifact xmi:idref="Hello_AMI_SvntArtifact"/> + <execParameter> + <name>component factory</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI4CCM_MyFoo_Connector_Impl</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ExecutorArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello.ImplementationArtifacts.AMIArtifacts.AMI_exec</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantEntrypoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI4CCM_MyFoo_Connector_AMI4CCM_Connector_Servant</string> + </value> + </value> + </execParameter> + <execParameter> + <name>edu.vanderbilt.dre.CIAO.ServantArtifact</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Hello.ImplementationArtifacts.AMIArtifacts.AMI_svnt</string> + </value> + </value> + </execParameter> + </implementation> + + <instance xmi:id="CompSvr1Inst"> + <name>ComponentServer1Instance</name> + <node>Receiver</node> + <source /> + <implementation xmi:idref="CompSvrImpl" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>-ORBSvcConfDirective "static Client_Strategy_Factory '-ORBTransportMuxStrategy EXCLUSIVE -ORBClientConnectionHandler RW -ORBConnectStrategy blocked'" -ORBSvcConfDirective "static Resource_Factory '-ORBFlushingStrategy blocking'"</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver"> + <name>Hello.ComponentImplementations.HelloImplementation.Hello.Receiver</name> + <node>Receiver</node> + <source/> + <implementation xmi:idref="Hello_ReceiverHomeImplementation"/> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Receiver.ior</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="CompSvr2Inst"> + <name>ComponentServer2Instance</name> + <node>Sender</node> + <source /> + <implementation xmi:idref="CompSvrImpl" /> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.LocalityArguments</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>-ORBSvcConfDirective "static Client_Strategy_Factory '-ORBTransportMuxStrategy EXCLUSIVE -ORBClientConnectionHandler RW -ORBConnectStrategy blocked'" -ORBSvcConfDirective "static Resource_Factory '-ORBFlushingStrategy blocking'"</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Hello.ComponentImplementations.HelloImplementation.Hello.Sender"> + <name>Hello.ComponentImplementations.HelloImplementation.Hello.Sender</name> + <node>Sender</node> + <source/> + <implementation xmi:idref="Hello_SenderHomeImplementation"/> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>Sender.ior</string> + </value> + </value> + </configProperty> + </instance> + + <instance xmi:id="Hello.ComponentImplementations.HelloImplementation.Hello.AMI"> + <name>Hello.ComponentImplementations.HelloImplementation.Hello.AMI</name> + <node>Sender</node> + <source/> + <implementation xmi:idref="Hello_AMIHomeImplementation"/> + <configProperty> + <name>edu.vanderbilt.dre.DAnCE.InstanceIOR</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>AMI.ior</string> + </value> + </value> + </configProperty> + </instance> + + <connection> + <name>run_asynch_foo_connection</name> + <deployRequirement> + <name>edu.dre.vanderbilt.DAnCE.ConnectionType</name> + <resourceType>Local_Interface</resourceType> + </deployRequirement> + <internalEndpoint> + <portName>sendc_run_my_foo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" /> + </internalEndpoint> + <internalEndpoint> + <portName>ami4ccm_port_ami4ccm_provides</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" /> + </internalEndpoint> + </connection> + + <connection> + <name>do_foo_connection</name> + <internalEndpoint> + <portName>do_my_foo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver" /> + </internalEndpoint> + <internalEndpoint> + <portName>ami4ccm_port_ami4ccm_uses</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" /> + </internalEndpoint> + </connection> + + <connection> + <name>synch_foo_connection</name> + <internalEndpoint> + <portName>do_my_foo</portName> + <provider>true</provider> + <kind>Facet</kind> + <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver" /> + </internalEndpoint> + <internalEndpoint> + <portName>run_my_foo</portName> + <provider>false</provider> + <kind>SimplexReceptacle</kind> + <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" /> + </internalEndpoint> + </connection> + + <artifact xmi:id="CompSvrArt"> + <name>CompoSvrArtifactName</name> + <source /> + <node /> + <location>dance_locality_manager</location> + </artifact> + + <artifact xmi:id="Hello_AMI_SvntArtifact"> + <name>Hello.ImplementationArtifacts.AMIArtifacts.AMI_svnt</name> + <source/> + <node/> + <location>Hello_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI4CCM_MyFoo_Connector_AMI4CCM_Connector_Servant</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact xmi:id="Hello_AMI_ExecArtifact"> + <name>Hello.ImplementationArtifacts.AMIArtifacts.AMI_exec</name> + <source/> + <node/> + <location>Hello_conn</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI4CCM_MyFoo_Connector_Impl</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact xmi:id="Hello_Receiver_SvntArtifact"> + <name>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_svnt</name> + <source/> + <node/> + <location>Hello_Receiver_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI_ReceiverHome_Servant</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact xmi:id="Hello_Receiver_ExecArtifact"> + <name>Hello.ImplementationArtifacts.ReceiverArtifacts.Receiver_exec</name> + <source/> + <node/> + <location>Hello_Receiver_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI_ReceiverHome_Impl</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact xmi:id="Hello_Sender_SvntArtifact"> + <name>Hello.ImplementationArtifacts.SenderArtifacts.Sender_svnt</name> + <source/> + <node/> + <location>Hello_Sender_svnt</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI_SenderHome_Servant</string> + </value> + </value> + </execParameter> + </artifact> + + <artifact xmi:id="Hello_Sender_ExecArtifact"> + <name>Hello.ImplementationArtifacts.SenderArtifacts.Sender_exec</name> + <source/> + <node/> + <location>Hello_Sender_exec</location> + <execParameter> + <name>entryPoint</name> + <value> + <type> + <kind>tk_string</kind> + </type> + <value> + <string>create_Hello_AMI_SenderHome_Impl</string> + </value> + </value> + </execParameter> + </artifact> + + <localityConstraint> + <constraint>SameProcess</constraint> + <constrainedInstance xmi:idref="CompSvr1Inst" /> + <constrainedInstance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Receiver" /> + </localityConstraint> + + <localityConstraint> + <constraint>SameProcess</constraint> + <constrainedInstance xmi:idref="CompSvr2Inst" /> + <constrainedInstance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" /> + <constrainedInstance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" /> + </localityConstraint> + +</Deployment:DeploymentPlan> diff --git a/CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_fullblock_test.pl b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_fullblock_test.pl new file mode 100755 index 00000000000..21dd65aca2d --- /dev/null +++ b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_fullblock_test.pl @@ -0,0 +1,244 @@ +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 = 2; +@ports = ( 60000, 60001 ); +@iorbases = ( "Sender.ior", "Receiver.ior"); +@iorfiles = 0; +@nodenames = ( "Sender", "Receiver" ); + +# 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 = "PlanFullBlock.cdp"; + +sub create_targets { + # naming service + $tg_naming = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n"; + $tg_naming->AddLibPath ('../lib'); + # 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 ('../lib'); + } + # execution manager + $tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n"; + $tg_exe_man->AddLibPath ('../lib'); + # executor (plan_launcher) + $tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n"; + $tg_executor->AddLibPath ('../lib'); +} + +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"; + + $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"; + + 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 90 seconds to allow task to complete\n"; +sleep (90); + +# 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; |