diff options
Diffstat (limited to 'TAO/tests/AMI_Timeouts/run_test.pl')
-rwxr-xr-x | TAO/tests/AMI_Timeouts/run_test.pl | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/TAO/tests/AMI_Timeouts/run_test.pl b/TAO/tests/AMI_Timeouts/run_test.pl index d0ae0e34092..e6596d067a3 100755 --- a/TAO/tests/AMI_Timeouts/run_test.pl +++ b/TAO/tests/AMI_Timeouts/run_test.pl @@ -5,47 +5,38 @@ 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(); -$client_process="client"; - -ACE::checkForTarget($cwd); - -$iorfile = "server.ior"; +$status = 0; +$iorfile = PerlACE::LocalFile ("server.ior"); unlink $iorfile; -$SV = Process::Create ($EXEPREFIX."server$EXE_EXT", - " -d -o $iorfile"); -if (ACE::waitforfile_timed ($iorfile, 20) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} +$SV = new PerlACE::Process ("server", "-d -o $iorfile"); +$CL = new PerlACE::Process ("client", "-k file://$iorfile"); -$CL = Process::Create ($EXEPREFIX."client$EXE_EXT", - " -k file://$iorfile "); +$SV->Spawn (); -$client = $CL->TimedWait (60); -if ($client == -1) { - print STDERR "ERROR: client timedout\n"; - $CL->Kill (); $CL->TimedWait (1); +if (PerlACE::waitforfile_timed ($iorfile, 20) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $SV->Kill (); + exit 1; } -$server = $SV->TimedWait (5); -if ($server == -1) { - print STDERR "ERROR: server timedout\n"; - $SV->Kill (); $SV->TimedWait (1); -} +$client = $CL->SpawnWaitKill (120); +$server = $SV->TerminateWaitKill (5); unlink $iorfile; -if ($server != 0 || $client != 0) { - exit 1; +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; } - -exit 0; - + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +exit $status; |