summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/ImplRepo
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/ImplRepo
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/ImplRepo')
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl111
-rwxr-xr-xTAO/orbsvcs/tests/ImplRepo/run_test.pl507
2 files changed, 446 insertions, 172 deletions
diff --git a/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
index 7b3fa36d070..c7ae582978f 100755
--- a/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl
@@ -6,72 +6,109 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "../../../../../bin";
-
-require ACEutils;
-use Cwd;
-
-$cwd = getcwd();
+use PerlACE::Run_Test;
################################################################################
# Program locations
-$imr_ior = "$cwd$DIR_SEPARATOR" . "imr.ior";
-$name_ior = "$cwd$DIR_SEPARATOR" . "name.ior";
-
-$imr_server = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.".."
- .$DIR_SEPARATOR."ImplRepo_Service"
- .$DIR_SEPARATOR."ImplRepo_Service".$EXE_EXT;
-
-$name_server = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.".."
- .$DIR_SEPARATOR."Naming_Service"
- .$DIR_SEPARATOR."Naming_Service".$EXE_EXT;
+$imr_ior = PerlACE::LocalFile ("imr.ior");
+$name_ior = PerlACE::LocalFile ("name.ior");
+$IMR = new PerlACE::Process ("../../../ImplRepo_Service/ImplRepo_Service");
+$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service");
if ($^O eq "MSWin32") {
- # Just find it in the path
- $tao_imr = "tao_imr".$EXE_EXT;
+ $TAO_IMR = new PerlACE::Process ("../../../../../bin/tao_imr");
}
else {
- $tao_imr = $EXEPREFIX."..".$DIR_SEPARATOR."..".$DIR_SEPARATOR.".."
- .$DIR_SEPARATOR."ImplRepo_Service"
- .$DIR_SEPARATOR."tao_imr".$EXE_EXT;
+ $TAO_IMR = new PerlACE::Process ("../../../ImplRepo_Service/tao_imr");
}
-$test = $EXEPREFIX."test".$EXE_EXT;
+$TEST = new PerlACE::Process ("test");
################################################################################
$errors = 0;
-ACE::checkForTarget($cwd);
-
unlink $imr_ior;
unlink $name_ior;
-$IR = Process::Create ($imr_server, "-o $imr_ior -d 0");
+################################################################################
+## Start the implementation Repository
+
+$IMR->Arguments ("-o $imr_ior -d 0");
+$IMR->Spawn ();
+
+if (PerlACE::waitforfile_timed ($imr_ior, 5) == -1) {
+ print STDERR "ERROR: waiting for $imr_ior\n";
+ $IMR->Kill ();
+ exit 1;
+}
-ACE::waitforfile ($imr_ior);
+################################################################################
+## Register the NameService
-system ($tao_imr." -ORBInitRef ImplRepoService=file://$imr_ior"
- ." add NameService "
- ." -c \"$name_server"
+$TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_ior"
+ . " add NameService "
+ ." -c \"" . $NS->Executable ()
." -ORBInitRef ImplRepoService=file://$imr_ior"
." -ORBUseIMR 1 .\"");
-system ($tao_imr." -ORBInitRef ImplRepoService=file://$imr_ior"
- ." ior NameService -f $name_ior");
+$taoimr = $TAO_IMR->SpawnWaitKill (60);
-if (system ($test." -ORBInitRef NameService=file://$name_ior")) {
+if ($tao_imr != 0) {
+ print STDERR "ERROR: tao_imr (add) returned $tao_imr\n";
++$errors;
}
-system ($tao_imr." -ORBInitRef ImplRepoService=file://$imr_ior"
- ." shutdown NameService ");
+################################################################################
+## Create IOR for NameService
+
+$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$imr_ior"
+ . " ior NameService -f $name_ior");
-$IR->Kill (); $IR->Wait ();
+$taoimr = $TAO_IMR->SpawnWaitKill (60);
-if ($errors > 0) {
- print "Error: run_test.pl detected $errors errors!\n";
+if ($tao_imr != 0) {
+ print STDERR "ERROR: tao_imr (ior) returned $tao_imr\n";
+ ++$errors;
}
-exit ($errors);
+
+################################################################################
+## Run the test
+
+$TEST->Arguments ("-ORBInitRef NameService=file://$name_ior");
+
+$test = $TEST->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ ++$errors;
+}
+
+
+################################################################################
+## Shutdown the NameService
+
+$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$imr_ior shutdown "
+ . "NameService ");
+
+$taoimr = $TAO_IMR->SpawnWaitKill (60);
+
+if ($tao_imr != 0) {
+ print STDERR "ERROR: tao_imr (shutdown) returned $tao_imr\n";
+ ++$errors;
+}
+
+################################################################################
+## Kill the IMR
+
+$iserver = $IMR->TerminateWaitKill (5);
+
+if ($iserver != 0) {
+ print STDERR "ERROR: IMR returned $iserver\n";
+ ++$errors;
+}
+
+exit $errors;
diff --git a/TAO/orbsvcs/tests/ImplRepo/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
index a10af6303a1..fa884460a26 100755
--- a/TAO/orbsvcs/tests/ImplRepo/run_test.pl
+++ b/TAO/orbsvcs/tests/ImplRepo/run_test.pl
@@ -6,29 +6,23 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
###############################################################################
+use lib "../../../../bin";
+use PerlACE::Run_Test;
use Cwd;
use Sys::Hostname;
use File::Copy;
-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();
+$cwd = getcwd();
- $ACE_ROOT = $ENV{ACE_ROOT};
+$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 (!defined $ACE_ROOT) {
+ chdir ('../../../../');
+ $ACE_ROOT = getcwd ();
+ chdir ($cwd);
+ print "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT\n";
}
-use lib "$ACE_ROOT/bin";
-
-use PerlACE::Run_Test;
-
$airplane_ior = PerlACE::LocalFile ("airplane.ior");
$nestea_ior = PerlACE::LocalFile ("nestea.ior");
$implrepo_ior = PerlACE::LocalFile ("implrepo.ior");
@@ -36,11 +30,12 @@ $implrepo_ior = PerlACE::LocalFile ("implrepo.ior");
$refstyle = " -ORBobjrefstyle URL";
$backing_store = "imr_backing_store";
+$nestea_dat = "nestea.dat";
$protocol = "iiop";
$host = hostname();
$port = 12345;
-$endpoint = "-ORBEndpoint" . "$protocol" . "://" . "$host" . ":" . $port;
+$endpoint = "-ORBEndpoint " . "$protocol" . "://" . "$host" . ":" . $port;
$IMR = new PerlACE::Process ("../../ImplRepo_Service/ImplRepo_Service");
@@ -65,81 +60,155 @@ unlink $airplane_ior;
unlink $nestea_ior;
unlink $implrepo_ior;
-sub convert_slash($)
-{
- $cmd = shift;
-
- $cmd =~ s/\//\\/g;
-
- return $cmd;
-}
-
# The Tests
###############################################################################
sub airplane_test
{
+ my $status = 0;
+
$A_SVR->Arguments ("-o $airplane_ior $refstyle");
$A_SVR->Spawn ();
- PerlACE::waitforfile ($airplane_ior);
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $A_SVR->Kill ();
+ return 1;
+ }
- $A_CLI->SpawnWaitKill (300);
+ my $client = $A_CLI->SpawnWaitKill (300);
+
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
- $A_SVR->Kill (); $A_SVR->Wait ();
+ my $server = $A_SVR->TerminateWaitKill (5);
+
+ if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+ }
+
+ return $status;
}
###############################################################################
sub nestea_test
{
+ my $status = 0;
+ unlink $nestea_dat;
+
$N_SVR->Arguments ("-o $nestea_ior $refstyle");
$N_SVR->Spawn ();
- PerlACE::waitforfile ($nestea_ior);
-
- $N_CLI->SpawnWaitKill (300);
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $N_SVR->Kill ();
+ return 1;
+ }
+
+ my $client = $N_CLI->SpawnWaitKill (300);
- $N_SVR->Kill (); $N_SVR->Wait ();
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+ }
+
+ $server = $N_SVR->TerminateWaitKill (5);
+
+ if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+ }
+
+ unlink $nestea_dat;
+ return $status;
}
###############################################################################
+# @todo: This test doesn't clean up too well if something fails
sub nt_service_test
{
- my $BIN_IMR = new PerlACE::Process (convert_slash ("$ACE_ROOT/bin/ImplRepo_Service"),
+ my $result = 0;
+
+ my $BIN_IMR = new PerlACE::Process ("$ACE_ROOT/bin/ImplRepo_Service",
"-c install");
print "Copying ImplRepo_Service to bin\n";
copy ($IMR->Executable (), $BIN_IMR->Executable ());
print "Installing TAO Implementation Repository Service\n";
- $BIN_IMR->SpawnWaitKill (300);
+ $result = $BIN_IMR->SpawnWaitKill (300);
+
+ if ($result != 0) {
+ print STDERR "ERROR: IMR installation returned $result\n";
+ return 1;
+ }
print "Starting TAO Implementation Repository Service\n";
- my $NET = new PerlACE::Process ($ENV{'SystemRoot'}."/System32/net",
+ my $NET = new PerlACE::Process ("net",
"start \"TAO Implementation Repository\"");
- $NET->SpawnWaitKill (300);
+ $NET->IgnoreExeSubDir (1);
+
+ $result = $NET->SpawnWaitKill (300);
+ if ($result != 0) {
+ print STDERR "ERROR: net returned $result\n";
+ return 1;
+ }
$TAO_IMR->Arguments ("add airplane_server -c \""
. $A_SVR->Executable () .
" -ORBUseIMR 1\" -w \"$ACE_ROOT/bin\"");
- $TAO_IMR->SpawnWaitKill (100);
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ return 1;
+ }
$A_SVR->Arguments ("-o $airplane_ior -ORBUseIMR 1");
$A_SVR->Spawn ();
- PerlACE::waitforfile ($airplane_ior);
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $A_SVR->Kill ();
+ return 1;
+ }
- $A_CLI->SpawnWaitKill (100);
+ $result = $A_CLI->SpawnWaitKill (100);
+
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client returned $result\n";
+ return 1;
+ }
$TAO_IMR->Arguments ("shutdown airplane_server");
- $TAO_IMR->SpawnWaitKill (100);
- $A_CLI->SpawnWaitKill (100);
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ return 1;
+ }
- $TAO_IMR->SpawnWaitKill (100);
+ $result = $A_CLI->SpawnWaitKill (100);
+
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client returned $result\n";
+ return 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ return 1;
+ }
print "Stopping TAO Implementation Repository Service\n";
$NET->Arguments ("stop \"TAO Implementation Repository\"");
@@ -150,94 +219,260 @@ sub nt_service_test
$BIN_IMR->SpawnWaitKill (300);
print "Removing ImplRepo_Service from bin\n";
- unlink ($bin_implrepo_server);
+ unlink $BIN_IMR->Executable ();
+
+ return 0;
}
###############################################################################
sub airplane_ir_test
{
+ my $status = 0;
+ my $result = 0;
+
$IMR->Arguments ("-o $implrepo_ior");
$IMR->Spawn ();
- PerlACE::waitforfile ($implrepo_ior);
+ if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $implrepo_ior\n";
+ $IMR->Kill ();
+ return 1;
+ }
$TAO_IMR->Arguments ("add airplane_server -c \""
. $A_SVR->Executable ()
. " -ORBUseIMR 1 -o $airplane_ior\"");
- $TAO_IMR->SpawnWaitKill (300);
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR->Kill ();
+ return 1;
+ }
+
$A_SVR->Arguments ("-ORBUseIMR 1 -o $airplane_ior");
$A_SVR->Spawn ();
- PerlACE::waitforfile ($airplane_ior);
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $IMR->Kill ();
+ $A_SVR->Kill ();
+ return 1;
+ }
$TAO_IMR->Arguments ("shutdown airplane_server");
- $A_CLI->SpawnWaitKill (100);
- $TAO_IMR->SpawnWaitKill (100);
- $A_CLI->SpawnWaitKill (100);
- $TAO_IMR->SpawnWaitKill (100);
+ $result = $A_CLI->SpawnWaitKill (100);
+
+ if ($result != 0) {
+ print STDERR "ERROR: airplane_client 1 returned $result\n";
+ $status = 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 1 returned $result\n";
+ $status = 1;
+ }
+
+ $result = $A_CLI->SpawnWaitKill (100);
+
+ if ($result != 0) {
+ print STDERR "ERROR: airplane_client 2 returned $result\n";
+ $status = 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 2 returned $result\n";
+ $status = 1;
+ }
- $IMR->Kill (); $IMR->Wait ();
+ my $server = $A_SVR->WaitKill (5);
+
+ if ($server != 0) {
+ print STDERR "ERROR: airplane server returned $server\n";
+ $status = 1;
+ }
+
+ my $implrepo = $IMR->TerminateWaitKill (5);
+
+ if ($implrepo != 0) {
+ print STDERR "ERROR: IMR returned $implrepo\n";
+ $status = 1;
+ }
+
+ return $status;
}
###############################################################################
sub nestea_ir_test
{
- $IMR->Arguments ("-o $implrepo_ior -d 0 $refstyle");
+ unlink $nestea_dat;
+ my $status = 0;
+ my $result = 0;
+
+ $IMR->Arguments ("-o $implrepo_ior");
$IMR->Spawn ();
- PerlACE::waitforfile ($implrepo_ior);
+ if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $implrepo_ior\n";
+ $IMR->Kill ();
+ return 1;
+ }
$TAO_IMR->Arguments ("add nestea_server -c \""
. $N_SVR->Executable ()
. " -ORBUseIMR 1 -o $nestea_ior\"");
- $TAO_IMR->SpawnWaitKill (300);
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR->Kill ();
+ return 1;
+ }
+
$N_SVR->Arguments ("-ORBUseIMR 1 -o $nestea_ior");
$N_SVR->Spawn ();
- PerlACE::waitforfile ($nestea_ior);
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $IMR->Kill ();
+ $N_SVR->Kill ();
+ return 1;
+ }
$TAO_IMR->Arguments ("shutdown nestea_server");
- $N_CLI->SpawnWaitKill (100);
- $TAO_IMR->SpawnWaitKill (100);
- $N_CLI->SpawnWaitKill (100);
- $TAO_IMR->SpawnWaitKill (100);
+ $result = $N_CLI->SpawnWaitKill (100);
+
+ if ($result != 0) {
+ print STDERR "ERROR: nestea client 1 returned $result\n";
+ $status = 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 1 returned $result\n";
+ $status = 1;
+ }
+
+ $result = $N_CLI->SpawnWaitKill (100);
+
+ if ($result != 0) {
+ print STDERR "ERROR: nestea client 2 returned $result\n";
+ $status = 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
- $IMR->Kill (); $IMR->Wait ();
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr 2 returned $result\n";
+ $status = 1;
+ }
+
+ my $server = $N_SVR->WaitKill (5);
+
+ if ($server != 0) {
+ print STDERR "ERROR: nestea server returned $server\n";
+ $status = 1;
+ }
+
+ my $implrepo = $IMR->TerminateWaitKill (5);
+
+ if ($implrepo != 0) {
+ print STDERR "ERROR: IMR returned $implrepo\n";
+ $status = 1;
+ }
+
+ unlink $nestea_dat;
+ return $status;
}
###############################################################################
sub persistent_ir_test
{
+ my $status = 0;
+ my $result = 0;
unlink $backing_store;
$IMR->Arguments ("$endpoint -o $implrepo_ior -p $backing_store -d 0");
$IMR->Spawn ();
- PerlACE::waitforfile ($implrepo_ior);
+ if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $implrepo_ior\n";
+ $IMR->Kill ();
+ return 1;
+ }
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior add airplane_server -c \"".$A_SVR->Executable ()." -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior\"");
- $TAO_IMR->SpawnWaitKill (100);
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $IMR->Kill ();
+ return 1;
+ }
$A_SVR->Arguments ("-o $airplane_ior -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior");
$A_SVR->Spawn ();
- PerlACE::waitforfile ($airplane_ior);
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $IMR->Kill ();
+ $A_SVR->Kill ();
+ return 1;
+ }
+
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown airplane_server");
+
+ $result = $A_CLI->SpawnWaitKill (100);
- $A_CLI->SpawnWaitKill (100);
- $TAO_IMR->SpawnWaitKill (100);
- $A_CLI->SpawnWaitKill (100);
- $TAO_IMR->SpawnWaitKill (100);
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client returned $result\n";
+ $status = 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $status = 1;
+ }
+
+ $result = $A_CLI->SpawnWaitKill (100);
+
+ if ($result != 0) {
+ print STDERR "ERROR: airplane client returned $result\n";
+ $status = 1;
+ }
+
+ $result = $TAO_IMR->SpawnWaitKill (30);
+
+ if ($result != 0) {
+ print STDERR "ERROR: tao_imr returned $result\n";
+ $status = 1;
+ }
+
+ $result = $A_SVR->WaitKill (10);
+
+ if ($result != 0) {
+ print STDERR "ERROR: airplane server returned $result\n";
+ $status = 1;
+ }
print "\nShutting down Implementation Repository\n\n";
- $IMR->Kill (); $IMR->Wait ();
+ $IMR->Kill ();
print "Restarting Implementation Repository.\n";
$IMR->Arguments ("$endpoint -p $backing_store -d 0");
@@ -246,9 +481,9 @@ sub persistent_ir_test
PerlACE::waitforfile ($implrepo_ior);
$A_CLI->SpawnWaitKill (100);
- $TAO_IMR->SpawnWaitKill (100);
+ $TAO_IMR->SpawnWaitKill (30);
- $IMR->Kill (); $IMR->Wait ();
+ $IMR->Kill ();
unlink $backing_store;
}
@@ -257,15 +492,20 @@ sub persistent_ir_test
sub both_ir_test
{
+ my $status = 0;
$IMR->Arguments ("-o $implrepo_ior -d 0 $refstyle");
$IMR->Spawn ();
- PerlACE::waitforfile ($implrepo_ior);
+ if (PerlACE::waitforfile_timed ($implrepo_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $implrepo_ior\n";
+ $IMR->Kill ();
+ return 1;
+ }
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior add airplane_server -c \""
. $A_SVR->Executable ()
. " -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior\"");
- $TAO_IMR->SpawnWaitKill (100);
+ $TAO_IMR->SpawnWaitKill (30);
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior"
. " add nestea_server"
@@ -273,7 +513,7 @@ sub both_ir_test
. " -ORBUseIMR 1"
. " $refstyle -ORBInitRef"
. " ImplRepoService=file://$implrepo_ior\"");
- $TAO_IMR->SpawnWaitKill (100);
+ $TAO_IMR->SpawnWaitKill (30);
$N_SVR->Arguments ("-o $nestea_ior -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior");
$N_SVR->Spawn ();
@@ -281,8 +521,21 @@ sub both_ir_test
$A_SVR->Arguments ("-o $airplane_ior -ORBUseIMR 1 $refstyle -ORBInitRef ImplRepoService=file://$implrepo_ior");
$A_SVR->Spawn ();
- PerlACE::waitforfile ($nestea_ior);
- PerlACE::waitforfile ($airplane_ior);
+ if (PerlACE::waitforfile_timed ($airplane_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $airplane_ior\n";
+ $IMR->Kill ();
+ $A_SVR->Kill ();
+ $N_SVR->Kill ();
+ return 1;
+ }
+
+ if (PerlACE::waitforfile_timed ($nestea_ior, 10) == -1) {
+ print STDERR "ERROR: cannot find $nestea_ior\n";
+ $IMR->Kill ();
+ $A_SVR->Kill ();
+ $N_SVR->Kill ();
+ return 1;
+ }
$N_CLI->Spawn ();
$A_CLI->Spawn ();
@@ -291,24 +544,24 @@ sub both_ir_test
$A_CLI->WaitKill (100);
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown nestea_server");
- $TAO_IMR->SpawnWaitKill (100);
+ $TAO_IMR->SpawnWaitKill (30);
$N_CLI->Spawn (100);
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown airplane_server");
- $TAO_IMR->SpawnWaitKill (100);
+ $TAO_IMR->SpawnWaitKill (30);
$A_CLI->SpawnWaitKill (100);
$N_CLI->WaitKill (100);
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown nestea_server");
- $TAO_IMR->SpawnWaitKill (100);
+ $TAO_IMR->SpawnWaitKill (30);
$TAO_IMR->Arguments ("-ORBInitRef ImplRepoService=file://$implrepo_ior shutdown airplane_server");
- $TAO_IMR->SpawnWaitKill (100);
+ $TAO_IMR->SpawnWaitKill (30);
- $A_SVR->Kill (); $A_SVR->Wait ();
- $N_SVR->Kill (); $N_SVR->Wait ();
- $IMR->Kill (); $IMR->Wait ();
+ $A_SVR->Kill ();
+ $N_SVR->Kill ();
+ $IMR->Kill ();
}
###############################################################################
@@ -316,58 +569,42 @@ sub both_ir_test
# Parse the arguments
-for ($i = 0; $i <= $#ARGV; $i++)
-{
- SWITCH:
- {
- if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?")
- {
- print "run_test [-chorus <target>] test\n";
- print "\n";
- print "-chorus <target> -- Runs the test on Chorus target\n";
- print "test -- Runs a specific test:\n";
- print " airplane, airplane_ir, nt_service, ",
- "nestea, nestea_ir,\n";
- print " both_ir, persistent_ir\n";
- exit;
- }
- if ($ARGV[$i] eq "airplane")
- {
- airplane_test ();
- exit;
- }
- if ($ARGV[$i] eq "airplane_ir")
- {
- airplane_ir_test ();
- exit;
- }
- if ($ARGV[$i] eq "nt_service")
- {
- nt_service_test ();
- exit;
- }
- if ($ARGV[$i] eq "nestea")
- {
- nestea_test ();
- exit;
- }
- if ($ARGV[$i] eq "nestea_ir")
- {
- nestea_ir_test ();
- exit;
- }
- if ($ARGV[$i] eq "both_ir")
- {
- both_ir_test ();
- exit;
- }
- if ($ARGV[$i] eq "persistent_ir")
- {
- persistent_ir_test ();
- exit;
- }
- print "run_test: Unknown Option: ".$ARGV[$i]."\n";
- }
+for ($i = 0; $i <= $#ARGV; $i++) {
+ if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
+ print "run_test test\n";
+ print "\n";
+ print "test -- Runs a specific test:\n";
+ print " airplane, airplane_ir, nt_service, ",
+ "nestea, nestea_ir,\n";
+ print " both_ir, persistent_ir\n";
+ exit;
+ }
+ elsif ($ARGV[$i] eq "airplane") {
+ exit airplane_test ();
+ }
+ elsif ($ARGV[$i] eq "airplane_ir") {
+ exit airplane_ir_test ();
+ }
+ elsif ($ARGV[$i] eq "nt_service") {
+ exit nt_service_test ();
+ }
+ elsif ($ARGV[$i] eq "nestea") {
+ exit nestea_test ();
+ }
+ elsif ($ARGV[$i] eq "nestea_ir") {
+ exit nestea_ir_test ();
+ }
+ elsif ($ARGV[$i] eq "both_ir") {
+ exit both_ir_test ();
+ }
+ elsif ($ARGV[$i] eq "persistent_ir") {
+ exit persistent_ir_test ();
+ }
+ else {
+ print "run_test: Unknown Option: ".$ARGV[$i]."\n";
+ }
}
-both_ir_test ();
+# if nothing else, run both_ir
+
+exit both_ir_test ();