summaryrefslogtreecommitdiff
path: root/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl')
-rwxr-xr-xTAO/tests/NestedUpcall/MT_Client_Test/run_test.pl77
1 files changed, 42 insertions, 35 deletions
diff --git a/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl b/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl
index a75bf048920..951f7db9774 100755
--- a/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl
+++ b/TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl
@@ -5,60 +5,67 @@ 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;
-$ior1file = PerlACE::LocalFile ("server1.ior");
-$ior2file = PerlACE::LocalFile ("server2.ior");
+$cwd = getcwd();
+$ior1file = "$cwd$DIR_SEPARATOR" . "server1.ior";
+$ior2file = "$cwd$DIR_SEPARATOR" . "server2.ior";
+
+ACE::checkForTarget($cwd);
# Make sure the files are gone
unlink $ior1file;
unlink $ior2file;
-$SV1 = new PerlACE::Process ("server", "-o $ior1file");
-$SV2 = new PerlACE::Process ("server", "-o $ior2file");
-$CL = new PerlACE::Process ("client", "-f $ior1file -g $ior2file -n 2 -i 10 -s 5");
-
-$SV1->Spawn ();
-$SV2->Spawn ();
+$SV1 = Process::Create ($EXEPREFIX."server".$EXE_EXT,
+ " -o $ior1file ");
-if (PerlACE::waitforfile_timed ($ior1file, 5) == -1) {
+if (ACE::waitforfile_timed ($ior1file, 5) == -1) {
print STDERR "ERROR: cannot find file <$ior1file>\n";
- $SV1->Kill ();
- $SV2->Kill ();
+ $SV1->Kill (); $SV1->TimedWait (1);
exit 1;
}
-if (PerlACE::waitforfile_timed ($ior2file, 5) == -1) {
- print STDERR "ERROR: cannot find file <$ior2file>\n";
- $SV1->Kill ();
- $SV2->Kill ();
+$SV2 = Process::Create ($EXEPREFIX."server".$EXE_EXT,
+ " -o $ior2file ");
+
+if (ACE::waitforfile_timed ($ior2file, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$ior1file>\n";
+ $SV2->Kill (); $SV2->TimedWait (1);
exit 1;
}
-$client = $CL->SpawnWaitKill (60);
+$CL = Process::Create ($EXEPREFIX."client".$EXE_EXT,
+ " -f $ior1file -g $ior2file -n 2 -i 10 -s 5");
-$server1 = $SV1->TerminateWaitKill (5);
-$server2 = $SV2->TerminateWaitKill (5);
-
-# Clean up
-unlink $ior1file;
-unlink $ior2file;
+$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;
+$SV1->Terminate (); $server1 = $SV1->TimedWait (5);
+if ($server1 == -1) {
+ print STDERR "ERROR: cannot terminate server1\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
}
-if ($server1 != 0) {
- print STDERR "ERROR: server 1 returned $server1\n";
- $status = 1;
+$SV2->Terminate (); $server1 = $SV2->TimedWait (5);
+if ($server2 == -1) {
+ print STDERR "ERROR: cannot terminate server2\n";
+ $SV2->Kill (); $SV2->TimedWait (1);
}
-if ($server2 != 0) {
- print STDERR "ERROR: server 2 returned $server2\n";
- $status = 1;
+# Clean up
+unlink $ior1file;
+unlink $ior2file;
+
+if ($client == -1 || $server1 == -1 || $server2 == -1) {
+ exit 1;
}
-exit $status;
+exit 0;