diff options
Diffstat (limited to 'CIAO/connectors/ami4ccm/tests/InterMulti/descriptors/run_test.pl')
-rwxr-xr-x | CIAO/connectors/ami4ccm/tests/InterMulti/descriptors/run_test.pl | 166 |
1 files changed, 91 insertions, 75 deletions
diff --git a/CIAO/connectors/ami4ccm/tests/InterMulti/descriptors/run_test.pl b/CIAO/connectors/ami4ccm/tests/InterMulti/descriptors/run_test.pl index 2a8c52c0780..4708970fa5a 100755 --- a/CIAO/connectors/ami4ccm/tests/InterMulti/descriptors/run_test.pl +++ b/CIAO/connectors/ami4ccm/tests/InterMulti/descriptors/run_test.pl @@ -135,106 +135,122 @@ sub run_node_daemons { create_targets (); init_ior_files (); +if ($#ARGV == -1) { + opendir(DIR, "."); + @files = grep(/\.cdp$/,readdir(DIR)); + closedir(DIR); +} +else { + @files = @ARGV; +} -# Invoke naming service +foreach $file (@files) { + print "=============================\nStarting test for deployment $file\n================================\n"; -$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile"); + # Invoke naming service -print STDERR "Starting Naming Service with -ORBEndpoint iiop://localhost:60003 -o ns.ior\n"; + $NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile"); -$ns_status = $NS->Spawn (); + print STDERR "Starting Naming Service with -ORBEndpoint iiop://localhost:60003 -o ns.ior\n"; -if ($ns_status != 0) { - print STDERR "ERROR: Unable to execute the naming service\n"; - kill_open_processes (); - exit 1; -} + $ns_status = $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; -} + if ($ns_status != 0) { + print STDERR "ERROR: Unable to execute the naming service\n"; + kill_open_processes (); + exit 1; + } -$ns_running = 1; -# Set up NamingService environment -$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + 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; + } -# Invoke node daemon. -print "Invoking node daemon\n"; -$status = run_node_daemons (); + $ns_running = 1; + # Set up NamingService environment + $ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; -if ($status != 0) { - print STDERR "ERROR: Unable to execute the node daemon\n"; - kill_open_processes (); - exit 1; -} + # Invoke node daemon. + print "Invoking node daemon\n"; + $status = run_node_daemons (); -$daemons_running = 1; + if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemon\n"; + kill_open_processes (); + exit 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 (); + $daemons_running = 1; -if ($em_status != 0) { - print STDERR "ERROR: dance_execution_manager returned $em_status"; - exit 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 ($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; -} + if ($em_status != 0) { + print STDERR "ERROR: dance_execution_manager returned $em_status"; + exit 1; + } -$em_running = 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; + } -# Invoke executor - start the application -. -print "Invoking executor - launch the application -\n"; + $em_running = 1; -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"); + # Invoke executor - start the application -. + print "Invoking executor - launch the application -\n"; -$pl_status = $E->SpawnWaitKill (3 * $tg_executor->ProcessStartWaitInterval ()); + print "Start dance_plan_launcher.exe with -x $file -k file://$ior_emfile\n"; + $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-x $file -k file://$ior_emfile"); -if ($pl_status != 0) { - print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; - kill_open_processes (); - exit 1; -} + $pl_status = $E->SpawnWaitKill (3 * $tg_executor->ProcessStartWaitInterval ()); -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; - } -} + if ($pl_status != 0) { + print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + kill_open_processes (); + exit 1; + } -print "Sleeping 30 seconds to allow task to complete\n"; -sleep (30); + 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; + } + } -# 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"; + print "Sleeping 30 seconds to allow task to complete\n"; + sleep (30); -$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 ()); + # 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 $file\n"; -if ($pl_status != 0) { - print STDERR "ERROR: dance_plan_launcher returned $pl_status\n"; + $E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher", + "-k file://$ior_emfile -x $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; + } + + delete_ior_files (); kill_open_processes (); - exit 1; + # Sleep for a couple seconds to make sure everything has a chance to shut down. + sleep 5; } - print "Executor returned.\n"; print "Shutting down rest of the processes.\n"; |