diff options
Diffstat (limited to 'TAO/tests/OctetSeq/run_test.pl')
-rwxr-xr-x | TAO/tests/OctetSeq/run_test.pl | 69 |
1 files changed, 29 insertions, 40 deletions
diff --git a/TAO/tests/OctetSeq/run_test.pl b/TAO/tests/OctetSeq/run_test.pl index b79ea5331fe..a574ed6ef0e 100755 --- a/TAO/tests/OctetSeq/run_test.pl +++ b/TAO/tests/OctetSeq/run_test.pl @@ -5,62 +5,51 @@ 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; +$iorfile = PerlACE::LocalFile ("test.ior"); -print STDERR "\n\n==== Octet sequence passing test\n"; +unlink $iorfile; + +$SV = new PerlACE::Process ("server", "-o $iorfile"); +$CL = new PerlACE::Process ("client", "-i 5000 -k file://$iorfile"); +$T = new PerlACE::Process ("OctetSeq", "-n 32 -l 8192 -h 8192 -s 1 -q"); -$file="$cwd$DIR_SEPARATOR" . "test.ior"; +print STDERR "\n\n==== Octet sequence passing test\n"; -unlink $file; +$SV->Spawn (); -$SV = Process::Create ($EXEPREFIX."server".$EXE_EXT, - "-o $file"); -if (ACE::waitforfile_timed ($file, 15) == -1) { - print STDERR "ERROR: cannot find file <$file>\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."client".$EXE_EXT, - " -i 5000 -k file://$file"); +$client = $CL->SpawnWaitKill (120); -$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; } -$server = $SV->TimedWait (5); -if ($server == -1) { - print STDERR "ERROR: server timedout\n"; - $SV->Kill (); $SV->TimedWait (1); -} +$server = $SV->WaitKill (5); -if ($client == -1 || $server == -1) { - exit 1; +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; } -unlink $file; - print STDERR "\n\n==== Octet sequence performance test\n"; -$T = Process::Create ($EXEPREFIX."OctetSeq$EXE_EXT", - " -n 32 -l 8192 -h 8192 -s 1 -q"); +$test = $T->SpawnWaitKill (60); -$client = $T->TimedWait (60); -if ($client == -1) { - print STDERR "ERROR: test timedout\n"; - $T->Kill (); $T->TimedWait (1); +if ($test != 0) { + print STDERR "ERROR: test returned $test\n"; + $status = 1; } -if ($client == -1) { - exit 1; -} +unlink $iorfile; -exit 0; +exit $status; |