summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarijke Hengstmengel <MHengstmengel@users.noreply.github.com>2011-12-19 12:41:12 +0000
committerMarijke Hengstmengel <MHengstmengel@users.noreply.github.com>2011-12-19 12:41:12 +0000
commitd360633b01ef599e676886420b8115bc5926058c (patch)
treedc60bc99d7299089e7b1149aedec9ec7a7048477
parenta949aa3b1fcdc0f45160b7ff8033a0386507e5fc (diff)
downloadATCD-d360633b01ef599e676886420b8115bc5926058c.tar.gz
Mon Dec 19 11:33:05 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl>
* tests/DAnCE/NodeManager-Deployments/run_test.pl: * tests/DAnCE/NodeManager-Deployments/run_test_noevent.pl: * tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl: * tests/DAnCE/NodeManager-Deployments/run_testcdr_noevent.pl: * tests/DAnCE/ExecutionManager-Deployments/run_test.pl: * tests/DAnCE/ExecutionManager-Deployments/run_test_noevent.pl: * tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl: * tests/DAnCE/ExecutionManager-Deployments/run_testcdr_noevent.pl: * tests/DAnCE/EM-Redeployment/run_test.pl: * tests/DAnCE/Em_Redeployment/run_test_noevent.pl: * bin/ciao_tests.lst: Splitted tests-runs in runs for noevent disabled and enabled.
-rw-r--r--CIAO/ChangeLog18
-rw-r--r--CIAO/bin/ciao_tests.lst15
-rwxr-xr-xCIAO/tests/DAnCE/EM-Redeployment/run_test.pl10
-rwxr-xr-xCIAO/tests/DAnCE/EM-Redeployment/run_test_noevent.pl241
-rwxr-xr-xCIAO/tests/DAnCE/ExecutionManager-Deployments/run_test.pl11
-rwxr-xr-xCIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl11
-rwxr-xr-xCIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr_noevent.pl256
-rwxr-xr-xCIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_noevent.pl244
-rwxr-xr-xCIAO/tests/DAnCE/NodeManager-Deployments/run_test.pl7
-rwxr-xr-xCIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl5
-rwxr-xr-xCIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr_noevent.pl241
-rwxr-xr-xCIAO/tests/DAnCE/NodeManager-Deployments/run_test_noevent.pl222
12 files changed, 1258 insertions, 23 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog
index 3cb775e2742..67c993e9ea8 100644
--- a/CIAO/ChangeLog
+++ b/CIAO/ChangeLog
@@ -1,3 +1,21 @@
+Mon Dec 19 11:33:05 UTC 2011 Marijke Hengstmengel <mhengstmengel@remedy.nl>
+
+ * tests/DAnCE/NodeManager-Deployments/run_test.pl:
+ * tests/DAnCE/NodeManager-Deployments/run_test_noevent.pl:
+ * tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl:
+ * tests/DAnCE/NodeManager-Deployments/run_testcdr_noevent.pl:
+ * tests/DAnCE/ExecutionManager-Deployments/run_test.pl:
+ * tests/DAnCE/ExecutionManager-Deployments/run_test_noevent.pl:
+ * tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl:
+ * tests/DAnCE/ExecutionManager-Deployments/run_testcdr_noevent.pl:
+ * tests/DAnCE/EM-Redeployment/run_test.pl:
+ * tests/DAnCE/Em_Redeployment/run_test_noevent.pl:
+ * bin/ciao_tests.lst:
+ Splitted tests-runs in runs for noevent disabled and enabled.
+
+
+
+
Sun Dec 18 11:36:05 UTC 2011 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/ciao_tests.lst:
diff --git a/CIAO/bin/ciao_tests.lst b/CIAO/bin/ciao_tests.lst
index 63a8a028b1b..0076b228f46 100644
--- a/CIAO/bin/ciao_tests.lst
+++ b/CIAO/bin/ciao_tests.lst
@@ -150,11 +150,16 @@ TAO/CIAO/connectors/dds4ccm/performance-tests/DDSLatency/descriptors/run_test_nd
TAO/CIAO/connectors/dds4ccm/performance-tests/Throughput/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST NDDS
TAO/CIAO/connectors/dds4ccm/performance-tests/DDSThroughput/descriptors/run_test_dds.pl: !ACE_FOR_TAO !ST NDDS
TAO/CIAO/connectors/dds4ccm/tests/HomeTest/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST NDDS
-TAO/CIAO/tests/DAnCE/NodeManager-Deployments/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
-TAO/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
-TAO/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
-TAO/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
-TAO/CIAO/tests/DAnCE/EM-Redeployment/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
+TAO/CIAO/tests/DAnCE/NodeManager-Deployments/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !CCM_NOEVENT
+TAO/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !CCM_NOEVENT
+TAO/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_noevent.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
+TAO/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr_noevent.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
+TAO/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !CCM_NOEVENT
+TAO/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !CCM_NOEVENT
+TAO/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_noevent.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
+TAO/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr_noevent.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
+TAO/CIAO/tests/DAnCE/EM-Redeployment/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE !CCM_NOEVENT
+TAO/CIAO/tests/DAnCE/EM-Redeployment/run_test_noevent.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
TAO/CIAO/tests/DAnCE/EM-Launch-Failures/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
TAO/CIAO/tests/DAnCE/EM-Shutdown-Failures/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
TAO/CIAO/tests/DAnCE/Executor-Destructor/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST !LabVIEW_RT !WinCE
diff --git a/CIAO/tests/DAnCE/EM-Redeployment/run_test.pl b/CIAO/tests/DAnCE/EM-Redeployment/run_test.pl
index 2db8f416225..d7c541c0a19 100755
--- a/CIAO/tests/DAnCE/EM-Redeployment/run_test.pl
+++ b/CIAO/tests/DAnCE/EM-Redeployment/run_test.pl
@@ -142,10 +142,14 @@ sub run_node_daemons {
return 0;
}
+# only run tests if noevent is disabled
if ($#ARGV == -1) {
- opendir(DIR, "../ExecutionManager-Deployments");
- @files = grep(/\.cdp$/,readdir(DIR));
- closedir(DIR);
+ @files = ("../ExecutionManager-Deployments/PublishConnectionExplicitHome.cdp",
+ "../ExecutionManager-Deployments/PublishConnectionExplicitHome_NS.cdp",
+ "../ExecutionManager-Deployments/PublishConnectionExplicitHome_NS_PL_DP.cdp",
+ "../ExecutionManager-Deployments/PublishConnectionExplicitHome_NS_PL_SP.cdp",
+ "../ExecutionManager-Deployments/EmitsConnectionExplicitHome.cdp",
+ "../ExecutionManager-Deployments/EmitsConnectionExplicitHome_NS.cdp")
}
else {
@files = @ARGV;
diff --git a/CIAO/tests/DAnCE/EM-Redeployment/run_test_noevent.pl b/CIAO/tests/DAnCE/EM-Redeployment/run_test_noevent.pl
new file mode 100755
index 00000000000..c121dd23a5c
--- /dev/null
+++ b/CIAO/tests/DAnCE/EM-Redeployment/run_test_noevent.pl
@@ -0,0 +1,241 @@
+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'}";
+
+$ENV{'CIAO_LOG_LEVEL'}=1;
+
+$daemons_running = 0;
+$em_running = 0;
+$ns_running = 0;
+
+$repeat = 1;
+
+$nr_daemon = 2;
+@ports = ( 60001, 60002 );
+@iorbases = ( "NodeApp1.ior", "NodeApp2.ior" );
+@iorfiles = 0;
+@nodenames = ( "NodeOne", "NodeTwo" );
+
+# 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;
+
+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+2) || die "Create target for daemon $i failed\n";
+ $tg_daemons[$i]->AddLibPath ('../Components');
+ }
+ # 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);
+}
+
+sub kill_localities {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ # in case shutdown did not perform as expected
+ $tg_daemons[$i]->KillAll ('dance_locality_manager');
+ }
+}
+
+sub kill_node_daemons {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
+ }
+ kill_localities ();
+}
+
+sub kill_open_processes {
+ if ($daemons_running == 1) {
+ kill_node_daemons ();
+ }
+
+ if ($em_running == 1) {
+ $EM->Kill (); $EM->TimedWait (1);
+ }
+
+ if ($ns_running == 1) {
+ $NS->Kill (); $NS->TimedWait (1);
+ }
+}
+
+
+sub run_node_daemons {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $iorbase = $iorbases[$i];
+ $iorfile = $iorfiles[$i];
+ $port = $ports[$i];
+ $nodename = $nodenames[$i];
+ $node_host = $tg_daemons[$i]->HostName ();
+ $iiop = "iiop://$node_host:$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 --instance-nc corbaloc:rir:/NameService";
+
+ print "Run node daemon\n";
+ $tg_daemons[$i]->SetEnv ("NameServiceIOR", $tg_exe_man->GetEnv ("NameServiceIOR"));
+
+ $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;
+}
+#only test that runs with noevents
+if ($#ARGV == -1) {
+ @files = (
+ "MultiplexConnectionExplicitHome.cdp",
+ "MultiplexConnectionExplicitHome_NS.cdp",
+ "MultiplexConnectionExplicitHome_NS_PL_DP.cdp",
+ "MultiplexConnectionExplicitHome_NS_PL_SP.cdp",
+ "SimpleComponentExplicitHome.cdp",
+ "SimpleProcessColocation.cdp",
+ "SimpleProcessColocation_2.cdp",
+ "SimpleProcessColocation_Default.cdp",
+ "SimplexConnectionExplicitHome.cdp",
+ "SimplexConnectionExplicitHome_NS.cdp",
+ "SimplexConnectionExplicitHome_NS_PL_DP.cdp",
+ "SimplexConnectionExplicitHome_NS_PL_SP.cdp",
+ "SimplexConnectionExplicitHome_NilFacet.cdp")
+}
+else {
+ @files = @ARGV;
+}
+
+create_targets ();
+init_ior_files ();
+
+foreach $file (@files) {
+ $file = '../ExecutionManager-Deployments/'.$file;
+ print "Starting redeployment test for $file\n";
+
+ print STDERR "Starting Naming Service\n";
+
+ my $ns_host = $tg_naming->HostName ();
+ $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", "-m 0 -ORBEndpoint iiop://$ns_host:60003 -o $ior_nsfile");
+ $NS->Spawn ();
+
+ 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
+ $tg_exe_man->SetEnv ("NameServiceIOR", "corbaloc:iiop:$ns_host:60003/NameService");
+ $tg_executor->SetEnv ("NameServiceIOR", "corbaloc:iiop:$ns_host: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 daemons\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ $daemons_running = 1;
+
+ # Invoke execution manager.
+ print "Invoking execution manager\n";
+ $EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager",
+ "-e$ior_emfile --domain-nc corbaloc:rir:/NameService");
+ $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;
+
+ for ($i = 0; $i <= $repeat; ++$i) {
+ my $iteration = $i+1;
+ # Invoke executor - start the application -.
+ print "#$iteration - Invoking executor - launch the application -\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-x $file -k file://$ior_emfile -l");
+ $E->SpawnWaitKill (120);
+
+ print "#$iteration - Teardown the application\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-k file://$ior_emfile -x $file -s");
+ $E->SpawnWaitKill (120);
+ print "#$iteration - Executor finished.\n";
+ }
+
+ delete_ior_files ();
+ kill_open_processes ();
+ sleep 5;
+}
+
+delete_ior_files ();
+kill_open_processes ();
+
+exit $status;
diff --git a/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test.pl b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test.pl
index 8e87d6d9481..5c14194b1ff 100755
--- a/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test.pl
+++ b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test.pl
@@ -144,11 +144,14 @@ sub run_node_daemons {
}
return 0;
}
-
+# only run tests if noevent is disabled
if ($#ARGV == -1) {
- opendir(DIR, ".");
- @files = grep(/\.cdp$/,readdir(DIR));
- closedir(DIR);
+ @files = ("PublishConnectionExplicitHome.cdp",
+ "PublishConnectionExplicitHome_NS.cdp",
+ "PublishConnectionExplicitHome_NS_PL_DP.cdp",
+ "PublishConnectionExplicitHome_NS_PL_SP.cdp",
+ "EmitsConnectionExplicitHome.cdp",
+ "EmitsConnectionExplicitHome_NS.cdp")
}
else {
@files = @ARGV;
diff --git a/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl
index 702e38b10c1..4f831d1f140 100755
--- a/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl
+++ b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr.pl
@@ -141,11 +141,14 @@ sub run_node_daemons {
}
return 0;
}
-
+# only run tests if noevent is disabled
if ($#ARGV == -1) {
- opendir(DIR, ".");
- @files = grep(/\.cdp$/,readdir(DIR));
- closedir(DIR);
+ @files = ("PublishConnectionExplicitHome.cdp",
+ "PublishConnectionExplicitHome_NS.cdp",
+ "PublishConnectionExplicitHome_NS_PL_DP.cdp",
+ "PublishConnectionExplicitHome_NS_PL_SP.cdp",
+ "EmitsConnectionExplicitHome.cdp",
+ "EmitsConnectionExplicitHome_NS.cdp")
}
else {
@files = @ARGV;
diff --git a/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr_noevent.pl b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr_noevent.pl
new file mode 100755
index 00000000000..0e7d27c65f1
--- /dev/null
+++ b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_cdr_noevent.pl
@@ -0,0 +1,256 @@
+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'}";
+
+$ENV{'CIAO_LOG_LEVEL'}=1;
+
+$daemons_running = 0;
+$em_running = 0;
+$ns_running = 0;
+
+$nr_daemon = 2;
+@ports = ( 60001, 60002 );
+@iorbases = ( "NodeApp1.ior", "NodeApp2.ior" );
+@iorfiles = 0;
+@nodenames = ( "NodeOne", "NodeTwo" );
+
+# 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;
+$tg_convert_plan = 0;
+
+$status = 0;
+
+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+2) || die "Create target for daemon $i failed\n";
+ $tg_daemons[$i]->AddLibPath ('../Components');
+ }
+ # 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 ('..');
+
+ $tg_convert_plan = PerlACE::TestTarget::create_target (1) || die "Could not create target for convert plan\n";
+}
+
+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);
+ }
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ # in case shutdown did not perform as expected
+ $tg_daemons[$i]->KillAll ('dance_locality_manager');
+ }
+}
+
+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);
+ }
+}
+
+
+sub run_node_daemons {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $iorbase = $iorbases[$i];
+ $iorfile = $iorfiles[$i];
+ $port = $ports[$i];
+ $nodename = $nodenames[$i];
+ $node_host = $tg_daemons[$i]->HostName ();
+ $iiop = "iiop://$node_host:$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 --instance-nc corbaloc:rir:/NameService";
+
+ print "Run node daemon\n";
+ $tg_daemons[$i]->SetEnv ("NameServiceIOR", $tg_exe_man->GetEnv ("NameServiceIOR"));
+
+ $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;
+}
+
+if ($#ARGV == -1) {
+ @files = (
+ "MultiplexConnectionExplicitHome.cdp",
+ "MultiplexConnectionExplicitHome_NS.cdp",
+ "MultiplexConnectionExplicitHome_NS_PL_DP.cdp",
+ "MultiplexConnectionExplicitHome_NS_PL_SP.cdp",
+ "SimpleComponentExplicitHome.cdp",
+ "SimpleProcessColocation.cdp",
+ "SimpleProcessColocation_2.cdp",
+ "SimpleProcessColocation_Default.cdp",
+ "SimplexConnectionExplicitHome.cdp",
+ "SimplexConnectionExplicitHome_NS.cdp",
+ "SimplexConnectionExplicitHome_NS_PL_DP.cdp",
+ "SimplexConnectionExplicitHome_NS_PL_SP.cdp",
+ "SimplexConnectionExplicitHome_NilFacet.cdp")}
+else {
+ @files = @ARGV;
+}
+
+create_targets ();
+init_ior_files ();
+
+foreach $file (@files) {
+ print "Starting test for deployment $file\n";
+
+ print STDERR "Starting Naming Service\n";
+
+ my $ns_host = $tg_naming->HostName ();
+ $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", "-m 0 -ORBEndpoint iiop://$ns_host:60003 -o $ior_nsfile");
+ $NS->Spawn ();
+
+ 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
+ $tg_exe_man->SetEnv ("NameServiceIOR", "corbaloc:iiop:$ns_host:60003/NameService");
+ $tg_executor->SetEnv ("NameServiceIOR", "corbaloc:iiop:$ns_host: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 daemons\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ $daemons_running = 1;
+
+ # Invoke execution manager.
+ print "Invoking execution manager\n";
+ $EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager",
+ "-e$ior_emfile --domain-nc corbaloc:rir:/NameService");
+ $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;
+
+ print "Converting plan to CDR representation\n";
+ $cdr_planbase = "$file" . ".cdr";
+ $cdr_plan = $tg_convert_plan->LocalFile ($cdr_planbase);
+ $convert = $tg_convert_plan->CreateProcess("$DANCE_ROOT/bin/dance_convert_plan",
+ "-x $file -o $cdr_plan");
+
+ $convert->Spawn ();
+
+ if ($tg_convert_plan->WaitForFileTimed ($cdr_planbase,
+ 30) == -1) {
+ print STDERR "ERROR: Convert Plan failed to output $cdr_plan.\n";
+ kill_open_processes ();
+ next;
+ }
+
+ $convert->Kill ();
+
+ # Invoke executor - start the application -.
+ print "Invoking executor - launch the application -\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-c $cdr_plan -k file://$ior_emfile -l");
+ $E->SpawnWaitKill (120);
+
+ print "Teardown the application\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-k file://$ior_emfile -c $cdr_plan -s");
+ $E->SpawnWaitKill (120);
+ print "Executor finished.\n";
+
+ $tg_convert_plan->DeleteFile ($cdr_planbase);
+ delete_ior_files ();
+ kill_open_processes ();
+
+ # Sleep for a couple seconds to make sure everything has a chance to shut down.
+ sleep 5;
+}
+
+delete_ior_files ();
+kill_open_processes ();
+
+exit $status;
diff --git a/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_noevent.pl b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_noevent.pl
new file mode 100755
index 00000000000..b93ba8316fe
--- /dev/null
+++ b/CIAO/tests/DAnCE/ExecutionManager-Deployments/run_test_noevent.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'}";
+
+$ENV{'CIAO_LOG_LEVEL'}= $ENV{'CIAO_LOG_LEVEL'} || 1;
+
+$daemons_running = 0;
+$em_running = 0;
+$ns_running = 0;
+
+$nr_daemon = 2;
+@ports = ( 60001, 60002 );
+@iorbases = ( "NodeApp1.ior", "NodeApp2.ior" );
+@iorfiles = 0;
+@nodenames = ( "NodeOne", "NodeTwo" );
+
+# 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;
+
+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+2) || die "Create target for daemon $i failed\n";
+ $tg_daemons[$i]->AddLibPath ('../Components');
+ }
+ # 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_localities {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ # in case shutdown did not perform as expected
+ $tg_daemons[$i]->KillAll ('dance_locality_manager');
+ }
+}
+
+sub kill_node_daemons {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
+ }
+ kill_localities ();
+}
+
+sub kill_open_processes {
+ if ($daemons_running == 1) {
+ kill_node_daemons ();
+ }
+
+ if ($em_running == 1) {
+ $EM->Kill (); $EM->TimedWait (1);
+ }
+
+ if ($ns_running == 1) {
+ $NS->Kill (); $NS->TimedWait (1);
+ }
+}
+
+
+sub run_node_daemons {
+ for ($i = 0; $i < $nr_daemon; ++$i) {
+ $iorbase = $iorbases[$i];
+ $iorfile = $iorfiles[$i];
+ $port = $ports[$i];
+ $nodename = $nodenames[$i];
+ $node_host = $tg_daemons[$i]->HostName ();
+ $iiop = "iiop://$node_host:$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 --instance-nc corbaloc:rir:/NameService";
+
+ print "Run node daemon\n";
+
+ ## add NameService env setting to node targets
+ $tg_daemons[$i]->SetEnv ('NameServiceIOR', $tg_exe_man->GetEnv ("NameServiceIOR"));
+
+ $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;
+}
+#only test that runs with noevents
+if ($#ARGV == -1) {
+ @files = (
+ "MultiplexConnectionExplicitHome.cdp",
+ "MultiplexConnectionExplicitHome_NS.cdp",
+ "MultiplexConnectionExplicitHome_NS_PL_DP.cdp",
+ "MultiplexConnectionExplicitHome_NS_PL_SP.cdp",
+ "SimpleComponentExplicitHome.cdp",
+ "SimpleProcessColocation.cdp",
+ "SimpleProcessColocation_2.cdp",
+ "SimpleProcessColocation_Default.cdp",
+ "SimplexConnectionExplicitHome.cdp",
+ "SimplexConnectionExplicitHome_NS.cdp",
+ "SimplexConnectionExplicitHome_NS_PL_DP.cdp",
+ "SimplexConnectionExplicitHome_NS_PL_SP.cdp",
+ "SimplexConnectionExplicitHome_NilFacet.cdp")
+}
+else {
+ @files = @ARGV;
+}
+
+create_targets ();
+init_ior_files ();
+
+foreach $file (@files) {
+ print "Starting test for deployment $file\n";
+
+ print STDERR "Starting Naming Service\n";
+
+ my $ns_host = $tg_naming->HostName ();
+ $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", "-m 0 -ORBEndpoint iiop://$ns_host:60003 -o $ior_nsfile");
+ $NS->Spawn ();
+
+ 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
+ $tg_exe_man->SetEnv ("NameServiceIOR", "corbaloc:iiop:$ns_host:60003/NameService");
+ $tg_executor->SetEnv ("NameServiceIOR", "corbaloc:iiop:$ns_host: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 daemons\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ $daemons_running = 1;
+
+ # Invoke execution manager.
+ print "Invoking execution manager\n";
+ $EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager",
+ "-e$ior_emfile --domain-nc corbaloc:rir:/NameService");
+ $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 - launch the application -\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-x $file -k file://$ior_emfile -l");
+ $E->SpawnWaitKill (120);
+
+ print "Teardown the application\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-k file://$ior_emfile -x $file -s");
+ $E->SpawnWaitKill (120);
+ print "Executor finished.\n";
+
+ delete_ior_files ();
+ kill_open_processes ();
+
+ $daemons_running = 0;
+
+ # Sleep for a couple seconds to make sure everything has a chance to shut down.
+ sleep 5;
+}
+
+delete_ior_files ();
+kill_open_processes ();
+
+exit $status;
diff --git a/CIAO/tests/DAnCE/NodeManager-Deployments/run_test.pl b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test.pl
index 21589022640..c79a5089296 100755
--- a/CIAO/tests/DAnCE/NodeManager-Deployments/run_test.pl
+++ b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test.pl
@@ -143,11 +143,10 @@ sub run_node_daemons {
}
return 0;
}
-
+#only test that runs with noevent disabled
if ($#ARGV == -1) {
- opendir(DIR, ".");
- @files = grep(/\.cdp$/,readdir(DIR));
- closedir(DIR);
+ @files =("EmitsConnectionExplicitHome.cdp",
+ "PublishConnectionExplicitHome.cdp")
}
else {
@files = @ARGV;
diff --git a/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl
index 383f31437e9..35db2d8f8f7 100755
--- a/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl
+++ b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr.pl
@@ -146,9 +146,8 @@ sub run_node_daemons {
}
if ($#ARGV == -1) {
- opendir(DIR, ".");
- @files = grep(/\.cdp$/,readdir(DIR));
- closedir(DIR);
+ @files =("EmitsConnectionExplicitHome.cdp",
+ "PublishConnectionExplicitHome.cdp")
}
else {
@files = @ARGV;
diff --git a/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr_noevent.pl b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr_noevent.pl
new file mode 100755
index 00000000000..09e57c3fe03
--- /dev/null
+++ b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_cdr_noevent.pl
@@ -0,0 +1,241 @@
+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'}";
+
+$ENV{'CIAO_LOG_LEVEL'}=1;
+
+$daemons_running = 0;
+$em_running = 0;
+$ns_running = 0;
+
+$nr_daemon = 1;
+@ports = ( 60001 );
+@iorbases = ( "NodeApp1.ior" );
+@iorfiles = 0;
+@nodenames = ( "NodeOne" );
+
+# ior files other than daemon
+$ior_nsbase = "ns.ior";
+$ior_nsfile = 0;
+$ior_embase = "EM.ior";
+$ior_emfile = 0;
+$ior_applicationbase = "Node_APP.ior";
+$ior_application = 0;
+$ior_ambase = "Node_AM.ior";
+$ior_am = 0;
+
+# Processes
+$E = 0;
+$EM = 0;
+$NS = 0;
+@DEAMONS = 0;
+
+# targets
+@tg_daemons = 0;
+$tg_naming = 0;
+$tg_exe_man = 0;
+$tg_executor = 0;
+$tg_convert_plan = 0;
+
+$status = 0;
+
+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 ('../Components');
+ }
+ # 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 ('..');
+
+ $tg_convert_plan = PerlACE::TestTarget::create_target (1) || die "Could not create target for convert plan\n";
+}
+
+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]);
+ }
+ $ior_application = $tg_executor->LocalFile ($ior_applicationbase);
+ $ior_am = $tg_executor->LocalFile ($ior_ambase);
+
+ 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 --instance-nc corbaloc:rir:/NameService";
+
+ print "Run node daemon\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;
+}
+#run only test with noevent
+if ($#ARGV == -1) {
+ @files = (
+ "LocalSimplexConnectionExplicitHome.cdp",
+ "MultiplexConnectionExplicitHome.cdp",
+ "SimpleAttributeExplicitHome.cdp",
+ "SimpleComponentExplicitHome.cdp",
+ "SimpleComponentUnhomed.cdp",
+ "SimpleHome.cdp",
+ "SimpleProcessColocation.cdp",
+ "SimpleProcessColocation_2.cdp",
+ "SimpleProcessColocation_Default.cdp",
+ "SimplexConnectionExplicitHome.cdp",
+ "TwoComponentsOneHome.cdp")
+}
+else {
+ @files = @ARGV;
+}
+
+create_targets ();
+init_ior_files ();
+
+foreach $file (@files) {
+ print "Starting test for deployment $file\n";
+
+ print STDERR "Starting Naming Service\n";
+
+ $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", "-m 0 -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile");
+ $NS->Spawn ();
+
+ 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 daemons\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ $daemons_running = 1;
+
+ print "Converting plan to CDR representation\n";
+ $cdr_planbase = "$file" . ".cdr";
+ $cdr_plan = $tg_convert_plan->LocalFile ($cdr_planbase);
+ $convert = $tg_convert_plan->CreateProcess("$DANCE_ROOT/bin/dance_convert_plan",
+ "-x $file -o $cdr_plan");
+
+ $convert->Spawn ();
+
+ if ($tg_convert_plan->WaitForFileTimed ($cdr_planbase,
+ 30) == -1) {
+ print STDERR "ERROR: Convert Plan failed to output $cdr_plan.\n";
+ kill_open_processes ();
+ next;
+ }
+
+ $convert->Kill ();
+
+ # Invoke executor - start the application -.
+ print "Invoking executor - launch the application -\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-c $file.cdr -n file://NodeApp1.ior -l -oNode");
+ $E->SpawnWaitKill (120);
+
+ print "Teardown the application\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-n file://NodeApp1.ior -a file://Node_APP.ior -m file://Node_AM.ior -s");
+ $E->SpawnWaitKill (120);
+ print "Executor finished.\n";
+
+ $tg_convert_plan->DeleteFile ($cdr_planbase);
+
+ delete_ior_files ();
+ kill_open_processes ();
+
+ # Sleep for a couple seconds to make sure everything has a chance to shut down.
+ sleep 5;
+}
+
+delete_ior_files ();
+kill_open_processes ();
+
+exit $status;
diff --git a/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_noevent.pl b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_noevent.pl
new file mode 100755
index 00000000000..959dc06fa08
--- /dev/null
+++ b/CIAO/tests/DAnCE/NodeManager-Deployments/run_test_noevent.pl
@@ -0,0 +1,222 @@
+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'}";
+
+$ENV{'CIAO_LOG_LEVEL'}=1;
+
+$daemons_running = 0;
+$em_running = 0;
+$ns_running = 0;
+
+$nr_daemon = 1;
+@ports = ( 60001 );
+@iorbases = ( "NodeApp1.ior" );
+@iorfiles = 0;
+@nodenames = ( "NodeOne" );
+
+# ior files other than daemon
+$ior_nsbase = "ns.ior";
+$ior_nsfile = 0;
+$ior_embase = "EM.ior";
+$ior_emfile = 0;
+$ior_applicationbase = "Node_APP.ior";
+$ior_application = 0;
+$ior_ambase = "Node_AM.ior";
+$ior_am = 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;
+
+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 ('../Components');
+ }
+ # 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]);
+ }
+ $ior_application = $tg_executor->LocalFile ($ior_applicationbase);
+ $ior_am = $tg_executor->LocalFile ($ior_ambase);
+ 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]);
+ }
+
+ $tg_executor->DeleteFile ($ior_applicationbase);
+ $tg_executor->DeleteFile ($ior_ambase);
+}
+
+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 --instance-nc corbaloc:rir:/NameService";
+
+ print "Run node daemon\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;
+}
+#only run the tests with noevent
+if ($#ARGV == -1) {
+ @files = (
+ "LocalSimplexConnectionExplicitHome.cdp",
+ "MultiplexConnectionExplicitHome.cdp",
+ "SimpleAttributeExplicitHome.cdp",
+ "SimpleComponentExplicitHome.cdp",
+ "SimpleComponentUnhomed.cdp",
+ "SimpleHome.cdp",
+ "SimpleProcessColocation.cdp",
+ "SimpleProcessColocation_2.cdp",
+ "SimpleProcessColocation_Default.cdp",
+ "SimplexConnectionExplicitHome.cdp",
+ "TwoComponentsOneHome.cdp")
+}
+else {
+ @files = @ARGV;
+}
+
+
+create_targets ();
+init_ior_files ();
+
+foreach $file (@files) {
+ print "Starting test for deployment $file\n";
+
+ print STDERR "Starting Naming Service\n";
+
+ $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", "-m 0 -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile");
+ $NS->Spawn ();
+
+ 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 daemons\n";
+ kill_open_processes ();
+ exit 1;
+ }
+
+ $daemons_running = 1;
+
+ # Invoke executor - start the application -.
+ print "Invoking executor - launch the application -\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-x $file -n file://NodeApp1.ior -l -oNode");
+ $E->SpawnWaitKill (120);
+
+ print "Teardown the application\n";
+ $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
+ "-n file://NodeApp1.ior -a file://$ior_application -m file://$ior_am -s");
+ $E->SpawnWaitKill (120);
+ print "Executor finished.\n";
+
+ delete_ior_files ();
+ kill_open_processes ();
+
+ # Sleep for a couple seconds to make sure everything has a chance to shut down.
+ sleep 5;
+}
+
+delete_ior_files ();
+kill_open_processes ();
+
+exit $status;