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