summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Property/run_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Property/run_test.pl')
-rwxr-xr-xTAO/orbsvcs/tests/Property/run_test.pl50
1 files changed, 31 insertions, 19 deletions
diff --git a/TAO/orbsvcs/tests/Property/run_test.pl b/TAO/orbsvcs/tests/Property/run_test.pl
index 1ae787f3bbb..1d1d651a5a1 100755
--- a/TAO/orbsvcs/tests/Property/run_test.pl
+++ b/TAO/orbsvcs/tests/Property/run_test.pl
@@ -5,12 +5,9 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
# -*- perl -*-
-$tao_root = $ENV{TAO_ROOT};
-# This is a Perl script that runs the Naming Service, client and servers
-
unshift @INC, '../../../../bin';
require Process;
-require Uniqueid;
+require ACEutils;
# amount of delay between running the servers
@@ -19,41 +16,46 @@ $status = 0;
# variables for parameters
-$nsport = 20000 + uniqueid ();
+$nsior = "ns.ior";
+
sub name_server
{
- my $args = "-ORBnameserviceport $nsport";
- my $prog = "$tao_root/orbsvcs/Naming_Service/Naming_Service"
- .$EXE_EXT;
- print ("\nNaming_Service: $prog$EXE_EXT $args\n");
- $NS = Process::Create ($prog, $args);
+ my $args = " -o $nsior";
+ my $prog =
+ print ("\nNaming_Service: $args\n");
+ $NS = Process::Create ("..".$DIR_SEPARATOR
+ ."..".$DIR_SEPARATOR
+ ."Naming_Service".$DIR_SEPARATOR
+ ."Naming_Service".$EXE_EXT, $args);
+ if (ACE::waitforfile_timed ($nsior, 5) == -1) {
+ print STDERR "ERROR: cannot find naming service IOR file\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+ }
}
sub server
{
- my $args = "-ORBnameserviceport $nsport";
- print ("\nServer: server$EXE_EXT $args\n");
+ my $args = "-ORBNameServiceIOR file://$nsior";
+ print ("\nServer $args\n");
$SV = Process::Create ($EXEPREFIX."server$EXE_EXT", $args);
}
sub client
{
- my $args = "-ORBnameserviceport $nsport";
- print ("\nclient: client $args\n");
+ my $args = "-ORBNameServiceIOR file://$nsior";
+ print ("\nclient $args\n");
$CL = Process::Create ($EXEPREFIX."client$EXE_EXT", $args);
}
name_server ();
-sleep $sleeptime;
server ();
sleep $sleeptime;
client ();
-sleep $sleeptime;
-
if ($CL->TimedWait (60) == -1) {
print STDERR "ERROR: client timedout\n";
@@ -61,8 +63,18 @@ if ($CL->TimedWait (60) == -1) {
$CL->Kill (); $CL->TimedWait (1);
}
-$NS->Kill (); $NS->TimedWait (1);
-$SV->Kill (); $NS->TimedWait (1);
+$SV->Terminate (); if ($SV->TimedWait (5) == -1) {
+ print STDERR "ERROR: cannot terminate server\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+
+$NS->Terminate (); if ($NS->TimedWait (5) == -1) {
+ print STDERR "ERROR: cannot terminate naming service\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
exit $status;