diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-05 03:23:49 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-05 03:23:49 +0000 |
commit | 84fe5584b4e402d9c75973163ebd441032497744 (patch) | |
tree | 8bb327569be3f54d7ca99ad830c1c991170ea28d /TAO/orbsvcs | |
parent | d39fec54c8f8f970b913d8fcc5d219532dc21cae (diff) | |
download | ATCD-84fe5584b4e402d9c75973163ebd441032497744.tar.gz |
ChangeLogTag:Sun Mar 4 19:12:59 2001 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'TAO/orbsvcs')
38 files changed, 1433 insertions, 1539 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl index 87e30116dca..9c507bb244c 100755 --- a/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl @@ -5,83 +5,64 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; # amount of delay between running the servers $sleeptime = 6; $status = 0; -$cwd = getcwd(); -local $nsior = "$cwd$DIR_SEPARATOR" . "ns.ior"; - -ACE::checkForTarget($cwd); - -$name_server_prog = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."Naming_Service".$DIR_SEPARATOR."Naming_Service".$EXE_EXT; -$full_profile_server= $EXEPREFIX.".".$DIR_SEPARATOR."server".$EXE_EXT; -$full_profile_ftp = $EXEPREFIX.".".$DIR_SEPARATOR."ftp".$EXE_EXT; - -# variables for parameters - -sub name_server -{ - my $args = "-o $nsior"; - print ("\n$name_server_prog $args\n"); - unlink $nsior; - $NS = Process::Create ($name_server_prog, $args); - if (ACE::waitforfile_timed ($nsior, 8) == -1) { - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } -} +$nsior = PerlACE::LocalFile ("ns.ior"); +$testfile = PerlACE::LocalFile ("test"); +$makefile = PerlACE::LocalFile ("Makefile"); -sub server -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f test"; - print ("\nFull_Profile Server: $args\n"); - $SV = Process::Create ($full_profile_server, $args); -} +unlink $nsior; + +$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior"); +$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $testfile"); +$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f $makefile"); +print STDERR "Starting Naming Service\n"; -sub ftp -{ - my $args = "-ORBInitRef NameService=file://$nsior"." -f Makefile"; - print ("\nFull_Profile Ftp: $args\n"); - $CL = Process::Create ($full_profile_ftp, $args); +$NS->Spawn (); + +if (PerlACE::waitforfile_timed ($nsior, 5) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; } -name_server (); +print STDERR "Starting Server\n"; -server (); +$SV->Spawn (); sleep $sleeptime; -ftp (); +print STDERR "Starting Client\n"; +$client = $CL->SpawnWaitKill (60); -if ($CL->TimedWait (100) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } -$SV->Terminate (); if ($SV->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SV->Kill (); $SV->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; } +$nserver = $NS->TerminateWaitKill (5); -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +if ($nserver != 0) { + print STDERR "ERROR: Naming Service returned $nserver\n"; + $status = 1; } +unlink $nsior; +unlink $testfile; exit $status; diff --git a/TAO/orbsvcs/tests/AVStreams/Latency/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Latency/run_test.pl index afc34738296..c98f2d1ab38 100755 --- a/TAO/orbsvcs/tests/AVStreams/Latency/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Latency/run_test.pl @@ -5,71 +5,65 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; # amount of delay between running the servers -$sleeptime = 6; $status = 0; -$cwd = getcwd(); -ACE::checkForTarget($cwd); +$pingior = PerlACE::LocalFile ("ping.ior"); +$pongior = PerlACE::LocalFile ("pong.ior"); -$latency_ping= $EXEPREFIX.".".$DIR_SEPARATOR."ping".$EXE_EXT; -$latency_pong = $EXEPREFIX.".".$DIR_SEPARATOR."pong".$EXE_EXT; -$latency_control = $EXEPREFIX.".".$DIR_SEPARATOR."control".$EXE_EXT; +unlink $pingior, $pongior; +$PING = new PerlACE::Process ("ping", "-o $pingior"); +$PONG = new PerlACE::Process ("pong", "-o $pongior"); +$CTRL = new PerlACE::Process ("control", "-f file://$pingior -g file://$pongior"); -# variables for parameters - -sub ping -{ - my $args = " -o ping_ior"; - print ("\nPing: $args\n"); - $SV = Process::Create ($latency_ping, $args); -} +print STDERR "Starting Ping\n"; +$PING->Spawn (); -sub pong -{ - my $args = " -o pong_ior"; - print ("\nPong: $args\n"); - $CL = Process::Create ($latency_pong, $args); -} +if (PerlACE::waitforfile_timed ($pingior, 20) == -1) { + print STDERR "ERROR: cannot find file <$pingior>\n"; + $PING->Kill (); + exit 1; +} +print STDERR "Starting Pong\n"; -sub control -{ - my $args = " -f file://ping_ior -g file://pong_ior"; - print ("\nControl: $args\n"); - $CO = Process::Create ($latency_control, $args); +$PONG->Spawn (); +if (PerlACE::waitforfile_timed ($pongior, 20) == -1) { + print STDERR "ERROR: cannot find file <$pongior>\n"; + $PING->Kill (); + $PONG->Kill (); + exit 1; } -ping (); +print STDERR "Starting Control\n"; -sleep $sleeptime; +$control = $CTRL->SpawnWaitKill (200); -pong (); +if ($control != 0) { + print STDERR "ERROR: control returned $control\n"; + $status = 1; +} -sleep $sleeptime; +$pi = $PING->TerminateWaitKill (5); -control (); +if ($pi != 0) { + print STDERR "ERROR: ping returned $pi\n"; + $status = 1; +} +$po = $PONG->TerminateWaitKill (5); -if ($CL->TimedWait (200) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); +if ($po != 0) { + print STDERR "ERROR: pong returned $po\n"; + $status = 1; } -$SV->Terminate (); if ($SV->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SV->Kill (); $SV->TimedWait (1); - $CO->Kill (); $CO->TimedWait (1); - exit 1; -} +unlink $pingior, $pongior; exit $status; diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl index 5b68b857dfa..c168a476ea7 100755 --- a/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl @@ -5,98 +5,78 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; # amount of delay between running the servers $sleeptime = 6; $status = 0; -$cwd = getcwd(); -local $nsior = "$cwd$DIR_SEPARATOR" . "ns.ior"; -ACE::checkForTarget($cwd); +$nsior = PerlACE::LocalFile ("ns.ior"); +$test1 = PerlACE::LocalFile ("test1"); +$test2 = PerlACE::LocalFile ("test2"); +$makefile = PerlACE::LocalFile ("Makefile"); -$name_server_prog = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."Naming_Service".$DIR_SEPARATOR."Naming_Service".$EXE_EXT; -$multicast_server= $EXEPREFIX.".".$DIR_SEPARATOR."server".$EXE_EXT; -$multicast_ftp= $EXEPREFIX.".".$DIR_SEPARATOR."ftp".$EXE_EXT; +unlink $nsior, $test1, $test2; +$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior"); +$SV1 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test1"); +$SV2 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test2"); +$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f $makefile"); -# variables for parameters +print STDERR "Starting Naming Service\n"; -sub name_server -{ - my $args = "-o $nsior"; - print ("\n$name_server_prog $args\n"); - unlink $nsior; - $NS = Process::Create ($name_server_prog, $args); - if (ACE::waitforfile_timed ($nsior, 8) == -1) { - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } -} - -sub server1 -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f test"; - print ("\nPluggable Server: $args\n"); - $SVA = Process::Create ($multicast_server, $args); -} - -sub server2 -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f test1"; - print ("\nPluggable Server: $args\n"); - $SVB = Process::Create ($multicast_server, $args); -} +$NS->Spawn (); -sub ftp -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f Makefile"; - print ("\nPluggable Ftp: $args\n"); - $CL = Process::Create ($multicast_ftp, $args); +if (PerlACE::waitforfile_timed ($nsior, 5) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; } -name_server (); +print STDERR "Starting Server 1\n"; -server1 (); +$SV1->Spawn (); sleep $sleeptime; -server2 (); +print STDERR "Starting Server 2\n"; + +$SV2->Spawn (); sleep $sleeptime; -ftp (); +print STDERR "Starting Client\n"; + +$client = $CL->SpawnWaitKill (60); -if ($CL->TimedWait (300) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } +$server = $SV1->TerminateWaitKill (5); -$SVA->Terminate (); if ($SVA->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SVA->Kill (); $SVA->TimedWait (1); - exit 1; +if ($server != 0) { + print STDERR "ERROR: server 1 returned $server\n"; + $status = 1; } -$SVB->Terminate (); if ($SVB->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SVB->Kill (); $SVB->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$server = $SV2->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server 2 returned $server\n"; + $status = 1; } -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$nserver = $NS->TerminateWaitKill (5); + +if ($nserver != 0) { + print STDERR "ERROR: Naming Service returned $nserver\n"; + $status = 1; } +unlink $nsior, $test1, $test2; exit $status; diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl index 0d0d07ffd99..c168a476ea7 100755 --- a/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl @@ -5,97 +5,78 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; # amount of delay between running the servers $sleeptime = 6; $status = 0; -$cwd = getcwd(); -local $nsior = "$cwd$DIR_SEPARATOR" . "ns.ior"; -ACE::checkForTarget($cwd); +$nsior = PerlACE::LocalFile ("ns.ior"); +$test1 = PerlACE::LocalFile ("test1"); +$test2 = PerlACE::LocalFile ("test2"); +$makefile = PerlACE::LocalFile ("Makefile"); -$name_server_prog = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."Naming_Service".$DIR_SEPARATOR."Naming_Service".$EXE_EXT; -$multicast_full_profile_server= $EXEPREFIX.".".$DIR_SEPARATOR."server".$EXE_EXT; -$multicast_full_profile_ftp= $EXEPREFIX.".".$DIR_SEPARATOR."ftp".$EXE_EXT; +unlink $nsior, $test1, $test2; +$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior"); +$SV1 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test1"); +$SV2 = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $test2"); +$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f $makefile"); -# variables for parameters +print STDERR "Starting Naming Service\n"; -sub name_server -{ - my $args = "-o $nsior"; - print ("\n$name_server_prog $args\n"); - unlink $nsior; - $NS = Process::Create ($name_server_prog, $args); - if (ACE::waitforfile_timed ($nsior, 8) == -1) { - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } -} - -sub server1 -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f test"; - print ("\nPluggable Server: $args\n"); - $SVA = Process::Create ($multicast_full_profile_server, $args); -} - -sub server2 -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f test1"; - print ("\nPluggable Server: $args\n"); - $SVB = Process::Create ($multicast_full_profile_server, $args); -} +$NS->Spawn (); -sub ftp -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f Makefile"; - print ("\nPluggable Ftp: $args\n"); - $CL = Process::Create ($multicast_full_profile_ftp, $args); +if (PerlACE::waitforfile_timed ($nsior, 5) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; } -name_server (); +print STDERR "Starting Server 1\n"; -server1 (); +$SV1->Spawn (); sleep $sleeptime; -server2 (); +print STDERR "Starting Server 2\n"; + +$SV2->Spawn (); sleep $sleeptime; -ftp (); +print STDERR "Starting Client\n"; + +$client = $CL->SpawnWaitKill (60); -if ($CL->TimedWait (100) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } -$SVA->Terminate (); if ($SVA->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SVA->Kill (); $SVA->TimedWait (1); - exit 1; +$server = $SV1->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server 1 returned $server\n"; + $status = 1; } -$SVB->Terminate (); if ($SVB->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SVB->Kill (); $SVB->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$server = $SV2->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server 2 returned $server\n"; + $status = 1; } -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$nserver = $NS->TerminateWaitKill (5); + +if ($nserver != 0) { + print STDERR "ERROR: Naming Service returned $nserver\n"; + $status = 1; } +unlink $nsior, $test1, $test2; exit $status; diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl index b50e3999f27..9c507bb244c 100755 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl @@ -5,83 +5,64 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; # amount of delay between running the servers $sleeptime = 6; $status = 0; -$cwd = getcwd(); -local $nsior = "$cwd$DIR_SEPARATOR" . "ns.ior"; -ACE::checkForTarget($cwd); +$nsior = PerlACE::LocalFile ("ns.ior"); +$testfile = PerlACE::LocalFile ("test"); +$makefile = PerlACE::LocalFile ("Makefile"); -$name_server_prog = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."Naming_Service".$DIR_SEPARATOR."Naming_Service".$EXE_EXT; -$pluggable_server= $EXEPREFIX.".".$DIR_SEPARATOR."server".$EXE_EXT; -$pluggable_ftp = $EXEPREFIX.".".$DIR_SEPARATOR."ftp".$EXE_EXT; +unlink $nsior; +$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior"); +$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior -f $testfile"); +$CL = new PerlACE::Process ("ftp", "-ORBInitRef NameService=file://$nsior -f $makefile"); -# variables for parameters - -sub name_server -{ - my $args = "-o $nsior"; - print ("\n$name_server_prog $args\n"); - unlink $nsior; - $NS = Process::Create ($name_server_prog, $args); - if (ACE::waitforfile_timed ($nsior, 8) == -1) { - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } -} - -sub server -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f test"; - print ("\nPluggable Server: $args\n"); - $SV = Process::Create ($pluggable_server, $args); -} +print STDERR "Starting Naming Service\n"; +$NS->Spawn (); -sub ftp -{ - my $args = " -ORBInitRef NameService=file://$nsior"." -f Makefile"; - print ("\nPluggable Ftp: $args\n"); - $CL = Process::Create ($pluggable_ftp, $args); +if (PerlACE::waitforfile_timed ($nsior, 5) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; } -name_server (); +print STDERR "Starting Server\n"; -server (); +$SV->Spawn (); sleep $sleeptime; -ftp (); +print STDERR "Starting Client\n"; -if ($CL->TimedWait (60) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); -} +$client = $CL->SpawnWaitKill (60); -$SV->Terminate (); if ($SV->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SV->Kill (); $SV->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} +$nserver = $NS->TerminateWaitKill (5); -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +if ($nserver != 0) { + print STDERR "ERROR: Naming Service returned $nserver\n"; + $status = 1; } +unlink $nsior; +unlink $testfile; exit $status; diff --git a/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl b/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl index aa256319e5f..16d49a6d962 100755 --- a/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl @@ -5,80 +5,61 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; # amount of delay between running the servers $sleeptime = 6; $status = 0; -$cwd = getcwd(); -local $nsior = "$cwd$DIR_SEPARATOR" . "ns.ior"; -ACE::checkForTarget($cwd); +$nsior = PerlACE::LocalFile ("ns.ior"); -$name_server_prog = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR."Naming_Service".$DIR_SEPARATOR."Naming_Service".$EXE_EXT; -$server_prog = $EXEPREFIX.".".$DIR_SEPARATOR."server".$EXE_EXT; -$client_prog = $EXEPREFIX.".".$DIR_SEPARATOR."client".$EXE_EXT; +unlink $nsior; +$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior"); +$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior"); +$CL = new PerlACE::Process ("client", "-ORBInitRef NameService=file://$nsior"); -# variables for parameters - -sub name_server -{ - my $args = "-o $nsior"; - print ("\n$name_server_prog $args\n"); - $NS = Process::Create ($name_server_prog, $args); - if (ACE::waitforfile_timed ($nsior, 5) == -1) { - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } -} - - -sub server -{ - my $args = "-ORBInitRef NameService=file://$nsior"; - print ("\nServer: $args\n"); - $SV = Process::Create ($server_prog, $args); -} +print STDERR "Starting Naming Service\n"; +$NS->Spawn (); -sub client -{ - my $args = "-ORBInitRef NameService=file://$nsior"; - print ("\nclient: $args\n"); - $CL = Process::Create ($client_prog, $args); +if (PerlACE::waitforfile_timed ($nsior, 5) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; } -name_server (); +print STDERR "Starting Server\n"; -server (); +$SV->Spawn (); sleep $sleeptime; -client (); +print STDERR "Starting Client\n"; -if ($CL->TimedWait (60) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); +$client = $CL->SpawnWaitKill (60); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } -$SV->Terminate (); if ($SV->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SV->Kill (); $SV->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; } -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$nserver = $NS->TerminateWaitKill (5); + +if ($nserver != 0) { + print STDERR "ERROR: Naming Service returned $nserver\n"; + $status = 1; } +unlink $nsior; + exit $status; diff --git a/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl b/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl index 5f283075222..2f5ff8af44c 100755 --- a/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl +++ b/TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl @@ -8,64 +8,53 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a Perl script that runs the client and all the other servers that # are needed -unshift @INC, '../../../../../bin'; -require ACEutils; -require Process; -require Uniqueid; -use Cwd; - -$cwd = getcwd(); -ACE::checkForTarget($cwd); +use lib '../../../../../bin'; +use PerlACE::Run_Test; $status = 0; -print STDERR "\n\nShutdown EC with clients still attached\n"; -$T = Process::Create ($EXEPREFIX . "Shutdown".$EXE_EXT); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +$svc_pull_conf = PerlACE::LocalFile ("svc.pull.conf"); -print STDERR "\n\nDisconnect callbacks test\n"; -$T = Process::Create ($EXEPREFIX . "Disconnect".$EXE_EXT); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +sub RunTest ($$$) +{ + my $message = shift; + my $program = shift; + my $arguments = shift; -print STDERR "\n\nMT Disconnects test\n"; -$T = Process::Create ($EXEPREFIX . "MT_Disconnect".$EXE_EXT); -if ($T->TimedWait (240) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} + my $TEST = new PerlACE::Process ($program, $arguments); -print STDERR "\n\nPush Events\n"; -$T = Process::Create ($EXEPREFIX . "Push_Event".$EXE_EXT); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} + print STDERR "\n\n$message\n"; + + my $test = $TEST->SpawnWaitKill (240); -print STDERR "\n\nPull-Push Events\n"; -$T = Process::Create ($EXEPREFIX . "Pull_Push_Event".$EXE_EXT, - " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.pull.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); + if ($test != 0) { + print STDERR "ERROR: Test returned $test\n"; + $status = 1; + } } -print STDERR "\n\nRandom\n"; -$T = Process::Create ($EXEPREFIX . "Random".$EXE_EXT); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("\n\nShutdown EC with clients still attached\n", + "Shutdown", + ""); + +RunTest ("\n\nDisconnect callbacks test\n", + "Disconnect", + ""); + +RunTest ("\n\nMT Disconnects test\n", + "MT_Disconnect", + ""); + +RunTest ("\n\nPush Events\n", + "Push_Event", + ""); + +RunTest ("\n\nPull-Push Events\n", + "Pull_Push_Event", + "-ORBSvcConf $svc_pull_conf"); + +RunTest ("\n\nRandom\n", + "Random", + ""); exit $status; diff --git a/TAO/orbsvcs/tests/EC_Basic/EC_Basic.dsp b/TAO/orbsvcs/tests/EC_Basic/EC_Basic.dsp index 54bb00d62e2..233a44619a1 100644 --- a/TAO/orbsvcs/tests/EC_Basic/EC_Basic.dsp +++ b/TAO/orbsvcs/tests/EC_Basic/EC_Basic.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
diff --git a/TAO/orbsvcs/tests/EC_Basic/run_test.pl b/TAO/orbsvcs/tests/EC_Basic/run_test.pl index 57fe34b5352..c51f890d4fc 100755 --- a/TAO/orbsvcs/tests/EC_Basic/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Basic/run_test.pl @@ -5,22 +5,16 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require ACEutils; -require Process; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$status = 0; +$T = new PerlACE::Process ("EC_Basic"); -ACE::checkForTarget(getcwd()); +$test = $T->SpawnWaitKill (60); -$TEST = Process::Create ($EXEPREFIX."EC_Basic".$EXE_EXT, ""); - -if ($TEST->TimedWait (60) == -1) { - print STDERR "ERROR: test timedout\n"; - $status = 1; - $TEST->Kill (); $TEST->TimedWait (1); +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + exit 1; } -# @@ Capture any errors from the server too. -exit $status; +exit 0; diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Consumer.dsp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Consumer.dsp index 9b9968b742a..9db095948d9 100644 --- a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Consumer.dsp +++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Consumer.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
@@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib /nologo /subsystem:console /machine:I386 /out:"ECM_Consumer.exe" /libpath:"..\..\orbsvcs" /libpath:"..\..\..\tao" /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\..\ace"
+# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib /nologo /subsystem:console /machine:I386 /out:"Release/ECM_Consumer.exe" /libpath:"..\..\orbsvcs" /libpath:"..\..\..\tao" /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\..\ace"
!ELSEIF "$(CFG)" == "ECCM_Consumer - Win32 Debug"
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Supplier.dsp b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Supplier.dsp index 8de39935bcd..61fefe6eed5 100644 --- a/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Supplier.dsp +++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/ECCM_Supplier.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
@@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib /nologo /subsystem:console /machine:I386 /out:"ECM_Supplier.exe" /libpath:"..\..\orbsvcs" /libpath:"..\..\..\tao" /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\..\ace"
+# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib TAO_CosNaming.lib TAO_RTEvent.lib TAO_RTSched.lib TAO_Svc_Utils.lib /nologo /subsystem:console /machine:I386 /out:"Release/ECM_Supplier.exe" /libpath:"..\..\orbsvcs" /libpath:"..\..\..\tao" /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\..\ace"
!ELSEIF "$(CFG)" == "ECCM_Supplier - Win32 Debug"
diff --git a/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl b/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl index 5f78d78fb71..e86186b36e8 100755 --- a/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl @@ -5,69 +5,70 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require ACEutils; -require Process; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$port = ACE::uniqueid () + 10001; # This can't be 10000 on Chorus 4.0 -$cwd = getcwd(); -ACE::checkForTarget($cwd); +$port = PerlACE::uniqueid () + 10001; # This can't be 10000 on Chorus 4.0 -$NS_ior = "$cwd$DIR_SEPARATOR" . "NameService.ior"; +$NS_ior = PerlACE::LocalFile ("NameService.ior"); $sleeptime = 5; $status = 0; -$NS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR. - "Naming_Service".$DIR_SEPARATOR. - "Naming_Service".$EXE_EXT, - "-ORBNameServicePort $port -o $NS_ior "); - -if (ACE::waitforfile_timed ($NS_ior, 5) == -1) { - print STDERR "ERROR: waiting for naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", + "-ORBNameServicePort $port -o $NS_ior"); +$ES = new PerlACE::Process ("../../Event_Service/Event_Service", + "-ORBInitRef NameService=file://$NS_ior -t new"); +$C = new PerlACE::Process ("ECM_Consumer", + "-ORBInitRef NameService=file://$NS_ior"); +$S = new PerlACE::Process ("ECM_Supplier", + "-ORBInitRef NameService=file://$NS_ior"); + +$NS->Spawn (); + +if (PerlACE::waitforfile_timed ($NS_ior, 5) == -1) { + print STDERR "ERROR: waiting for naming service IOR file\n"; + $NS->Kill (); + exit 1; } -$ES = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR. - "Event_Service".$DIR_SEPARATOR. - "Event_Service".$EXE_EXT, - "-ORBInitRef NameService=file://$NS_ior -t new"); +$ES->Spawn (); sleep $sleeptime; -$C = Process::Create ($EXEPREFIX."ECM_Consumer".$EXE_EXT, - "-ORBInitRef NameService=file://$NS_ior"); +$C->Spawn (); sleep $sleeptime; -$S = Process::Create ($EXEPREFIX."ECM_Supplier".$EXE_EXT, - "-ORBInitRef NameService=file://$NS_ior"); +$S->Spawn (); + +$consumer = $C->WaitKill (60); -if ($C->TimedWait (60) == -1) { - $status = 1; - print STDERR "ERROR: consumer timedout\n"; - $C->Kill (); $C->TimedWait (1); +if ($consumer != 0) { + print STDERR "ERROR: consumer returned $consumer\n"; + $status = 1; } -if ($S->TimedWait (60) == -1) { - $status =1; - print STDERR "ERROR: supplier timedout\n"; - $S->Kill (); $S->TimedWait (1); +$supplier = $S->WaitKill (60); + +if ($supplier == -1) { + print STDERR "ERROR: supplier returned $supplier\n"; + $status = 1; } -$NS->Terminate(); -$ES->Terminate(); -if ($NS->TimedWait (5) == -1 || $ES->TimedWait (5) == -1) { - print STDERR "ERROR: couldn't terminate the services nicely\n"; - $NS->Kill (); $NS->TimedWait (1); - $ES->Kill (); $ES->TimedWait (1); - $status = 1; +$nserver = $NS->TerminateWaitKill (5); + +if ($nserver != 0) { + print STDERR "ERROR: nameserver returned $nserver\n"; + $status = 1; +} + +$eserver = $ES->TerminateWaitKill (5); + +if ($eserver != 0) { + print STDERR "ERROR: eventserver returned $eserver\n"; + $status = 1; } unlink $NS_ior; -# @@ Capture the errors from the processes. exit $status; diff --git a/TAO/orbsvcs/tests/EC_Mcast/run_test.pl b/TAO/orbsvcs/tests/EC_Mcast/run_test.pl index 9af67926b84..443a19d3e24 100755 --- a/TAO/orbsvcs/tests/EC_Mcast/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Mcast/run_test.pl @@ -5,34 +5,37 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require ACEutils; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -ACE::checkForTarget($cwd); +$status = 0; + +$sample_cfg = PerlACE::LocalFile ("sample.cfg"); +$svc_conf = PerlACE::LocalFile ("svc.conf"); # Run two copies of the same test... -$T1 = Process::Create ($EXEPREFIX."EC_Mcast".$EXE_EXT, - " -c $cwd$DIR_SEPARATOR" . - "sample.cfg -ORBSvcConf $cwd$DIR_SEPARATOR" . - "svc.conf -n 100 -t 50000 -f Set02"); -$T2 = Process::Create ($EXEPREFIX."EC_Mcast".$EXE_EXT, - " -c $cwd$DIR_SEPARATOR" . - "sample.cfg -ORBSvcConf $cwd$DIR_SEPARATOR" . - "svc.conf -n 100 -t 50000 -f Set02"); - -if ($T1->TimedWait (60) == -1) { - print STDERR "ERROR: test1 timedout\n"; - $T1->Kill (); $T1->TimedWait (1); - $T2->Kill (); $T2->TimedWait (1); - exit 1; +$T1 = new PerlACE::Process ("EC_Mcast", + "-c $sample_cfg -ORBSvcConf $svc_conf " + . "-n 100 -t 50000 -f Set02"); +$T2 = new PerlACE::Process ("EC_Mcast", + "-c $sample_cfg -ORBSvcConf $svc_conf " + . "-n 100 -t 50000 -f Set02"); + +$T1->Spawn (); +$T2->Spawn (); + +$test1 = $T1->WaitKill (60); + +if ($test1 != 0) { + print STDERR "ERROR: test 1 returned $test1\n"; + $status = 1; } -if ($T2->TimedWait (60) == -1) { - print STDERR "ERROR: test2 timedout\n"; - $T2->Kill (); $T2->TimedWait (1); - exit 1; +$test2 = $T2->WaitKill (60); + +if ($test2 != 0) { + print STDERR "ERROR: test 2 returned $test2\n"; + $status = 1; } -exit 0; +exit $status; diff --git a/TAO/orbsvcs/tests/EC_Multiple/run_test.pl b/TAO/orbsvcs/tests/EC_Multiple/run_test.pl index 1aef14e8855..704b47511d2 100755 --- a/TAO/orbsvcs/tests/EC_Multiple/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Multiple/run_test.pl @@ -5,42 +5,40 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -$NS_ior = "$cwd$DIR_SEPARATOR" . "NameService.ior"; $status = 0; -ACE::checkForTarget($cwd); - -$NS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR. - "Naming_Service".$DIR_SEPARATOR. - "Naming_Service".$EXE_EXT, - " -o $NS_ior "); -if (ACE::waitforfile_timed ($NS_ior, 5) == -1) { - print STDERR "ERROR: waiting for naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$NS_ior = PerlACE::LocalFile ("NameService.ior"); + +$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o $NS_ior"); +$T = new PerlACE::Process ("EC_Multiple", + "-ORBInitRef NameService=file://$NS_ior" + ." -s local"); + +$NS->Spawn (); + +if (PerlACE::waitforfile_timed ($NS_ior, 5) == -1) { + print STDERR "ERROR: waiting for naming service IOR file\n"; + $NS->Kill (); + exit 1; } # This is a very simple test, no multiple consumers and no gateways. -$TEST = Process::Create ($EXEPREFIX."EC_Multiple".$EXE_EXT, - "-ORBInitRef NameService=file://$NS_ior" - ." -s local"); -if ($TEST->TimedWait (60) == -1) { - print STDERR "ERROR: test timedout\n"; - $status = 1; - $TEST->Kill (); $TEST->TimedWait (1); +$test = $T->SpawnWaitKill (60); + + +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + $status = 1; } -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$nserver = $NS->TerminateWaitKill (5); + +if ($nserver != 0) { + print STDERR "ERROR: naming service returned $nserver\n"; + $status = 1; } exit $status; diff --git a/TAO/orbsvcs/tests/EC_Throughput/run_test.pl b/TAO/orbsvcs/tests/EC_Throughput/run_test.pl index f95c59d72d4..ac539e0c499 100755 --- a/TAO/orbsvcs/tests/EC_Throughput/run_test.pl +++ b/TAO/orbsvcs/tests/EC_Throughput/run_test.pl @@ -5,103 +5,106 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -ACE::checkForTarget($cwd); +$status = 0; + +$ec_conf = PerlACE::LocalFile ("ec.conf"); +$ec_mt_conf = PerlACE::LocalFile ("ec_mt_conf"); print STDERR "================ Collocated tests, single threaded\n"; -$T = Process::Create ($EXEPREFIX."ECT_Throughput".$EXE_EXT, - " -ORBsvcconf $cwd$DIR_SEPARATOR" . "ec.conf" . - " -m new -u 10000 -n 1 -t 0 -c 4"); +$T = new PerlACE::Process ("ECT_Throughput", + "-ORBsvcconf $ec_conf" + . " -m new -u 10000 -n 1 -t 0 -c 4"); + + +$test = $T->SpawnWaitKill (120); -if ($T->TimedWait (120) == -1) { - print STDERR "ERROR: test timedout\n"; - $T->Kill (); $T->TimedWait (1); - exit 1; +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + $status = 1; } print STDERR "================ Collocated tests, single threaded\n"; -$T = Process::Create ($EXEPREFIX."ECT_Throughput".$EXE_EXT, - " -ORBsvcconf $cwd$DIR_SEPARATOR" . "ec.mt.conf" . - " -m new -u 10000 -n 1 -t 0 -c 4"); +$T = new PerlACE::Process ("ECT_Throughput", + "-ORBsvcconf $ec_mt_conf" + . "-m new -u 10000 -n 1 -t 0 -c 4"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: test timedout\n"; - $T->Kill (); $T->TimedWait (1); - exit 1; +$test = $T->SpawnWaitKill (60); + +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + $status = 1; } print STDERR "================ Remote test\n"; -$ns_ior = "NameService.ior"; +$ns_ior = PerlACE::LocalFile ("NameService.ior"); unlink $ns_ior; -$NS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR. - "Naming_Service".$DIR_SEPARATOR. - "Naming_Service".$EXE_EXT, - " -o $ns_ior "); - -if (ACE::waitforfile_timed ($ns_ior, 5) == -1) { - print STDERR "ERROR: cannot find file <$ns_ior>\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; + +$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", + "-o $ns_ior"); + +$ES = new PerlACE::Process ("../../Event_Service/Event_Service", + "-ORBInitRef NameService=file://$ns_ior " + . " -ORBSvcConf $ec_conf " + . " -t NEW"); + +$C = new PerlACE::Process ("ECT_Consumer", + "-ORBInitRef NameService=file://$ns_ior " + . " -c 4 -s 1"); + +$S = new PerlACE::Process ("ECT_Supplier", + "-ORBInitRef NameService=file://$ns_ior " + . " -s 1 -u 5000 -n 1 -t 0"); + +$NS->Spawn (); + +if (PerlACE::waitforfile_timed ($ns_ior, 5) == -1) { + print STDERR "ERROR: cannot find file <$ns_ior>\n"; + $NS->Kill (); + exit 1; } -$ES = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR. - "Event_Service".$DIR_SEPARATOR. - "Event_Service".$EXE_EXT, - " -ORBInitRef NameService=file://$ns_ior " - ." -ORBSvcConf $cwd$DIR_SEPARATOR" . "ec.conf " - . " -t NEW"); +$ES->Spawn (); sleep 5; -$C = Process::Create ($EXEPREFIX."ECT_Consumer".$EXE_EXT, - " -ORBInitRef NameService=file://$ns_ior " - . " -c 4 -s 1"); - -$S = Process::Create ($EXEPREFIX."ECT_Supplier".$EXE_EXT, - " -ORBInitRef NameService=file://$ns_ior " - . " -s 1 -u 5000 -n 1 -t 0"); - -if ($S->TimedWait (300) == -1) { - print STDERR "ERROR: supplier timedout\n"; - $S->Kill (); $S->TimedWait (1); - $C->Kill (); $C->TimedWait (1); - $ES->Kill (); $ES->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$C->Spawn (); +$S->Spawn (); + +$supplier = $S->WaitKill (300); + +if ($supplier != 0) { + print STDERR "ERROR: supplier returned $supplier\n"; + $status = 1; } -if ($C->TimedWait (60) == -1) { - print STDERR "ERROR: consumer timedout\n"; - $C->Kill (); $C->TimedWait (1); - $ES->Kill (); $ES->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$consumer = $C->WaitKill (60); + +if ($consumer != 0) { + print STDERR "ERROR: consumer returned $consumer\n"; + $status = 1; } -if ($ES->TimedWait (5) == -1) { - print STDERR "ERROR: event channel timedout\n"; - $ES->Kill (); $ES->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$eserver = $ES->WaitKill (5); + +if ($eserver != 0) { + print STDERR "ERROR: event server returned $eserver\n"; + $status = 1; } -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$nserver = $NS->TerminateWaitKill (5); + +if ($nserver != 0) { + print STDERR "ERROR: name server returned $nserver\n"; + $status = 1; } unlink $ns_ior; -exit 0; +exit $status; diff --git a/TAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl b/TAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl index 6811dd7c615..8ac6b2e0dc1 100755 --- a/TAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl +++ b/TAO/orbsvcs/tests/Event/Basic/exhaustive_test.pl @@ -8,61 +8,51 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a Perl script that runs the client and all the other servers that # are needed -unshift @INC, '../../../../../bin'; -require ACEutils; -require Uniqueid; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -ACE::checkForTarget($cwd); $status = 0; -$conf_file = 'exhaustive.conf'; -@dispatching_configs = ("-ECDispatching reactive", - "-ECDispatching mt -ECDispatchingThreads 4"); -@collection_strategies = ("copy_on_read", - "copy_on_write", - "delayed"); -@collection_types = ("list", "rb_tree"); -@filtering_configs = ("-ECFiltering prefix -ECSupplierFilter per-supplier", - "-ECFiltering prefix -ECSupplierFilter null"); +$conf_file = PerlACE::LocalFile ('exhaustive.conf'); -foreach $d (@dispatching_configs) { - foreach $f (@filtering_configs) { - foreach $c (@collection_strategies) { - foreach $t (@collection_types) { - local $collection = "mt:".$c.":".$t; - local $config = - 'static EC_Factory "' - .$d - ." -ECProxyPushConsumerCollection ".$collection - ." -ECProxyPushSupplierCollection ".$collection - ." ".$f - .'"'; - open (CONFIG,">$conf_file") - || die "Cannot open $conf_file\n"; - print CONFIG $config, "\n"; - close (CONFIG); - - print STDERR "\n\n", $config, "\n"; +@dispatching_configs = ("-ECDispatching reactive", + "-ECDispatching mt -ECDispatchingThreads 4"); +@collection_strategies = ("copy_on_read", + "copy_on_write", + "delayed"); +@collection_types = ("list", + "rb_tree"); +@filtering_configs = ("-ECFiltering prefix -ECSupplierFilter per-supplier", + "-ECFiltering prefix -ECSupplierFilter null"); - system ("purify.exe ". - "/run .\\Release\\Random.exe ". - " -ORBSvcConf " - .$cwd.$DIR_SEPARATOR. - "$conf_file" - ." -suppliers 16" - ." -consumers 16" - ." -max_recursion 0"); -# $T = Process::Create ("c:\\Program Files\\Rational\\Purify\\purify.exe" -# if ($T->TimedWait (900) == -1) { -# print STDERR "ERROR: Test timedout\n"; -# $status = 1; -# $T->Kill (); $T->TimedWait (1); -# } - } +foreach $d (@dispatching_configs) { + foreach $f (@filtering_configs) { + foreach $c (@collection_strategies) { + foreach $t (@collection_types) { + my $collection = "mt:".$c.":".$t; + + my $config = 'static EC_Factory "' + .$d + ." -ECProxyPushConsumerCollection ".$collection + ." -ECProxyPushSupplierCollection ".$collection + ." ".$f + .'"'; + + open (CONFIG,">$conf_file") || die "Cannot open $conf_file\n"; + print CONFIG $config, "\n"; + close (CONFIG); + + print STDERR "\n\n", $config, "\n"; + + system ("purify.exe " + . "/run .\\Release\\Random.exe " + . " -ORBSvcConf $conf_file" + . " -suppliers 16" + . " -consumers 16" + . " -max_recursion 0"); + } + } } - } } unlink "$conf_file"; diff --git a/TAO/orbsvcs/tests/Event/Basic/run_test.pl b/TAO/orbsvcs/tests/Event/Basic/run_test.pl index 1aa10dae736..cbe4506e0d2 100755 --- a/TAO/orbsvcs/tests/Event/Basic/run_test.pl +++ b/TAO/orbsvcs/tests/Event/Basic/run_test.pl @@ -8,158 +8,94 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a Perl script that runs the client and all the other servers that # are needed -unshift @INC, '../../../../../bin'; -require ACEutils; -require Uniqueid; -use Cwd; +use lib '../../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -ACE::checkForTarget($cwd); $status = 0; -print STDERR "\n\nReconnect suppliers and consumers,", - " using disconnect/connect calls\n"; -$T = Process::Create ($EXEPREFIX . "Reconnect".$EXE_EXT, - "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf" . - " -suppliers 100 -consumers 100 -d 100"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); +$svc_conf = PerlACE::LocalFile ("svc.conf"); +$observer_conf = PerlACE::LocalFile ("observer.conf"); +$svc_complex_conf = PerlACE::LocalFile ("svc.complex.conf"); +$mt_svc_conf = PerlACE::LocalFile ("mt.svc.conf"); +$svc_complex_conf = PerlACE::LocalFile ("svc.complex.conf"); +$control_conf = PerlACE::LocalFile ("control.conf"); + +sub RunTest ($$$) +{ + my $message = shift; + my $program = shift; + my $arguments = shift; + + my $TEST = new PerlACE::Process ($program, $arguments); + + print STDERR "\n\n$message\n"; + + my $test = $TEST->SpawnWaitKill (240); + + if ($test != 0) { + print STDERR "ERROR: Test returned $test\n"; + $status = 1; + } } -print STDERR "\n\nReconnect suppliers and consumers, using connect calls\n"; -$T = Process::Create ($EXEPREFIX . "Reconnect".$EXE_EXT, - "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf" . - " -suppliers 100 -consumers 100 -d 100 -s -c"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Reconnect suppliers and consumers, using disconnect/connect calls", + "Reconnect", + "-ORBsvcconf $svc_conf -suppliers 100 -consumers 100 -d 100"); +RunTest ("Reconnect suppliers and consumers, using connect calls", + "Reconnect", + "-ORBsvcconf $svc_conf -suppliers 100 -consumers 100 -d 100 -s -c"); -print STDERR "\n\nShutdown EC with clients still attached\n"; -$T = Process::Create ($EXEPREFIX . "Shutdown".$EXE_EXT, - "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf" . - " -suppliers 5 -consumers 5"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Shutdown EC with clients still attached", + "Shutdown", + "-ORBsvcconf $svc_conf -suppliers 5 -consumers 5"); -print STDERR "\n\nGateway test\n"; -$T = Process::Create ($EXEPREFIX . "Gateway".$EXE_EXT, - " -ORBsvcconf $cwd$DIR_SEPARATOR" . "observer.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Gateway test", + "Gateway", + "-ORBsvcconf $observer_conf"); -print STDERR "\n\nComplex event channel test,", - "multiple ECs connected through gateways\n"; -$T = Process::Create ($EXEPREFIX . "Observer".$EXE_EXT, - " -ORBsvcconf $cwd$DIR_SEPARATOR" . "observer.conf" - ." -consumer_tshift 0 -consumers 5" - ." -supplier_tshift 0 -suppliers 2" - ." -burstsize 10 -burstcount 10 -burstpause 0"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Complex event channel test, multiple ECs connected through gateways", + "Observer", + "-ORBsvcconf $observer_conf -consumer_tshift 0 -consumers 5 -supplier_tshift 0 -suppliers 2 -burstsize 10 -burstcount 10 -burstpause 0"); -print STDERR "\n\nTimeout tests\n"; -$T = Process::Create ($EXEPREFIX . "Timeout".$EXE_EXT, - "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Timeout tests", + "Timeout", + "-ORBsvcconf $svc_conf"); -print STDERR "\n\nWildcard tests\n"; -$T = Process::Create ($EXEPREFIX . "Wildcard".$EXE_EXT, - "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Wildcard tests", + "Wildcard", + "-ORBsvcconf $svc_conf"); -print STDERR "\n\nNegation tests\n"; -$T = Process::Create ($EXEPREFIX . "Negation".$EXE_EXT, - "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Negation tests", + "Negation", + "-ORBsvcconf $svc_conf"); -print STDERR "\n\nBitmask tests\n"; -$T = Process::Create ($EXEPREFIX . "Bitmask".$EXE_EXT, - " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.complex.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Bitmask tests", + "Bitmask", + "-ORBSvcConf $svc_complex_conf"); -print STDERR "\n\nDisconnect callbacks test\n"; -$T = Process::Create ($EXEPREFIX . "Disconnect".$EXE_EXT, - "-ORBsvcconf $cwd$DIR_SEPARATOR" . "svc.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Disconnect callbacks test", + "Disconnect", + "-ORBsvcconf $svc_conf"); -print STDERR "\n\nMT Disconnects test\n"; -$T = Process::Create ($EXEPREFIX . "MT_Disconnect".$EXE_EXT, - " -ORBSvcConf $cwd$DIR_SEPARATOR" . "mt.svc.conf"); -if ($T->TimedWait (240) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("MT Disconnects test", + "MT_Disconnect", + "-ORBSvcConf $mt_svc_conf"); -print STDERR "\n\nAtomic Reconnection test\n"; -$T = Process::Create ($EXEPREFIX . "Atomic_Reconnect".$EXE_EXT, - " -ORBSvcConf $cwd$DIR_SEPARATOR" . "mt.svc.conf"); -if ($T->TimedWait (120) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Atomic Reconnection test", + "Atomic_Reconnect", + "-ORBSvcConf $mt_svc_conf"); -print STDERR "\n\nComplex filter\n"; -$T = Process::Create ($EXEPREFIX . "Complex".$EXE_EXT, - " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.complex.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Complex filter", + "Complex", + "-ORBSvcConf $svc_complex_conf"); -print STDERR "\n\nControl test\n"; -$T = Process::Create ($EXEPREFIX . "Control".$EXE_EXT, - " -ORBSvcConf $cwd$DIR_SEPARATOR" . "control.conf"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Control test", + "Control", + "-ORBSvcConf $control_conf"); -print STDERR "\n\nRandom test\n"; -$T = Process::Create ($EXEPREFIX . "Random".$EXE_EXT, - " -ORBSvcConf $cwd$DIR_SEPARATOR" . "svc.conf" - . " -suppliers 4 -consumers 4 -max_recursion 1"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("Random test", + "Random", + "-ORBSvcConf $svc_conf -suppliers 4 -consumers 4 -max_recursion 1"); exit $status; diff --git a/TAO/orbsvcs/tests/Event/Performance/run_test.pl b/TAO/orbsvcs/tests/Event/Performance/run_test.pl index 94acf56453f..56145ed31e7 100755 --- a/TAO/orbsvcs/tests/Event/Performance/run_test.pl +++ b/TAO/orbsvcs/tests/Event/Performance/run_test.pl @@ -8,94 +8,58 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a Perl script that runs the client and all the other servers that # are needed -unshift @INC, '../../../../../bin'; -require ACEutils; -require Uniqueid; -use Cwd; - -$cwd = getcwd(); -ACE::checkForTarget($cwd); +use lib '../../../../../bin'; +use PerlACE::Run_Test; $status = 0; -print STDERR "\n\nThroughput/Latency single threaded configuration\n"; -$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, - " -ORBsvcconf $cwd$DIR_SEPARATOR" . "ec.st.conf " - . "-burstsize 2000 -burstcount 1"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +$ec_st_conf = PerlACE::LocalFile ("ec.st.conf"); +sub RunTest ($$$) +{ + my $message = shift; + my $program = shift; + my $arguments = shift; -print STDERR "\n\nThroughput/Latency MT-safe configuration\n"; -$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, - " -burstsize 2000" - ." -burstcount 1"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} + my $TEST = new PerlACE::Process ($program, $arguments); + print STDERR "\n\n$message\n"; + + my $test = $TEST->SpawnWaitKill (60); -print STDERR "\n\nThroughput/Latency MT-safe configuration, 4 consumers\n"; -$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, - " -burstsize 2000" - ." -burstcount 1 -consumers 4"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); + if ($test != 0) { + print STDERR "ERROR: Test returned $test\n"; + $status = 1; + } } +RunTest ("\n\nThroughput/Latency single threaded configuration\n", + "Throughput", + "-ORBsvcconf $ec_st_conf -burstsize 2000 -burstcount 1"); -print STDERR "\n\nThroughput/Latency MT-safe configuration,", - " 4 consumers 4 suppliers\n"; -$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, - " -burstsize 2000" - ." -burstcount 1 -consumers 4 -suppliers 4"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("\n\nThroughput/Latency MT-safe configuration\n", + "Throughput", + "-burstsize 2000 -burstcount 1"); +RunTest ("\n\nThroughput/Latency MT-safe configuration, 4 consumers\n", + "Throughput", + "-burstsize 2000 -burstcount 1 -consumers 4"); -print STDERR "\n\nThroughput/Latency MT-safe configuration,", - " 4 consumers 4 suppliers\n"; -$T = Process::Create ($EXEPREFIX . "Throughput".$EXE_EXT, - " -burstsize 2000" - ." -burstcount 1 -consumers 4 -suppliers 4" - ." -consumers_tshift 0 -suppliers_tshift 0"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("\n\nThroughput/Latency MT-safe configuration, 4 consumers 4 suppliers\n", + "Throughput", + "-burstsize 2000 -burstcount 1 -consumers 4 -suppliers 4"); -print STDERR "\n\nConnection and disconnection time,", - " 100 consumers 100 suppliers\n"; -$T = Process::Create ($EXEPREFIX . "Connect".$EXE_EXT, - " -consumers 100 -suppliers 100" - ." -connection_order interleaved"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("\n\nThroughput/Latency MT-safe configuration, 4 consumers 4 suppliers\n", + "Throughput", + "-burstsize 2000 -burstcount 1 -consumers 4 -suppliers 4" + . " -consumers_tshift 0 -suppliers_tshift 0"); +RunTest ("\n\nConnection and disconnection time, 100 consumers 100 suppliers\n", + "Connect", + "-consumers 100 -suppliers 100 -connection_order interleaved"); -print STDERR "\n\nConnection and disconnection time,", - " 500 consumers 500 suppliers\n"; -$T = Process::Create ($EXEPREFIX . "Connect".$EXE_EXT, - " -consumers 500 -suppliers 500" - ." -connection_order interleaved"); -if ($T->TimedWait (60) == -1) { - print STDERR "ERROR: Test timedout\n"; - $status = 1; - $T->Kill (); $T->TimedWait (1); -} +RunTest ("\n\nConnection and disconnection time, 500 consumers 500 suppliers\n", + "Connect", + "-consumers 500 -suppliers 500 -connection_order interleaved"); exit $status; diff --git a/TAO/orbsvcs/tests/Event_Latency/run_test.pl b/TAO/orbsvcs/tests/Event_Latency/run_test.pl index e7d20789200..71a7436bb3e 100755 --- a/TAO/orbsvcs/tests/Event_Latency/run_test.pl +++ b/TAO/orbsvcs/tests/Event_Latency/run_test.pl @@ -5,59 +5,56 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -$NS_ior = "$cwd$DIR_SEPARATOR" . "NameService.ior"; +$NS_ior = PerlACE::LocalFile ("NameService.ior"); $sleeptime = 3; $status = 0; -ACE::checkForTarget($cwd); +unlink $NS_ior; + +$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", + "-o $NS_ior "); +$ES = new PerlACE::Process ("../../Event_Service/Event_Service", + "-ORBInitRef NameService=file://$NS_ior -t new"); +$T = new PerlACE::Process ("Event_Latency", + "-ORBInitRef NameService=file://$NS_ior" + . " -j -m 100"); -$NS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR - ."..".$DIR_SEPARATOR - ."Naming_Service".$DIR_SEPARATOR - ."Naming_Service".$EXE_EXT, - " -o $NS_ior "); +$NS->Spawn (); -if (ACE::waitforfile_timed ($NS_ior, 5) == -1) { - print STDERR "ERROR: waiting for naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($NS_ior, 5) == -1) { + print STDERR "ERROR: waiting for naming service IOR file\n"; + $NS->Kill (); + exit 1; } -$ES = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR - ."..".$DIR_SEPARATOR - ."Event_Service".$DIR_SEPARATOR - ."Event_Service".$EXE_EXT, - "-ORBInitRef NameService=file://$NS_ior -t new"); +$ES->Spawn (); sleep $sleeptime; -$TEST = Process::Create ($EXEPREFIX.".".$DIR_SEPARATOR."Event_Latency".$EXE_EXT, - "-ORBInitRef NameService=file://$NS_ior" - ." -j -m 100"); +$test = $T->SpawnWaitKill (60); + +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + $status = 1; +} + +$nserver = $NS->TerminateWaitKill (5); -if ($TEST->TimedWait (60) == -1) { - print STDERR "ERROR: test timedout\n"; - $status = 1; - $TEST->Kill (); $TEST->TimedWait (1); +if ($nserver != 0) { + print STDERR "ERROR: name server returned $nserver\n"; + $status = 1; } +$eserver = $ES->TerminateWaitKill (5); -$NS->Terminate(); -$ES->Terminate(); -if ($NS->TimedWait (5) == -1 || $ES->TimedWait (5) == -1) { - print STDERR "ERROR: couldn't terminate the services nicely\n"; - $NS->Kill (); $NS->TimedWait (1); - $ES->Kill (); $ES->TimedWait (1); - $status = 1; +if ($eserver != 0) { + print STDERR "ERROR: event server returned $eserver\n"; + $status = 1; } unlink $NS_ior; -# @@ Capture any errors from the server too. exit $status; diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl index 7b3fa36d070..c7ae582978f 100755 --- a/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl @@ -6,72 +6,109 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "../../../../../bin"; - -require ACEutils; -use Cwd; - -$cwd = getcwd(); +use PerlACE::Run_Test; ################################################################################ # Program locations -$imr_ior = "$cwd$DIR_SEPARATOR" . "imr.ior"; -$name_ior = "$cwd$DIR_SEPARATOR" . "name.ior"; - -$imr_server = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.".." - .$DIR_SEPARATOR."ImplRepo_Service" - .$DIR_SEPARATOR."ImplRepo_Service".$EXE_EXT; - -$name_server = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.".." - .$DIR_SEPARATOR."Naming_Service" - .$DIR_SEPARATOR."Naming_Service".$EXE_EXT; +$imr_ior = PerlACE::LocalFile ("imr.ior"); +$name_ior = PerlACE::LocalFile ("name.ior"); +$IMR = new PerlACE::Process ("../../../ImplRepo_Service/ImplRepo_Service"); +$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service"); if ($^O eq "MSWin32") { - # Just find it in the path - $tao_imr = "tao_imr".$EXE_EXT; + $TAO_IMR = new PerlACE::Process ("../../../../../bin/tao_imr"); } else { - $tao_imr = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.".." - .$DIR_SEPARATOR."ImplRepo_Service" - .$DIR_SEPARATOR."tao_imr".$EXE_EXT; + $TAO_IMR = new PerlACE::Process ("../../../ImplRepo_Service/tao_imr"); } -$test = $EXEPREFIX."test".$EXE_EXT; +$TEST = new PerlACE::Process ("test"); ################################################################################ $errors = 0; -ACE::checkForTarget($cwd); - unlink $imr_ior; unlink $name_ior; -$IR = Process::Create ($imr_server, "-o $imr_ior -d 0"); +################################################################################ +## Start the implementation Repository + +$IMR->Arguments ("-o $imr_ior -d 0"); +$IMR->Spawn (); + +if (PerlACE::waitforfile_timed ($imr_ior, 5) == -1) { + print STDERR "ERROR: waiting for $imr_ior\n"; + $IMR->Kill (); + exit 1; +} -ACE::waitforfile ($imr_ior); +################################################################################ +## Register the NameService -system ($tao_imr." -ORBInitRef ImplRepoService=file://$imr_ior" - ." add NameService " - ." -c \"$name_server" +$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_ior" + . " add NameService " + ." -c \"" . $NS->Executable () ." -ORBInitRef ImplRepoService=file://$imr_ior" ." -ORBUseIMR 1 .\""); -system ($tao_imr." -ORBInitRef ImplRepoService=file://$imr_ior" - ." ior NameService -f $name_ior"); +$taoimr = $TAO_IMR->SpawnWaitKill (60); -if (system ($test." -ORBInitRef NameService=file://$name_ior")) { +if ($tao_imr != 0) { + print STDERR "ERROR: tao_imr (add) returned $tao_imr\n"; ++$errors; } -system ($tao_imr." -ORBInitRef ImplRepoService=file://$imr_ior" - ." shutdown NameService "); +################################################################################ +## Create IOR for NameService + +$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$imr_ior" + . " ior NameService -f $name_ior"); -$IR->Kill (); $IR->Wait (); +$taoimr = $TAO_IMR->SpawnWaitKill (60); -if ($errors > 0) { - print "Error: run_test.pl detected $errors errors!\n"; +if ($tao_imr != 0) { + print STDERR "ERROR: tao_imr (ior) returned $tao_imr\n"; + ++$errors; } -exit ($errors); + +################################################################################ +## Run the test + +$TEST->Arguments ("-ORBInitRef NameService=file://$name_ior"); + +$test = $TEST->SpawnWaitKill (60); + +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + ++$errors; +} + + +################################################################################ +## Shutdown the NameService + +$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$imr_ior shutdown " + . "NameService "); + +$taoimr = $TAO_IMR->SpawnWaitKill (60); + +if ($tao_imr != 0) { + print STDERR "ERROR: tao_imr (shutdown) returned $tao_imr\n"; + ++$errors; +} + +################################################################################ +## Kill the IMR + +$iserver = $IMR->TerminateWaitKill (5); + +if ($iserver != 0) { + print STDERR "ERROR: IMR returned $iserver\n"; + ++$errors; +} + +exit $errors; diff --git a/TAO/orbsvcs/tests/ImplRepo/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/run_test.pl index a10af6303a1..fa884460a26 100755 --- a/TAO/orbsvcs/tests/ImplRepo/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/run_test.pl @@ -6,29 +6,23 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- ############################################################################### +use lib "../../../../bin"; +use PerlACE::Run_Test; use Cwd; use Sys::Hostname; use File::Copy; -BEGIN { - ### We need to BEGIN this block so we make sure ACE_ROOT is set before - ### we use it in the use lib line - $cwd = getcwd(); +$cwd = getcwd(); - $ACE_ROOT = $ENV{ACE_ROOT}; +$ACE_ROOT = $ENV{ACE_ROOT}; - if (!$ACE_ROOT) { - chdir ('../../../../'); - $ACE_ROOT = getcwd (); - chdir ($cwd); - print "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT\n"; - } +if (!defined $ACE_ROOT) { + chdir ('../../../../'); + $ACE_ROOT = getcwd (); + chdir ($cwd); + print "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT\n"; } -use lib "$ACE_ROOT/bin"; - -use PerlACE::Run_Test; - $airplane_ior = PerlACE::LocalFile ("airplane.ior"); $nestea_ior = PerlACE::LocalFile ("nestea.ior"); $implrepo_ior = PerlACE::LocalFile ("implrepo.ior"); @@ -36,11 +30,12 @@ $implrepo_ior = PerlACE::LocalFile ("implrepo.ior"); $refstyle = " -ORBobjrefstyle URL"; $backing_store = "imr_backing_store"; +$nestea_dat = "nestea.dat"; $protocol = "iiop"; $host = hostname(); $port = 12345; -$endpoint = "-ORBEndpoint" . "$protocol" . "://" . "$host" . ":" . $port; +$endpoint = "-ORBEndpoint " . "$protocol" . "://" . "$host" . ":" . $port; $IMR = new PerlACE::Process ("../../ImplRepo_Service/ImplRepo_Service"); @@ -65,81 +60,155 @@ unlink $airplane_ior; unlink $nestea_ior; unlink $implrepo_ior; -sub convert_slash($) -{ - $cmd = shift; - - $cmd =~ s/\//\\/g; - - return $cmd; -} - # The Tests ############################################################################### sub airplane_test { + my $status = 0; + $A_SVR->Arguments ("-o $airplane_ior $refstyle"); $A_SVR->Spawn (); - PerlACE::waitforfile ($airplane_ior); + if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) { + print STDERR "ERROR: cannot find $airplane_ior\n"; + $A_SVR->Kill (); + return 1; + } - $A_CLI->SpawnWaitKill (300); + my $client = $A_CLI->SpawnWaitKill (300); + + if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; + } - $A_SVR->Kill (); $A_SVR->Wait (); + my $server = $A_SVR->TerminateWaitKill (5); + + if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; + } + + return $status; } ############################################################################### sub nestea_test { + my $status = 0; + unlink $nestea_dat; + $N_SVR->Arguments ("-o $nestea_ior $refstyle"); $N_SVR->Spawn (); - PerlACE::waitforfile ($nestea_ior); - - $N_CLI->SpawnWaitKill (300); + if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) { + print STDERR "ERROR: cannot find $nestea_ior\n"; + $N_SVR->Kill (); + return 1; + } + + my $client = $N_CLI->SpawnWaitKill (300); - $N_SVR->Kill (); $N_SVR->Wait (); + if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; + } + + $server = $N_SVR->TerminateWaitKill (5); + + if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; + } + + unlink $nestea_dat; + return $status; } ############################################################################### +# @todo: This test doesn't clean up too well if something fails sub nt_service_test { - my $BIN_IMR = new PerlACE::Process (convert_slash ("$ACE_ROOT/bin/ImplRepo_Service"), + my $result = 0; + + my $BIN_IMR = new PerlACE::Process ("$ACE_ROOT/bin/ImplRepo_Service", "-c install"); print "Copying ImplRepo_Service to bin\n"; copy ($IMR->Executable (), $BIN_IMR->Executable ()); print "Installing TAO Implementation Repository Service\n"; - $BIN_IMR->SpawnWaitKill (300); + $result = $BIN_IMR->SpawnWaitKill (300); + + if ($result != 0) { + print STDERR "ERROR: IMR installation returned $result\n"; + return 1; + } print "Starting TAO Implementation Repository Service\n"; - my $NET = new PerlACE::Process ($ENV{'SystemRoot'}."/System32/net", + my $NET = new PerlACE::Process ("net", "start \"TAO Implementation Repository\""); - $NET->SpawnWaitKill (300); + $NET->IgnoreExeSubDir (1); + + $result = $NET->SpawnWaitKill (300); + if ($result != 0) { + print STDERR "ERROR: net returned $result\n"; + return 1; + } $TAO_IMR->Arguments ("add airplane_server -c \"" . $A_SVR->Executable () . " -ORBUseIMR 1\" -w \"$ACE_ROOT/bin\""); - $TAO_IMR->SpawnWaitKill (100); + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + return 1; + } $A_SVR->Arguments ("-o $airplane_ior -ORBUseIMR 1"); $A_SVR->Spawn (); - PerlACE::waitforfile ($airplane_ior); + if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) { + print STDERR "ERROR: cannot find $airplane_ior\n"; + $A_SVR->Kill (); + return 1; + } - $A_CLI->SpawnWaitKill (100); + $result = $A_CLI->SpawnWaitKill (100); + + if ($result != 0) { + print STDERR "ERROR: airplane client returned $result\n"; + return 1; + } $TAO_IMR->Arguments ("shutdown airplane_server"); - $TAO_IMR->SpawnWaitKill (100); - $A_CLI->SpawnWaitKill (100); + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + return 1; + } - $TAO_IMR->SpawnWaitKill (100); + $result = $A_CLI->SpawnWaitKill (100); + + if ($result != 0) { + print STDERR "ERROR: airplane client returned $result\n"; + return 1; + } + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + return 1; + } print "Stopping TAO Implementation Repository Service\n"; $NET->Arguments ("stop \"TAO Implementation Repository\""); @@ -150,94 +219,260 @@ sub nt_service_test $BIN_IMR->SpawnWaitKill (300); print "Removing ImplRepo_Service from bin\n"; - unlink ($bin_implrepo_server); + unlink $BIN_IMR->Executable (); + + return 0; } ############################################################################### sub airplane_ir_test { + my $status = 0; + my $result = 0; + $IMR->Arguments ("-o $implrepo_ior"); $IMR->Spawn (); - PerlACE::waitforfile ($implrepo_ior); + if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) { + print STDERR "ERROR: cannot find $implrepo_ior\n"; + $IMR->Kill (); + return 1; + } $TAO_IMR->Arguments ("add airplane_server -c \"" . $A_SVR->Executable () . " -ORBUseIMR 1 -o $airplane_ior\""); - $TAO_IMR->SpawnWaitKill (300); + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + $IMR->Kill (); + return 1; + } + $A_SVR->Arguments ("-ORBUseIMR 1 -o $airplane_ior"); $A_SVR->Spawn (); - PerlACE::waitforfile ($airplane_ior); + if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) { + print STDERR "ERROR: cannot find $airplane_ior\n"; + $IMR->Kill (); + $A_SVR->Kill (); + return 1; + } $TAO_IMR->Arguments ("shutdown airplane_server"); - $A_CLI->SpawnWaitKill (100); - $TAO_IMR->SpawnWaitKill (100); - $A_CLI->SpawnWaitKill (100); - $TAO_IMR->SpawnWaitKill (100); + $result = $A_CLI->SpawnWaitKill (100); + + if ($result != 0) { + print STDERR "ERROR: airplane_client 1 returned $result\n"; + $status = 1; + } + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr 1 returned $result\n"; + $status = 1; + } + + $result = $A_CLI->SpawnWaitKill (100); + + if ($result != 0) { + print STDERR "ERROR: airplane_client 2 returned $result\n"; + $status = 1; + } + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr 2 returned $result\n"; + $status = 1; + } - $IMR->Kill (); $IMR->Wait (); + my $server = $A_SVR->WaitKill (5); + + if ($server != 0) { + print STDERR "ERROR: airplane server returned $server\n"; + $status = 1; + } + + my $implrepo = $IMR->TerminateWaitKill (5); + + if ($implrepo != 0) { + print STDERR "ERROR: IMR returned $implrepo\n"; + $status = 1; + } + + return $status; } ############################################################################### sub nestea_ir_test { - $IMR->Arguments ("-o $implrepo_ior -d 0 $refstyle"); + unlink $nestea_dat; + my $status = 0; + my $result = 0; + + $IMR->Arguments ("-o $implrepo_ior"); $IMR->Spawn (); - PerlACE::waitforfile ($implrepo_ior); + if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) { + print STDERR "ERROR: cannot find $implrepo_ior\n"; + $IMR->Kill (); + return 1; + } $TAO_IMR->Arguments ("add nestea_server -c \"" . $N_SVR->Executable () . " -ORBUseIMR 1 -o $nestea_ior\""); - $TAO_IMR->SpawnWaitKill (300); + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + $IMR->Kill (); + return 1; + } + $N_SVR->Arguments ("-ORBUseIMR 1 -o $nestea_ior"); $N_SVR->Spawn (); - PerlACE::waitforfile ($nestea_ior); + if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) { + print STDERR "ERROR: cannot find $nestea_ior\n"; + $IMR->Kill (); + $N_SVR->Kill (); + return 1; + } $TAO_IMR->Arguments ("shutdown nestea_server"); - $N_CLI->SpawnWaitKill (100); - $TAO_IMR->SpawnWaitKill (100); - $N_CLI->SpawnWaitKill (100); - $TAO_IMR->SpawnWaitKill (100); + $result = $N_CLI->SpawnWaitKill (100); + + if ($result != 0) { + print STDERR "ERROR: nestea client 1 returned $result\n"; + $status = 1; + } + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr 1 returned $result\n"; + $status = 1; + } + + $result = $N_CLI->SpawnWaitKill (100); + + if ($result != 0) { + print STDERR "ERROR: nestea client 2 returned $result\n"; + $status = 1; + } + + $result = $TAO_IMR->SpawnWaitKill (30); - $IMR->Kill (); $IMR->Wait (); + if ($result != 0) { + print STDERR "ERROR: tao_imr 2 returned $result\n"; + $status = 1; + } + + my $server = $N_SVR->WaitKill (5); + + if ($server != 0) { + print STDERR "ERROR: nestea server returned $server\n"; + $status = 1; + } + + my $implrepo = $IMR->TerminateWaitKill (5); + + if ($implrepo != 0) { + print STDERR "ERROR: IMR returned $implrepo\n"; + $status = 1; + } + + unlink $nestea_dat; + return $status; } ############################################################################### sub persistent_ir_test { + my $status = 0; + my $result = 0; unlink $backing_store; $IMR->Arguments ("$endpoint -o $implrepo_ior -p $backing_store -d 0"); $IMR->Spawn (); - PerlACE::waitforfile ($implrepo_ior); + if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) { + print STDERR "ERROR: cannot find $implrepo_ior\n"; + $IMR->Kill (); + return 1; + } $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior add airplane_server -c \"".$A_SVR->Executable ()." -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior\""); - $TAO_IMR->SpawnWaitKill (100); + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + $IMR->Kill (); + return 1; + } $A_SVR->Arguments ("-o $airplane_ior -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior"); $A_SVR->Spawn (); - PerlACE::waitforfile ($airplane_ior); + if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) { + print STDERR "ERROR: cannot find $airplane_ior\n"; + $IMR->Kill (); + $A_SVR->Kill (); + return 1; + } + $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown airplane_server"); + + $result = $A_CLI->SpawnWaitKill (100); - $A_CLI->SpawnWaitKill (100); - $TAO_IMR->SpawnWaitKill (100); - $A_CLI->SpawnWaitKill (100); - $TAO_IMR->SpawnWaitKill (100); + if ($result != 0) { + print STDERR "ERROR: airplane client returned $result\n"; + $status = 1; + } + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + $status = 1; + } + + $result = $A_CLI->SpawnWaitKill (100); + + if ($result != 0) { + print STDERR "ERROR: airplane client returned $result\n"; + $status = 1; + } + + $result = $TAO_IMR->SpawnWaitKill (30); + + if ($result != 0) { + print STDERR "ERROR: tao_imr returned $result\n"; + $status = 1; + } + + $result = $A_SVR->WaitKill (10); + + if ($result != 0) { + print STDERR "ERROR: airplane server returned $result\n"; + $status = 1; + } print "\nShutting down Implementation Repository\n\n"; - $IMR->Kill (); $IMR->Wait (); + $IMR->Kill (); print "Restarting Implementation Repository.\n"; $IMR->Arguments ("$endpoint -p $backing_store -d 0"); @@ -246,9 +481,9 @@ sub persistent_ir_test PerlACE::waitforfile ($implrepo_ior); $A_CLI->SpawnWaitKill (100); - $TAO_IMR->SpawnWaitKill (100); + $TAO_IMR->SpawnWaitKill (30); - $IMR->Kill (); $IMR->Wait (); + $IMR->Kill (); unlink $backing_store; } @@ -257,15 +492,20 @@ sub persistent_ir_test sub both_ir_test { + my $status = 0; $IMR->Arguments ("-o $implrepo_ior -d 0 $refstyle"); $IMR->Spawn (); - PerlACE::waitforfile ($implrepo_ior); + if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) { + print STDERR "ERROR: cannot find $implrepo_ior\n"; + $IMR->Kill (); + return 1; + } $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior add airplane_server -c \"" . $A_SVR->Executable () . " -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior\""); - $TAO_IMR->SpawnWaitKill (100); + $TAO_IMR->SpawnWaitKill (30); $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior" . " add nestea_server" @@ -273,7 +513,7 @@ sub both_ir_test . " -ORBUseIMR 1" . " $refstyle -ORBInitRef" . " ImplRepoService=file://$implrepo_ior\""); - $TAO_IMR->SpawnWaitKill (100); + $TAO_IMR->SpawnWaitKill (30); $N_SVR->Arguments ("-o $nestea_ior -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior"); $N_SVR->Spawn (); @@ -281,8 +521,21 @@ sub both_ir_test $A_SVR->Arguments ("-o $airplane_ior -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior"); $A_SVR->Spawn (); - PerlACE::waitforfile ($nestea_ior); - PerlACE::waitforfile ($airplane_ior); + if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) { + print STDERR "ERROR: cannot find $airplane_ior\n"; + $IMR->Kill (); + $A_SVR->Kill (); + $N_SVR->Kill (); + return 1; + } + + if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) { + print STDERR "ERROR: cannot find $nestea_ior\n"; + $IMR->Kill (); + $A_SVR->Kill (); + $N_SVR->Kill (); + return 1; + } $N_CLI->Spawn (); $A_CLI->Spawn (); @@ -291,24 +544,24 @@ sub both_ir_test $A_CLI->WaitKill (100); $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown nestea_server"); - $TAO_IMR->SpawnWaitKill (100); + $TAO_IMR->SpawnWaitKill (30); $N_CLI->Spawn (100); $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown airplane_server"); - $TAO_IMR->SpawnWaitKill (100); + $TAO_IMR->SpawnWaitKill (30); $A_CLI->SpawnWaitKill (100); $N_CLI->WaitKill (100); $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown nestea_server"); - $TAO_IMR->SpawnWaitKill (100); + $TAO_IMR->SpawnWaitKill (30); $TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown airplane_server"); - $TAO_IMR->SpawnWaitKill (100); + $TAO_IMR->SpawnWaitKill (30); - $A_SVR->Kill (); $A_SVR->Wait (); - $N_SVR->Kill (); $N_SVR->Wait (); - $IMR->Kill (); $IMR->Wait (); + $A_SVR->Kill (); + $N_SVR->Kill (); + $IMR->Kill (); } ############################################################################### @@ -316,58 +569,42 @@ sub both_ir_test # Parse the arguments -for ($i = 0; $i <= $#ARGV; $i++) -{ - SWITCH: - { - if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") - { - print "run_test [-chorus <target>] test\n"; - print "\n"; - print "-chorus <target> -- Runs the test on Chorus target\n"; - print "test -- Runs a specific test:\n"; - print " airplane, airplane_ir, nt_service, ", - "nestea, nestea_ir,\n"; - print " both_ir, persistent_ir\n"; - exit; - } - if ($ARGV[$i] eq "airplane") - { - airplane_test (); - exit; - } - if ($ARGV[$i] eq "airplane_ir") - { - airplane_ir_test (); - exit; - } - if ($ARGV[$i] eq "nt_service") - { - nt_service_test (); - exit; - } - if ($ARGV[$i] eq "nestea") - { - nestea_test (); - exit; - } - if ($ARGV[$i] eq "nestea_ir") - { - nestea_ir_test (); - exit; - } - if ($ARGV[$i] eq "both_ir") - { - both_ir_test (); - exit; - } - if ($ARGV[$i] eq "persistent_ir") - { - persistent_ir_test (); - exit; - } - print "run_test: Unknown Option: ".$ARGV[$i]."\n"; - } +for ($i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") { + print "run_test test\n"; + print "\n"; + print "test -- Runs a specific test:\n"; + print " airplane, airplane_ir, nt_service, ", + "nestea, nestea_ir,\n"; + print " both_ir, persistent_ir\n"; + exit; + } + elsif ($ARGV[$i] eq "airplane") { + exit airplane_test (); + } + elsif ($ARGV[$i] eq "airplane_ir") { + exit airplane_ir_test (); + } + elsif ($ARGV[$i] eq "nt_service") { + exit nt_service_test (); + } + elsif ($ARGV[$i] eq "nestea") { + exit nestea_test (); + } + elsif ($ARGV[$i] eq "nestea_ir") { + exit nestea_ir_test (); + } + elsif ($ARGV[$i] eq "both_ir") { + exit both_ir_test (); + } + elsif ($ARGV[$i] eq "persistent_ir") { + exit persistent_ir_test (); + } + else { + print "run_test: Unknown Option: ".$ARGV[$i]."\n"; + } } -both_ir_test (); +# if nothing else, run both_ir + +exit both_ir_test (); diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl index 69c35f0f832..78da7eee3b2 100755 --- a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl +++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl @@ -6,94 +6,87 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "../../../../../bin"; +use PerlACE::Run_Test; -require ACEutils; -use Cwd; +$status = 0; -BEGIN { - ### We need to BEGIN this block so we make sure ACE_ROOT is set before - ### we use it in the use lib line - $cwd = getcwd(); +$ifr_iorfile= "if_repo.ior"; +$svr_iorfile = "iorfile"; +$test_idl = PerlACE::LocalFile ("test.idl"); - $ACE_ROOT = $ENV{ACE_ROOT}; - - if (!$ACE_ROOT) { - chdir ('../../../../'); - $ACE_ROOT = getcwd (); - chdir ($cwd); - print "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT\n"; - } +if ($^O eq "MSWin32") { + $tao_ifr = "../../../../../bin/tao_ifr"; +} +else { + $tao_ifr = "../../../IFR_Service/tao_ifr"; } -use lib "$ACE_ROOT/bin"; +$TAO_IFR = new PerlACE::Process ($tao_ifr); +$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service"); +$SV = new PerlACE::Process ("server"); +$CL = new PerlACE::Process ("client", "-ORBInitRef InterfaceRepository=file://$ifr_iorfile"); -ACE::checkForTarget($cwd); +unlink $ifr_iorfile; +unlink $svr_iorfile; -$if_repo_service = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR. - "IFR_Service".$EXE_EXT; +$IFR->Spawn (); +if (PerlACE::waitforfile_timed ($ifr_iorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$ifr_iorfile>\n"; + $IFR->Kill (); + exit 1; +} -$init_ref = - "-ORBInitRef InterfaceRepository=file://if_repo.ior"; +$SV->Spawn (); -if ($^O eq "MSWin32") { - ### It is in the path - $tao_ifr = "tao_ifr".$EXE_EXT; -} -else { - $tao_ifr = "$ACE_ROOT/TAO/orbsvcs/IFR_Service/tao_ifr".$EXE_EXT; +if (PerlACE::waitforfile_timed ($svr_iorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$svr_iorfile>\n"; + $IFR->Kill (); + $SV->Kill (); + exit 1; } -$ifr_iorfile = "$cwd$DIR_SEPARATOR" . "if_repo.ior"; -$svr_iorfile = "$cwd$DIR_SEPARATOR" . "iorfile"; +$TAO_IFR->Arguments ($test_idl); -unlink $ifr_iorfile; -unlink $svr_iorfile; +$tresult = $TAO_IFR->SpawnWaitKill (30); -$IFR = Process::Create ($if_repo_service); +if ($tresult != 0) { + print STDERR "ERROR: tao_ifr (test.idl) returned $tresult\n"; + $status = 1; +} + +$client = $CL->SpawnWaitKill (60); -if (ACE::waitforfile_timed ($ifr_iorfile, 15) == -1) -{ - print STDERR "ERROR: cannot find file <$ifr_iorfile>\n"; - $IFR->Kill (); - $IFR->TimedWait (1); - exit 1; +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } -$SV = Process::Create ($EXEPREFIX."server".$EXE_EXT); +$server = $SV->TerminateWaitKill (5); -if (ACE::waitforfile_timed ($svr_iorfile, 15) == -1) -{ - print STDERR "ERROR: cannot find file <$svr_iorfile>\n"; - $SV->Kill (); - $SV->TimedWait (1); - exit 1; +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; } -system ($tao_ifr." test.idl"); +$TAO_IFR->Arguments ("-r $test_idl"); -$CL = Process::Create ($EXEPREFIX."client".$EXE_EXT, - " $init_ref"); +$tresult = $TAO_IFR->SpawnWaitKill (30); -$client = $CL->TimedWait (60); -if ($client == -1) -{ - print STDERR "ERROR: client timedout\n"; - $CL->Kill (); - $CL->TimedWait (1); +if ($tresult != 0) { + print STDERR "ERROR: tao_ifr (-r test.idl) returned $tresult\n"; + $status = 1; } -$SV->Kill (); -$SV->TimedWait (1); +$server = $IFR->TerminateWaitKill (5); -system ($tao_ifr." -r test.idl"); - -$IFR->Kill (); -$IFR->TimedWait (1); +if ($server != 0) { + print STDERR "ERROR: IFR returned $server\n"; + $status = 1; +} unlink $ifr_iorfile; unlink $svr_iorfile; -exit 0; +exit $status; diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl index bf81ece0806..03b00dcb3fb 100755 --- a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl +++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl @@ -6,82 +6,66 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "../../../../../bin"; - -require ACEutils; -use Cwd; - -$cwd = getcwd(); -ACE::checkForTarget($cwd); +use PerlACE::Run_Test; $locking = "-m"; -$if_repo_server = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR. - "IFR_Service".$EXE_EXT, " $locking"; - - -$init_ref = - "-ORBInitRef InterfaceRepository=file://if_repo.ior"; +$iorfile = "if_repo.ior"; -$iorfile = "$cwd$DIR_SEPARATOR" . "if_repo.ior"; +$status = 0; $debug = ""; $test = ""; $iterations = ""; $other = ""; -for ($i = 0; $i <= $#ARGV; $i++) -{ - SWITCH: - { - if ($ARGV[$i] eq "-d") - { - $debug = "-d"; - last SWITCH; +for ($i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq "-d") { + $debug = "-d"; } - if ($ARGV[$i] eq "-t") - { - $test = "-t ".$ARGV[$i + 1]; - $i++; - last SWITCH; + elsif ($ARGV[$i] eq "-t") { + $test = "-t ".$ARGV[$i + 1]; + $i++; } - if ($ARGV[$i] eq "-i") - { - $iterations = "-i ".$ARGV[$i + 1]; - $i++; - last SWITCH; + elsif ($ARGV[$i] eq "-i") { + $iterations = "-i ".$ARGV[$i + 1]; + $i++; + } + else { + $other .= $ARGV[$i]; } - $other .= $ARGV[$i]; - } } unlink $iorfile; -$SV = Process::Create ($if_repo_server); +$SV = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " $locking"); +$CL = new PerlACE::Process ("IFR_Test", + "-ORBInitRef InterfaceRepository=file://$iorfile" + . " $debug $test $iterations"); + +$SV->Spawn (); -if (ACE::waitforfile_timed ($iorfile, 15) == -1) -{ - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - $SV->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); + exit 1; } -$CL = Process::Create ($EXEPREFIX."IFR_Test".$EXE_EXT, - " $init_ref $debug $test $iterations"); +$client = $CL->SpawnWaitKill (60); -$client = $CL->TimedWait (60); -if ($client == -1) -{ - print STDERR "ERROR: client timedout\n"; - $CL->Kill (); - $CL->TimedWait (1); +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } -$SV->Kill (); -$SV->TimedWait (1); +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} unlink $iorfile; -exit 0; +exit $status; diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl index 3d569d52833..f6f3fd38b8f 100755 --- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl +++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl @@ -6,103 +6,92 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "../../../../../bin"; - -require ACEutils; -use Cwd; - -$cwd = getcwd(); -ACE::checkForTarget($cwd); +use PerlACE::Run_Test; $persistent = "-p"; -$ifr_service = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR. - "IFR_Service".$EXE_EXT, " $persistent"; +$status = 0; -$init_ref = - "-ORBInitRef InterfaceRepository=file://if_repo.ior"; +$iorfile = "if_repo.ior"; +$backing_file = PerlACE::LocalFile ("ifr_default_backing_store"); -$iorfile = "$cwd$DIR_SEPARATOR" . "if_repo.ior"; -$backing_file = "$cwd$DIR_SEPARATOR" . "ifr_default_backing_store"; +$init_ref = "-ORBInitRef InterfaceRepository=file://$iorfile"; $debug = ""; $query_opt = "-q"; $other = ""; -for ($i = 0; $i <= $#ARGV; $i++) -{ - SWITCH: - { - if ($ARGV[$i] eq "-d") - { - $debug = "-d"; - last SWITCH; +for ($i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq "-d") { + $debug = "-d"; + } + else { + $other .= $ARGV[$i]; } - $other .= $ARGV[$i]; - } } unlink $iorfile; unlink $backing_file; -print "\t IFR Persistence Test\n\n"; +print STDERR "\t IFR Persistence Test\n\n"; + +$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service", $persistent); +$T = new PerlACE::Process ("Persistence_Test"); -$NEW_IFR = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR. - "IFR_Service".$EXE_EXT, " $persistent"); +$IFR->Spawn (); -if (ACE::waitforfile_timed ($iorfile, 15) == -1) -{ - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $NEW_IFR->Kill (); - $NEW_IFR->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $IFR->Kill (); + exit 1; } -$POPULATE = Process::Create ($EXEPREFIX."Persistence_Test".$EXE_EXT, - " $init_ref"); +$T->Arguments ($init_ref); -$populate = $POPULATE->TimedWait (60); -if ($populate == -1) -{ - print STDERR "ERROR: populate timedout\n"; - $POPULATE->Kill (); - $POPULATE->TimedWait (1); +$test = $T->SpawnWaitKill (60); + +if ($test != 0) { + print STDERR "ERROR: populate test returned $test\n"; + $status = 1; } -$NEW_IFR->Kill (); -$NEW_IFR->TimedWait (1); +$server = $IFR->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: IFR returned $server\n"; + $status = 1; +} unlink $iorfile; -$FILE_IFR = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR. - "IFR_Service".$EXE_EXT, " $persistent"); +$IFR->Spawn (); -if (ACE::waitforfile_timed ($iorfile, 15) == -1) -{ - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $FILE_IFR->Kill (); - $FILE_IFR->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $IFR->Kill (); + exit 1; } -$QUERY = Process::Create ($EXEPREFIX."Persistence_Test".$EXE_EXT, - " $init_ref $debug $query_opt"); +$T->Arguments ("$init_ref $debug $query_opt"); -$query = $QUERY->TimedWait (60); -if ($query == -1) -{ - print STDERR "ERROR: query timedout\n"; - $QUERY->Kill (); - $QUERY->TimedWait (1); + +$test = $T->SpawnWaitKill (60); + +if ($test != 0) { + print STDERR "ERROR: query test returned $test\n"; + $status = 1; } -$FILE_IFR->Kill (); -$FILE_IFR->TimedWait (1); -#unlink $iorfile; -#unlink $backing_file; +$server = $IFR->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: IFR returned $server\n"; + $status = 1; +} + +unlink $iorfile; +unlink $backing_file; -exit 0; +exit $status; diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/client.dsp b/TAO/orbsvcs/tests/Interoperable_Naming/client.dsp index 235c71addd6..788203c5f3f 100644 --- a/TAO/orbsvcs/tests/Interoperable_Naming/client.dsp +++ b/TAO/orbsvcs/tests/Interoperable_Naming/client.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
diff --git a/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl b/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl index 0e33c0d7dc5..12b26792aa8 100755 --- a/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl +++ b/TAO/orbsvcs/tests/Interoperable_Naming/run_test.pl @@ -8,12 +8,8 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a perl script that runs the NamingContextExt test. It starts # the Naming service, server and the client as necessary -unshift @INC, '../../../../bin'; -require Process; -require ACEutils; -use Cwd; - -$cwd = getcwd (); +use lib '../../../../bin'; +use PerlACE::Run_Test; # Amount of delay (in seconds) between starting a server and a client # to allow proper server initialization. @@ -21,58 +17,38 @@ $sleeptime = 8; # Variables for command-line arguments to client and server # executables -$iorfile = "$cwd$DIR_SEPARATOR" . "ns.ior"; +$iorfile = PerlACE::LocalFile ("ns.ior"); -ACE::checkForTarget($cwd); +# Run the server and client for the test. -sub name_server - { - my $args = "@_"." -o $iorfile"; - my $prog = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR..$DIR_SEPARATOR". - "orbsvcs".$DIR_SEPARATOR. - "Naming_Service".$DIR_SEPARATOR. - "Naming_Service".$EXE_EXT; +$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o $iorfile"); +$CL = new PerlACE::Process ("client", "-s -ORBInitRef NameService=file://$iorfile"); - # Make sure the files are gone, so we can wait on them. - unlink $iorfile; +# Make sure the files are gone, so we can wait on them. +unlink $iorfile; - $NS = Process::Create ($prog, $args); +$NS->Spawn (); - if (ACE::waitforfile_timed ($iorfile, $sleeptime) == -1) - { - print STDERR "ERROR: cannot find IOR file <$iorfile>\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } - } +if (PerlACE::waitforfile_timed ($iorfile, $sleeptime) == -1) { + print STDERR "ERROR: cannot find IOR file <$iorfile>\n"; + $NS->Kill (); + exit 1; +} + +$client = $CL->SpawnWaitKill (60); -sub client - { - my $args = "@_"." "; - my $prog = $EXEPREFIX."client".$EXE_EXT; - - $CL = Process::Create ($prog, $args); - - $client = $CL->TimedWait (60); - if ($client == -1) { - print STDERR "ERROR: client timedout\n"; - $CL->Kill (); $CL->TimedWait (1); - } - } +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} -# Options for all the tests recognized by the 'client' program -$opts = "-s -ORBInitRef NameService=file://$iorfile"; +$nserver = $NS->TerminateWaitKill (5); -# Run the server and client for the test. -# -name_server (); -client ($opts); +if ($nserver != 0) { + print STDERR "ERROR: server returned $nserver\n"; + $status = 1; +} -$NS->Terminate (); $server = $NS->TimedWait (5); -if ($server == -1) - { - print STDERR "ERROR: server timedout\n"; - $NS->Kill (); $NS->TimedWait (1); - } +unlink $iorfile; -exit 0; +exit $status; diff --git a/TAO/orbsvcs/tests/LoadBalancing/client.dsp b/TAO/orbsvcs/tests/LoadBalancing/client.dsp index 75b0af27416..dd4d5cf6317 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/client.dsp +++ b/TAO/orbsvcs/tests/LoadBalancing/client.dsp @@ -137,6 +137,8 @@ SOURCE=.\Hash_Replica.idl !IF "$(CFG)" == "LoadBalancing client - Win32 Release"
+# PROP Ignore_Default_Tool 1
+USERDEP__HASH_="..\..\..\..\bin\Release\tao_idl.exe"
# Begin Custom Build
InputPath=.\Hash_Replica.idl
InputName=Hash_Replica
@@ -174,6 +176,8 @@ BuildCmds= \ !ELSEIF "$(CFG)" == "LoadBalancing client - Win32 Debug"
+# PROP Ignore_Default_Tool 1
+USERDEP__HASH_="..\..\..\..\bin\tao_idl.exe"
# Begin Custom Build
InputPath=.\Hash_Replica.idl
InputName=Hash_Replica
diff --git a/TAO/orbsvcs/tests/LoadBalancing/server.dsp b/TAO/orbsvcs/tests/LoadBalancing/server.dsp index 61a148ff01e..e1362427374 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/server.dsp +++ b/TAO/orbsvcs/tests/LoadBalancing/server.dsp @@ -137,6 +137,8 @@ SOURCE=.\Hash_Replica.idl !IF "$(CFG)" == "LoadBalancing server - Win32 Release"
+# PROP Ignore_Default_Tool 1
+USERDEP__HASH_="..\..\..\..\bin\Release\tao_idl.exe"
# Begin Custom Build
InputPath=.\Hash_Replica.idl
InputName=Hash_Replica
@@ -174,6 +176,8 @@ BuildCmds= \ !ELSEIF "$(CFG)" == "LoadBalancing server - Win32 Debug"
+# PROP Ignore_Default_Tool 1
+USERDEP__HASH_="..\..\..\..\bin\tao_idl.exe"
# Begin Custom Build
InputPath=.\Hash_Replica.idl
InputName=Hash_Replica
diff --git a/TAO/orbsvcs/tests/Property/run_test.pl b/TAO/orbsvcs/tests/Property/run_test.pl index 56e731ac912..d66bbd712a2 100755 --- a/TAO/orbsvcs/tests/Property/run_test.pl +++ b/TAO/orbsvcs/tests/Property/run_test.pl @@ -5,81 +5,60 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require Process; -require ACEutils; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); # amount of delay between running the servers $sleeptime = 6; $status = 0; -ACE::checkForTarget($cwd); - # variables for parameters -$nsior = "$cwd$DIR_SEPARATOR" . "ns.ior"; - -sub name_server -{ - my $args = " -o $nsior"; - my $prog = - print STDERR ("\nNaming_Service: $args\n"); - - unlink $nsior; - $NS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR - ."..".$DIR_SEPARATOR - ."Naming_Service".$DIR_SEPARATOR - ."Naming_Service".$EXE_EXT, $args); - if (ACE::waitforfile_timed ($nsior, 5) == -1) { - print STDERR "ERROR: cannot find naming service IOR file\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } -} +$nsior = PerlACE::LocalFile ("ns.ior"); +unlink $nsior; -sub server -{ - my $args = "-ORBInitRef NameService=file://$nsior"; - print STDERR "\nServer $args\n"; - $SV = Process::Create ($EXEPREFIX."server$EXE_EXT", $args); -} +$NS = new PerlACE::Process ("../../Naming_Service/Naming_Service", "-o $nsior"); +$SV = new PerlACE::Process ("server", "-ORBInitRef NameService=file://$nsior"); +$CL = new PerlACE::Process ("client", "-ORBInitRef NameService=file://$nsior"); +print STDERR "Starting Naming_Service\n"; +$NS->Spawn (); -sub client -{ - my $args = "-ORBInitRef NameService=file://$nsior"; - print STDERR "\nclient $args\n"; - $CL = Process::Create ($EXEPREFIX."client$EXE_EXT", $args); +if (PerlACE::waitforfile_timed ($nsior, 5) == -1) { + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; } -name_server (); +print STDERR "Starting Server\n"; +$SV->Spawn (); -server (); sleep $sleeptime; -client (); +print STDERR "Starting Client\n"; + -if ($CL->TimedWait (60) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); +$client = $CL->SpawnWaitKill (60); + +if ($client != 0) { + print STDERR "ERROR: client returned $client"; + $status = 1; } -$SV->Terminate (); if ($SV->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate server\n"; - $SV->Kill (); $SV->TimedWait (1); - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server"; + $status = 1; } -$NS->Terminate (); if ($NS->TimedWait (5) == -1) { - print STDERR "ERROR: cannot terminate naming service\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; +$nserver = $NS->TerminateWaitKill (5); + +if ($nserver != 0) { + print STDERR "ERROR: name server returned $nserver"; + $status = 1; } exit $status; diff --git a/TAO/orbsvcs/tests/Simple_Naming/client.dsp b/TAO/orbsvcs/tests/Simple_Naming/client.dsp index 27428053174..9c0e253ea70 100644 --- a/TAO/orbsvcs/tests/Simple_Naming/client.dsp +++ b/TAO/orbsvcs/tests/Simple_Naming/client.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
diff --git a/TAO/orbsvcs/tests/Simple_Naming/process-m-output.pl b/TAO/orbsvcs/tests/Simple_Naming/process-m-output.pl index ab8a0ec9b73..d962113c0ae 100755 --- a/TAO/orbsvcs/tests/Simple_Naming/process-m-output.pl +++ b/TAO/orbsvcs/tests/Simple_Naming/process-m-output.pl @@ -4,10 +4,6 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' & eval 'exec perl -S $0 $argv:q' if 0; -unshift @INC, '../../../../bin'; -require Process; -require Uniqueid; - # This is a Perl script that processes the output of the multithreaded # client test. Usage: process-m-output.pl output-file-name number-of-threads @@ -30,6 +26,8 @@ else die "Usage: process-m-output.pl output-file-name number-of-threads \n"; } +$errors = 0; + $binds = 0; $unbinds = 0; @@ -105,3 +103,5 @@ else print "Number of sucessfule binds is different from number of sucessful unbinds\n"; } + +exit $errors; diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl index a9ea5e590a9..4e5870dad99 100755 --- a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl +++ b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl @@ -8,57 +8,62 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # This is a Perl script that runs all Naming Service tests. It starts # all the servers and clients as necessary. -unshift @INC, '../../../../bin'; -require Process; -require ACEutils; -require Uniqueid; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); # Amount of delay (in seconds) between starting a server and a client # to allow proper server initialization. $sleeptime = 8; +$quiet = 0; + +# check for -q flag +if ($ARGV[0] eq '-q') { + $quiet = 1; +} + # Variables for command-line arguments to client and server # executables. -$ns_multicast_port = 10001 + uniqueid (); # Can not be 10000 on Chorus 4.0 -$ns_orb_port = 12000 + uniqueid (); -$iorfile = "$cwd$DIR_SEPARATOR" . "ns.ior"; -$persistent_ior_file = "$cwd$DIR_SEPARATOR" . "pns.ior"; -$persistent_log_file = "$cwd$DIR_SEPARATOR" . "test_log"; -$data_file = "$cwd$DIR_SEPARATOR" . "test_run.data"; +$ns_multicast_port = 10001 + PerlACE::uniqueid (); # Can not be 10000 on Chorus 4.0 +$ns_orb_port = 12000 + PerlACE::uniqueid (); +$iorfile = PerlACE::LocalFile ("ns.ior"); +$persistent_ior_file = PerlACE::LocalFile ("pns.ior"); +$persistent_log_file = PerlACE::LocalFile ("test_log"); +$data_file = PerlACE::LocalFile ("test_run.data"); -ACE::checkForTarget($cwd); +$status = 0; sub name_server { - my $args = "@_ "."-ORBnameserviceport $ns_multicast_port -o $iorfile"; - my $prog = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR". - "Naming_Service".$DIR_SEPARATOR. - "Naming_Service".$EXE_EXT; - - unlink $iorfile; - $NS = Process::Create ($prog, $args); - - if (ACE::waitforfile_timed ($iorfile, $sleeptime) == -1) { - print STDERR "ERROR: cannot find IOR file <$iorfile>\n"; - $NS->Kill (); $NS->TimedWait (1); - exit 1; - } + my $args = "@_ "."-ORBnameserviceport $ns_multicast_port -o $iorfile"; + my $prog = "../../Naming_Service/Naming_Service"; + + $NS = new PerlACE::Process ($prog, $args); + + unlink $iorfile; + + $NS->Spawn (); + + if (PerlACE::waitforfile_timed ($iorfile, $sleeptime) == -1) { + print STDERR "ERROR: cannot find IOR file <$iorfile>\n"; + $NS->Kill (); + exit 1; + } } sub client { - my $args = "@_"." "; - my $prog = $EXEPREFIX."client".$EXE_EXT; + my $args = "@_"." "; + my $prog = "client"; - $CL = Process::Create ($prog, $args); + $CL = new PerlACE::Process ($prog, $args); - $client = $CL->TimedWait (60); - if ($client == -1) { - print STDERR "ERROR: client timedout\n"; - $CL->Kill (); $CL->TimedWait (1); - } + $client = $CL->SpawnWaitKill (60); + + if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; + } } # Options for all simple tests recognized by the 'client' program. @@ -90,20 +95,15 @@ unlink $persistent_ior_file, $persistent_log_file; # Run server and client for each of the tests. Client uses ior in a # file to bootstrap to the server. -foreach $o (@opts) -{ - name_server ($server_opts[$test_number]); +foreach $o (@opts) { + name_server ($server_opts[$test_number]); - print STDERR "\n ".$comments[$test_number]; + print STDERR "\n ".$comments[$test_number]; - client ($o); + client ($o); - $NS->Terminate (); $server = $NS->TimedWait (5); - if ($server == -1) { - print STDERR "ERROR: server timedout\n"; - $NS->Kill (); $NS->TimedWait (1); - } - $test_number++; + $NS->Kill (); + $test_number++; } unlink $persistent_ior_file, $persistent_log_file; @@ -117,6 +117,10 @@ open (STDOUT, ">$data_file") or die "can't redirect stdout: $!"; open (OLDERR, ">&STDERR"); open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!"; +# just here to quiet warnings +$fh = \*OLDOUT; +$fh = \*OLDERR; + name_server (); client ("-ORBInitRef NameService=file://$iorfile", "-m15"); @@ -126,22 +130,31 @@ close (STDOUT); open (STDOUT, ">&OLDOUT"); open (STDERR, ">&OLDERR"); -$NS->Terminate (); $server = $NS->TimedWait (5); -if ($server == -1) { - print STDERR "ERROR: server timedout\n"; - $NS->Kill (); $NS->TimedWait (1); -} +$NS->Kill (); unlink $iorfile; -$FL = Process::Create ($EXEPREFIX."process-m-output.pl", - " $data_file 15"); -$filter = $FL->TimedWait (60); -if ($filter == -1) { - print STDERR "ERROR: filter timedout\n"; - $FL->Kill (); $FL->TimedWait (1); + +$errors = system ("perl process-m-output.pl $data_file 15") >> 8; + +if ($errors > 0) { + $status = 1; + + if (!$quiet) { + print STDERR "Errors Detected, printing output\n"; + if (open (DATA, "<$data_file")) { + print STDERR "================================= Begin\n"; + print STDERR <DATA>; + print STDERR "================================= End\n"; + close (DATA); + } + else { + print STDERR "ERROR: Could not open $data_file\n"; + } + unlink $data_file; + } } -print STDERR "\n"; -# @@ Capture any exit status from the processes. -exit 0; +unlink $iorfile; + +exit $status; diff --git a/TAO/orbsvcs/tests/Time/run_test.pl b/TAO/orbsvcs/tests/Time/run_test.pl index c722b9167f4..9c174e5f654 100755 --- a/TAO/orbsvcs/tests/Time/run_test.pl +++ b/TAO/orbsvcs/tests/Time/run_test.pl @@ -6,134 +6,59 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "../../../../bin"; +use PerlACE::Run_Test; -require ACEutils; -use Cwd; +$server_ior = PerlACE::LocalFile ("server_ior"); +$clerk_ior = PerlACE::LocalFile ("clerk_ior"); -$cwd = getcwd(); -$server_ior = "$cwd$DIR_SEPARATOR" . "server_ior"; -$clerk_ior = "$cwd$DIR_SEPARATOR" . "clerk_ior"; -$implrepo_ior = "$cwd$DIR_SEPARATOR" . "implrepo.ior"; $status = 0; # Make sure the files are gone, so we can wait on them. -unlink $server_ior; -unlink $clerk_ior; +unlink $server_ior, $clerk_ior; -ACE::checkForTarget($cwd); +$SV = new PerlACE::Process ("../../Time_Service/Time_Service_Server", "-o $server_ior"); +$CK = new PerlACE::Process ("../../Time_Service/Time_Service_Clerk", "-f $server_ior -o $clerk_ior -t 2"); +$CL = new PerlACE::Process ("client", "-f $clerk_ior"); -$server_program = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR"."Time_Service".$DIR_SEPARATOR."Time_Service_Server".$EXE_EXT; -$clerk_program = $EXEPREFIX."..$DIR_SEPARATOR..$DIR_SEPARATOR"."Time_Service".$DIR_SEPARATOR."Time_Service_Clerk".$EXE_EXT; -$client_program = $EXEPREFIX."client".$EXE_EXT; +$SV->Spawn (); -sub time_service_test_using_naming_service -{ - $SV1 = Process::Create ($server_program,""); - - sleep 5; +if (PerlACE::waitforfile_timed ($server_ior, 15) == -1) { + print STDERR "ERROR: cannot find file <$server_ior>\n"; + $SV->Kill (); + exit 1; +} - $SV2 = Process::Create ($clerk_program,"-t 2"); +$CK->Spawn (); - sleep 10; +if (PerlACE::waitforfile_timed ($clerk_ior, 15) == -1) { + print STDERR "ERROR: cannot find file <$clerk_ior>\n"; + $SV->Kill (); + $CK->Kill (); + exit 1; +} - $CL = Process::Create ($client_program, ""); - - if ($CL->TimedWait (60) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); - } +$client = $CL->SpawnWaitKill (60); - $SV1->Terminate (); - $SV2->Terminate (); - if ($SV1->TimedWait (5) == -1 || - $SV2->TimedWait (5) == -1) { - print STDERR "ERROR: couldn't shutdown the servers nicely\n"; - $status = 1; - $SV1->Kill (); $SV2->Kill (); - $SV1->TimedWait (1); $SV2->TimedWait (1); - } +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } -sub time_service_test_using_files -{ - $SV1 = Process::Create ($server_program, - "-o $server_ior"); - - if (ACE::waitforfile_timed ($server_ior, 15) == -1) { - print STDERR "ERROR: timedout waiting for file <$server_ior>\n"; - $status = 1; - $SV1->Kill (); $SV1->TimedWait (1); - } - else { - - sleep 5; - - $SV2 = Process::Create ($clerk_program, - "-f $server_ior -o $clerk_ior -t 2"); - - if (ACE::waitforfile_timed ($clerk_ior, 15) == -1) { - print STDERR "ERROR: timedout waiting for file <$clerk_ior>\n"; - $status = 1; - $SV2->Kill (); $SV2->TimedWait (1); - } - else { - - sleep 10; - - $CL = Process::Create ($client_program, - " -f $clerk_ior"); - if ($CL->TimedWait (60) == -1) { - print STDERR "ERROR: client timedout\n"; - $status = 1; - $CL->Kill (); $CL->TimedWait (1); - } - - $SV1->Terminate (); - $SV2->Terminate (); - if ($SV1->TimedWait (5) == -1 || - $SV2->TimedWait (5) == -1) { - print STDERR "ERROR: couldn't shutdown the servers nicely\n"; - $status = 1; - $SV1->Kill (); $SV2->Kill (); - $SV1->TimedWait (1); $SV2->TimedWait (1); - } - } - } - unlink $clerk_ior; - unlink $server_ior; +$server = $SV->TerminateWaitKill (5); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; } -# Parse the arguments - -for ($i = 0; $i <= $#ARGV; $i++) -{ - SWITCH: - { - if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") - { - print "run_test [-chorus <target>] <use_naming> or <use_files>\n"; - print "\n"; - print "-chorus <target> -- Run the test on the Chorus target\n"; - print "use_naming -- Runs the test using Naming Service\n"; - print "use_files -- Runs the test using IOR Files\n"; - exit; - } - - if ($ARGV[$i] eq "use_naming") - { - time_service_test_using_naming_service (); - last SWITCH; - } - - if ($ARGV[$i] eq "use_files") - { - time_service_test_using_files (); - last SWITCH; - } - print "run_test: Unknown Option: ".$ARGV[$i]."\n"; - } +$clerk = $CK->TerminateWaitKill (5); + +if ($clerk != 0) { + print STDERR "ERROR: clerk returned $clerk\n"; + $status = 1; } +unlink $server_ior, $clerk_ior; + exit $status; diff --git a/TAO/orbsvcs/tests/Trading/Colocated_Test.dsp b/TAO/orbsvcs/tests/Trading/Colocated_Test.dsp index 27afea15f35..b30b280888e 100644 --- a/TAO/orbsvcs/tests/Trading/Colocated_Test.dsp +++ b/TAO/orbsvcs/tests/Trading/Colocated_Test.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir ".\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
diff --git a/TAO/orbsvcs/tests/Trading/Export_Test.dsp b/TAO/orbsvcs/tests/Trading/Export_Test.dsp index eb5550928ca..f4a76f9f3f9 100644 --- a/TAO/orbsvcs/tests/Trading/Export_Test.dsp +++ b/TAO/orbsvcs/tests/Trading/Export_Test.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir ".\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
diff --git a/TAO/orbsvcs/tests/Trading/Import_Test.dsp b/TAO/orbsvcs/tests/Trading/Import_Test.dsp index 2b13596987a..43433d60623 100644 --- a/TAO/orbsvcs/tests/Trading/Import_Test.dsp +++ b/TAO/orbsvcs/tests/Trading/Import_Test.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir ".\Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
diff --git a/TAO/orbsvcs/tests/Trading/TradingLib.dsp b/TAO/orbsvcs/tests/Trading/TradingLib.dsp index 776512d4b34..9fa80964dd8 100644 --- a/TAO/orbsvcs/tests/Trading/TradingLib.dsp +++ b/TAO/orbsvcs/tests/Trading/TradingLib.dsp @@ -37,7 +37,7 @@ RSC=rc.exe # PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ""
+# PROP Output_Dir "Release"
# PROP Intermediate_Dir ".\Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
diff --git a/TAO/orbsvcs/tests/Trading/run_test.pl b/TAO/orbsvcs/tests/Trading/run_test.pl index e557bdb3ddc..2ee0d0dce60 100755 --- a/TAO/orbsvcs/tests/Trading/run_test.pl +++ b/TAO/orbsvcs/tests/Trading/run_test.pl @@ -5,70 +5,50 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../../bin'; -require ACEutils; -require Process; -use Cwd; +use lib '../../../../bin'; +use PerlACE::Run_Test; -$cwd = getcwd(); -$ior = "$cwd$DIR_SEPARATOR" . "trading.ior"; -$ready_file = "$cwd$DIR_SEPARATOR" . "export_test_ready"; +$ior = PerlACE::LocalFile ("trading.ior"); +$ready_file = PerlACE::LocalFile ("export_test_ready"); $sleeptime = 20; -$status = 0; unlink $ior; unlink $ready_file; -ACE::checkForTarget($cwd); +$TS = new PerlACE::Process ("../../Trading_Service/Trading_Service", + "-TSdumpior $ior"); +$E = new PerlACE::Process ("export_test", + "-ORBInitRef TradingService=file://$ior -quiet"); +$I = new PerlACE::Process ("import_test", + "-ORBInitRef TradingService=file://$ior -quiet"); -$TS = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR. - "..".$DIR_SEPARATOR. - "Trading_Service".$DIR_SEPARATOR. - "Trading_Service".$EXE_EXT, - " -TSdumpior $ior "); +$TS->Spawn (); -if (ACE::waitforfile_timed ($ior, $sleeptime) == -1) { - print STDERR "ERROR: waiting for trading service IOR file\n"; - $TS->Kill (); $TS->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($ior, $sleeptime) == -1) { + print STDERR "ERROR: waiting for trading service IOR file\n"; + $TS->Kill (); + exit 1; } -$E = Process::Create ($EXEPREFIX."export_test".$EXE_EXT, - "-ORBInitRef TradingService=file://$ior" - . " -quiet"); +$E->Spawn (); -if (ACE::waitforfile_timed ($ready_file, 120) == -1) { - print STDERR "ERROR: waiting for the export test to finish\n"; - $E->Kill (); $E->TimedWait (1); - $TS->Kill (); $TS->TimedWait (1); - exit 1; +if (PerlACE::waitforfile_timed ($ready_file, 120) == -1) { + print STDERR "ERROR: waiting for the export test to finish\n"; + $E->Kill (); + $TS->Kill (); + exit 1; } -$I = Process::Create ($EXEPREFIX."import_test".$EXE_EXT, - "-ORBInitRef TradingService=file://$ior" - . " -quiet"); - -if ($I->TimedWait (60) == -1) { - $status = 1; - print STDERR "ERROR: import test timedout\n"; - $I->Kill (); $I->TimedWait (1); -} - -$E->Terminate (); -if ($E->TimedWait (15) == -1) { - $status =1; - print STDERR "ERROR: export test timedout\n"; - $E->Kill (); $E->TimedWait (1); -} - -$TS->Terminate(); -if ($TS->TimedWait (15) == -1) { - print STDERR "ERROR: couldn't terminate the trading service nicely\n"; - $TS->Kill (); $TS->TimedWait (1); - $status = 1; -} +$test = $I->SpawnWaitKill (60); +$E->Kill (); +$TS->Kill (); unlink $ior; unlink $ready_file; -exit $status; +if ($test != 0) { + print STDERR "ERROR: import test returned $test\n"; + exit 1; +} + +exit 0; |