summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/InterfaceRepo
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-03-05 03:23:49 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-03-05 03:23:49 +0000
commit84fe5584b4e402d9c75973163ebd441032497744 (patch)
tree8bb327569be3f54d7ca99ad830c1c991170ea28d /TAO/orbsvcs/tests/InterfaceRepo
parentd39fec54c8f8f970b913d8fcc5d219532dc21cae (diff)
downloadATCD-84fe5584b4e402d9c75973163ebd441032497744.tar.gz
ChangeLogTag:Sun Mar 4 19:12:59 2001 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'TAO/orbsvcs/tests/InterfaceRepo')
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl115
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl88
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl119
3 files changed, 144 insertions, 178 deletions
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
index 69c35f0f832..78da7eee3b2 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl
@@ -6,94 +6,87 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "../../../../../bin";
+use PerlACE::Run_Test;
-require ACEutils;
-use Cwd;
+$status = 0;
-BEGIN {
- ### We need to BEGIN this block so we make sure ACE_ROOT is set before
- ### we use it in the use lib line
- $cwd = getcwd();
+$ifr_iorfile= "if_repo.ior";
+$svr_iorfile = "iorfile";
+$test_idl = PerlACE::LocalFile ("test.idl");
- $ACE_ROOT = $ENV{ACE_ROOT};
-
- if (!$ACE_ROOT) {
- chdir ('../../../../');
- $ACE_ROOT = getcwd ();
- chdir ($cwd);
- print "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT\n";
- }
+if ($^O eq "MSWin32") {
+ $tao_ifr = "../../../../../bin/tao_ifr";
+}
+else {
+ $tao_ifr = "../../../IFR_Service/tao_ifr";
}
-use lib "$ACE_ROOT/bin";
+$TAO_IFR = new PerlACE::Process ($tao_ifr);
+$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service");
+$SV = new PerlACE::Process ("server");
+$CL = new PerlACE::Process ("client", "-ORBInitRef InterfaceRepository=file://$ifr_iorfile");
-ACE::checkForTarget($cwd);
+unlink $ifr_iorfile;
+unlink $svr_iorfile;
-$if_repo_service = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.
- "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR.
- "IFR_Service".$EXE_EXT;
+$IFR->Spawn ();
+if (PerlACE::waitforfile_timed ($ifr_iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$ifr_iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
+}
-$init_ref =
- "-ORBInitRef InterfaceRepository=file://if_repo.ior";
+$SV->Spawn ();
-if ($^O eq "MSWin32") {
- ### It is in the path
- $tao_ifr = "tao_ifr".$EXE_EXT;
-}
-else {
- $tao_ifr = "$ACE_ROOT/TAO/orbsvcs/IFR_Service/tao_ifr".$EXE_EXT;
+if (PerlACE::waitforfile_timed ($svr_iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$svr_iorfile>\n";
+ $IFR->Kill ();
+ $SV->Kill ();
+ exit 1;
}
-$ifr_iorfile = "$cwd$DIR_SEPARATOR" . "if_repo.ior";
-$svr_iorfile = "$cwd$DIR_SEPARATOR" . "iorfile";
+$TAO_IFR->Arguments ($test_idl);
-unlink $ifr_iorfile;
-unlink $svr_iorfile;
+$tresult = $TAO_IFR->SpawnWaitKill (30);
-$IFR = Process::Create ($if_repo_service);
+if ($tresult != 0) {
+ print STDERR "ERROR: tao_ifr (test.idl) returned $tresult\n";
+ $status = 1;
+}
+
+$client = $CL->SpawnWaitKill (60);
-if (ACE::waitforfile_timed ($ifr_iorfile, 15) == -1)
-{
- print STDERR "ERROR: cannot find file <$ifr_iorfile>\n";
- $IFR->Kill ();
- $IFR->TimedWait (1);
- exit 1;
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
}
-$SV = Process::Create ($EXEPREFIX."server".$EXE_EXT);
+$server = $SV->TerminateWaitKill (5);
-if (ACE::waitforfile_timed ($svr_iorfile, 15) == -1)
-{
- print STDERR "ERROR: cannot find file <$svr_iorfile>\n";
- $SV->Kill ();
- $SV->TimedWait (1);
- exit 1;
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
}
-system ($tao_ifr." test.idl");
+$TAO_IFR->Arguments ("-r $test_idl");
-$CL = Process::Create ($EXEPREFIX."client".$EXE_EXT,
- " $init_ref");
+$tresult = $TAO_IFR->SpawnWaitKill (30);
-$client = $CL->TimedWait (60);
-if ($client == -1)
-{
- print STDERR "ERROR: client timedout\n";
- $CL->Kill ();
- $CL->TimedWait (1);
+if ($tresult != 0) {
+ print STDERR "ERROR: tao_ifr (-r test.idl) returned $tresult\n";
+ $status = 1;
}
-$SV->Kill ();
-$SV->TimedWait (1);
+$server = $IFR->TerminateWaitKill (5);
-system ($tao_ifr." -r test.idl");
-
-$IFR->Kill ();
-$IFR->TimedWait (1);
+if ($server != 0) {
+ print STDERR "ERROR: IFR returned $server\n";
+ $status = 1;
+}
unlink $ifr_iorfile;
unlink $svr_iorfile;
-exit 0;
+exit $status;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl
index bf81ece0806..03b00dcb3fb 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl
@@ -6,82 +6,66 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "../../../../../bin";
-
-require ACEutils;
-use Cwd;
-
-$cwd = getcwd();
-ACE::checkForTarget($cwd);
+use PerlACE::Run_Test;
$locking = "-m";
-$if_repo_server = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.
- "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR.
- "IFR_Service".$EXE_EXT, " $locking";
-
-
-$init_ref =
- "-ORBInitRef InterfaceRepository=file://if_repo.ior";
+$iorfile = "if_repo.ior";
-$iorfile = "$cwd$DIR_SEPARATOR" . "if_repo.ior";
+$status = 0;
$debug = "";
$test = "";
$iterations = "";
$other = "";
-for ($i = 0; $i <= $#ARGV; $i++)
-{
- SWITCH:
- {
- if ($ARGV[$i] eq "-d")
- {
- $debug = "-d";
- last SWITCH;
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-d") {
+ $debug = "-d";
}
- if ($ARGV[$i] eq "-t")
- {
- $test = "-t ".$ARGV[$i + 1];
- $i++;
- last SWITCH;
+ elsif ($ARGV[$i] eq "-t") {
+ $test = "-t ".$ARGV[$i + 1];
+ $i++;
}
- if ($ARGV[$i] eq "-i")
- {
- $iterations = "-i ".$ARGV[$i + 1];
- $i++;
- last SWITCH;
+ elsif ($ARGV[$i] eq "-i") {
+ $iterations = "-i ".$ARGV[$i + 1];
+ $i++;
+ }
+ else {
+ $other .= $ARGV[$i];
}
- $other .= $ARGV[$i];
- }
}
unlink $iorfile;
-$SV = Process::Create ($if_repo_server);
+$SV = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " $locking");
+$CL = new PerlACE::Process ("IFR_Test",
+ "-ORBInitRef InterfaceRepository=file://$iorfile"
+ . " $debug $test $iterations");
+
+$SV->Spawn ();
-if (ACE::waitforfile_timed ($iorfile, 15) == -1)
-{
- print STDERR "ERROR: cannot find file <$iorfile>\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."IFR_Test".$EXE_EXT,
- " $init_ref $debug $test $iterations");
+$client = $CL->SpawnWaitKill (60);
-$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;
}
-$SV->Kill ();
-$SV->TimedWait (1);
+$server = $SV->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
unlink $iorfile;
-exit 0;
+exit $status;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
index 3d569d52833..f6f3fd38b8f 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl
@@ -6,103 +6,92 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "../../../../../bin";
-
-require ACEutils;
-use Cwd;
-
-$cwd = getcwd();
-ACE::checkForTarget($cwd);
+use PerlACE::Run_Test;
$persistent = "-p";
-$ifr_service = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.
- "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR.
- "IFR_Service".$EXE_EXT, " $persistent";
+$status = 0;
-$init_ref =
- "-ORBInitRef InterfaceRepository=file://if_repo.ior";
+$iorfile = "if_repo.ior";
+$backing_file = PerlACE::LocalFile ("ifr_default_backing_store");
-$iorfile = "$cwd$DIR_SEPARATOR" . "if_repo.ior";
-$backing_file = "$cwd$DIR_SEPARATOR" . "ifr_default_backing_store";
+$init_ref = "-ORBInitRef InterfaceRepository=file://$iorfile";
$debug = "";
$query_opt = "-q";
$other = "";
-for ($i = 0; $i <= $#ARGV; $i++)
-{
- SWITCH:
- {
- if ($ARGV[$i] eq "-d")
- {
- $debug = "-d";
- last SWITCH;
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-d") {
+ $debug = "-d";
+ }
+ else {
+ $other .= $ARGV[$i];
}
- $other .= $ARGV[$i];
- }
}
unlink $iorfile;
unlink $backing_file;
-print "\t IFR Persistence Test\n\n";
+print STDERR "\t IFR Persistence Test\n\n";
+
+$IFR = new PerlACE::Process ("../../../IFR_Service/IFR_Service", $persistent);
+$T = new PerlACE::Process ("Persistence_Test");
-$NEW_IFR = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.
- "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR.
- "IFR_Service".$EXE_EXT, " $persistent");
+$IFR->Spawn ();
-if (ACE::waitforfile_timed ($iorfile, 15) == -1)
-{
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $NEW_IFR->Kill ();
- $NEW_IFR->TimedWait (1);
- exit 1;
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
}
-$POPULATE = Process::Create ($EXEPREFIX."Persistence_Test".$EXE_EXT,
- " $init_ref");
+$T->Arguments ($init_ref);
-$populate = $POPULATE->TimedWait (60);
-if ($populate == -1)
-{
- print STDERR "ERROR: populate timedout\n";
- $POPULATE->Kill ();
- $POPULATE->TimedWait (1);
+$test = $T->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: populate test returned $test\n";
+ $status = 1;
}
-$NEW_IFR->Kill ();
-$NEW_IFR->TimedWait (1);
+$server = $IFR->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: IFR returned $server\n";
+ $status = 1;
+}
unlink $iorfile;
-$FILE_IFR = Process::Create ($EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.
- "..".$DIR_SEPARATOR."IFR_Service".$DIR_SEPARATOR.
- "IFR_Service".$EXE_EXT, " $persistent");
+$IFR->Spawn ();
-if (ACE::waitforfile_timed ($iorfile, 15) == -1)
-{
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $FILE_IFR->Kill ();
- $FILE_IFR->TimedWait (1);
- exit 1;
+if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $IFR->Kill ();
+ exit 1;
}
-$QUERY = Process::Create ($EXEPREFIX."Persistence_Test".$EXE_EXT,
- " $init_ref $debug $query_opt");
+$T->Arguments ("$init_ref $debug $query_opt");
-$query = $QUERY->TimedWait (60);
-if ($query == -1)
-{
- print STDERR "ERROR: query timedout\n";
- $QUERY->Kill ();
- $QUERY->TimedWait (1);
+
+$test = $T->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: query test returned $test\n";
+ $status = 1;
}
-$FILE_IFR->Kill ();
-$FILE_IFR->TimedWait (1);
-#unlink $iorfile;
-#unlink $backing_file;
+$server = $IFR->TerminateWaitKill (5);
+
+if ($server != 0) {
+ print STDERR "ERROR: IFR returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+unlink $backing_file;
-exit 0;
+exit $status;