summaryrefslogtreecommitdiff
path: root/TAO/tests/DSI_Gateway/run_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/DSI_Gateway/run_test.pl')
-rwxr-xr-xTAO/tests/DSI_Gateway/run_test.pl84
1 files changed, 45 insertions, 39 deletions
diff --git a/TAO/tests/DSI_Gateway/run_test.pl b/TAO/tests/DSI_Gateway/run_test.pl
index a455f66c991..8f23c17c497 100755
--- a/TAO/tests/DSI_Gateway/run_test.pl
+++ b/TAO/tests/DSI_Gateway/run_test.pl
@@ -5,60 +5,66 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
# -*- perl -*-
-use lib '../../../bin';
-use PerlACE::Run_Test;
+unshift @INC, '../../../bin';
+require ACEutils;
+use Cwd;
-$svfile = PerlACE::LocalFile ("server.ior");
-$gwfile = PerlACE::LocalFile ("gateway.ior");
+$cwd = getcwd();
+ACE::checkForTarget($cwd);
+$svfile = "$cwd$DIR_SEPARATOR" . "server.ior";
unlink $svfile;
-unlink $gwfile;
-
-$status = 0;
-
-$SV = new PerlACE::Process ("server", "-o $svfile");
-$GW = new PerlACE::Process ("gateway", "-k file://$svfile -o $gwfile");
-$CL = new PerlACE::Process ("client", "-k file://$gwfile -x -i 100");
+$SV = Process::Create ($EXEPREFIX."server$EXE_EXT ",
+ " -o $svfile");
-$SV->Spawn ();
-
-if (PerlACE::waitforfile_timed ($svfile, 5) == -1) {
- print STDERR "ERROR: cannot find file <$svfile>\n";
- $SV->Kill ();
- exit 1;
+if (ACE::waitforfile_timed ($svfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$svfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
}
-$GW->Spawn ();
-
-if (PerlACE::waitforfile_timed ($gwfile, 5) == -1) {
- print STDERR "ERROR: cannot find file <$gwfile>\n";
- $SV->Kill ();
- $GW->Kill ();
- exit 1;
+$gwfile = "$cwd$DIR_SEPARATOR" . "gateway.ior";
+unlink $gwfile;
+$GW = Process::Create ($EXEPREFIX."gateway$EXE_EXT ",
+ " -k file://$svfile"
+ . " -o $gwfile");
+
+if (ACE::waitforfile_timed ($gwfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$gwfile>\n";
+ $GW->Kill (); $GW->TimedWait (1);
+ exit 1;
}
-$client = $CL->SpawnWaitKill (60);
+$CL = Process::Create ($EXEPREFIX."client$EXE_EXT ",
+ " -k file://$gwfile -x"
+ . " -i 100");
-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);
-
-if ($server != 0) {
- print STDERR "ERROR: server returned $server\n";
- $status = 1;
+$server = $SV->TimedWait (5);
+if ($server == -1) {
+ print STDERR "ERROR: server timedout\n";
+ $SV->Kill (); $SV->TimedWait (1);
}
-$gateway = $GW->WaitKill (5);
-
-if ($gateway != 0) {
- print STDERR "ERROR: gateway returned $gateway\n";
- $status = 1;
+$gateway = $GW->TimedWait (5);
+if ($gateway == -1) {
+ print STDERR "ERROR: server timedout\n";
+ $GW->Kill (); $GW->TimedWait (1);
}
unlink $svfile;
unlink $gwfile;
-exit $status;
+if ($server != 0
+ || $gateway != 0
+ || $client != 0) {
+ print STDERR "ERROR: test failed <$server,$gateway,$client>\n";
+ exit 1;
+}
+
+exit 0;