summaryrefslogtreecommitdiff
path: root/TAO/tests/Endpoint_Per_Priority
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/Endpoint_Per_Priority')
-rwxr-xr-xTAO/tests/Endpoint_Per_Priority/run_test.pl75
1 files changed, 37 insertions, 38 deletions
diff --git a/TAO/tests/Endpoint_Per_Priority/run_test.pl b/TAO/tests/Endpoint_Per_Priority/run_test.pl
index 32243503eb3..55e25503fb7 100755
--- a/TAO/tests/Endpoint_Per_Priority/run_test.pl
+++ b/TAO/tests/Endpoint_Per_Priority/run_test.pl
@@ -5,58 +5,57 @@ 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;
+
+$client_conf = PerlACE::LocalFile ("client.conf");
+$server_conf = PerlACE::LocalFile ("server.conf");
+$iorfile = PerlACE::LocalFile ("test.ior");
-$cwd = getcwd();
-$client_conf="$cwd$DIR_SEPARATOR" . "client.conf";
-$server_conf="$cwd$DIR_SEPARATOR" . "server.conf";
$threads='2';
-$iorfile = "$cwd$DIR_SEPARATOR" . "test.ior";
+$status = 0;
+
+unlink $iorfile;
-ACE::checkForTarget($cwd);
+$SV = new PerlACE::Process ("server",
+ "-ORBSvcConf $server_conf"
+ . " -ORBEndPoint iiop://localhost:0/priority=0 "
+ . " -ORBEndPoint iiop://localhost:0/priority=1 "
+ . " -ORBEndPoint iiop://localhost:0/priority=2 "
+ . " -ORBEndPoint iiop://localhost:0/priority=3 "
+ . " -ORBEndPoint iiop://localhost:0/priority=4 "
+ . " -o $iorfile -n $threads");
+
+$CL = new PerlACE::Process ("client",
+ "-ORBSvcConf $client_conf "
+ . " -k file://$iorfile "
+ . " -t 0 -t 1 -i 1000");
print STDERR "================ Multi-threaded test\n";
-unlink $iorfile;
+$SV->Spawn ();
-$SV = Process::Create ($EXEPREFIX."server$EXE_EXT ",
- " -ORBSvcConf $server_conf"
- . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=0 "
- . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=1 "
- . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=2 "
- . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=3 "
- . " -ORBEndPoint iiop://$TARGETHOSTNAME:0/priority=4 "
- . " -o $iorfile -n $threads");
-
-if (ACE::waitforfile_timed ($iorfile, 10) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $SV->Kill (); $SV->TimedWait (1);
- exit 1;
+if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
}
-$CL = Process::Create ($EXEPREFIX."client$EXE_EXT ",
- " -ORBSvcConf $client_conf "
- . " -k file://$iorfile "
- . " -t 0 -t 1 -i 1000");
-$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;
}
-$server = $SV->TimedWait (60);
+$server = $SV->WaitKill (60);
+
if ($server == -1) {
- print STDERR "ERROR: server timedout\n";
- $SV->Kill (); $SV->TimedWait (1);
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
}
unlink $iorfile;
-if ($server != 0 || $client != 0) {
- exit 1;
-}
-
-exit 0;
+exit $status;