diff options
Diffstat (limited to 'TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl')
-rwxr-xr-x | TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl b/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl index d30448d76ba..13aee01facd 100755 --- a/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/benchmark/run_test.pl @@ -5,61 +5,76 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -$tao_root = $ENV{TAO_ROOT}; -# This is a Perl script that runs the Naming Service, client and servers - unshift @INC, '../../../../../bin'; require Process; -require Uniqueid; +require ACEutils; # amount of delay between running the servers $sleeptime = 6; $status = 0; +local $nsior = "ns.ior"; # variables for parameters -$nsport = 20000 + uniqueid (); sub name_server { - my $args = "-ORBnameserviceport $nsport"; - my $prog = "$tao_root/orbsvcs/Naming_Service/Naming_Service " - .$EXE_EXT; - print ("\nNaming_Service: $prog$EXE_EXT $args\n"); + my $args = "-o $nsior"; + my $prog = "..".$DIR_SEPARATOR + ."..".$DIR_SEPARATOR + ."..".$DIR_SEPARATOR + ."Naming_Service".$DIR_SEPARATOR + ."Naming_Service ".$EXE_EXT; + print ("\nNaming_Service $args\n"); $NS = Process::Create ($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 = "-ORBnameserviceport $nsport"; - print ("\nServer: server$EXE_EXT $args\n"); - $SV = Process::Create ('.' . $DIR_SEPARATOR . "server " .$EXE_EXT, $args); + my $args = "-ORBNameServiceIOR file://$nsior"; + print ("\nServer: $args\n"); + $SV = Process::Create (".".$DIR_SEPARATOR."server".$EXE_EXT, $args); } sub client { - my $args = "-ORBnameserviceport $nsport"; - print ("\nclient: client $args\n"); - $CL = Process::Create ('.' . $DIR_SEPARATOR . "client " .$EXE_EXT, $args); + my $args = "-ORBNameServiceIOR file://$nsior"; + print ("\nclient: $args\n"); + $CL = Process::Create (".".$DIR_SEPARATOR."client".$EXE_EXT, $args); } name_server (); -sleep $sleeptime; server (); + sleep $sleeptime; client (); + if ($CL->TimedWait (60) == -1) { print STDERR "ERROR: client timedout\n"; $status = 1; $CL->Kill (); $CL->TimedWait (1); } -$NS->Kill (); $NS->TimedWait (1); -$SV->Kill (); $SV->TimedWait (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; +} + +$NS->Terminate (); if ($NS->TimedWait (5) == -1) { + print STDERR "ERROR: cannot terminate naming service\n"; + $NS->Kill (); $NS->TimedWait (1); + exit 1; +} + exit $status; - |