summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
diff options
context:
space:
mode:
authordbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-30 12:27:09 +0000
committerdbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-30 12:27:09 +0000
commitfcab440f8f67559d09bf8873cdc544a4fe63036d (patch)
tree0fba79d7557b34f6b867adce936f24ae08a22875 /TAO/orbsvcs/tests/Simple_Naming/run_test.pl
parent5f47a136f6f5d2a47314037ab6bbf8dc06cc5ce3 (diff)
downloadATCD-fcab440f8f67559d09bf8873cdc544a4fe63036d.tar.gz
Mon Nov 30 12:26:32 UTC 2009 Denis Budko <denis.budko@remedy.nl>
* orbsvcs/tests/Simple_Naming/run_test.pl: * orbsvcs/tests/AVStreams/Full_Profile/run_test.pl: * tests/Oneway_Timeouts/run_test.pl: * tests/Parallel_Connect_Strategy/run_test.pl: * tests/Muxed_GIOP_Versions/run_test.pl: * tests/InterOp-Naming/run_test.pl: * bin/tao_other_tests.lst: Test are converted to use new test framework and added to fuzz build.
Diffstat (limited to 'TAO/orbsvcs/tests/Simple_Naming/run_test.pl')
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test.pl87
1 files changed, 31 insertions, 56 deletions
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
index 325c7c708ad..1faec988917 100755
--- a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
@@ -10,7 +10,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# It starts all the servers and clients as necessary.
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::TestTarget;
+use PerlACE::Run_Test;
use Cwd;
## Save the starting directory
@@ -23,52 +23,30 @@ if ($ARGV[0] eq '-q') {
$quiet = 1;
}
-my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
-my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
-
# Variables for command-line arguments to client and server
# executables.
-$ns_multicast_port = 10001 + $client->RandomPort(); # Can not be 10000 on Chorus 4.0
-$ns_orb_port = 12000 + $server->RandomPort();
-
-$iorfile = "ns.ior";
-$persistent_ior_file = "pns.ior";
-$persistent_log_file = "test_log";
-$data_file = "test_run.data";
-
-my $server_iorfile = $server->LocalFile ($iorfile);
-my $client_iorfile = $client->LocalFile ($iorfile);
-$server->DeleteFile($iorfile);
-$client->DeleteFile($iorfile);
+$ns_multicast_port = 10001 + PerlACE::uniqueid (); # Can not be 10000 on Chorus 4.0
+$ns_orb_port = 12000 + PerlACE::uniqueid ();
+$iorfile = PerlACE::LocalFile ("ns.ior");
+$persistent_ior_file = PerlACE::LocalFile ("pns.ior");
+$persistent_log_file = PerlACE::LocalFile ("test_log");
+$data_file = PerlACE::LocalFile ("test_run.data");
$status = 0;
sub name_server
{
- my $args = "-ORBMulticastDiscoveryEndpoint 224.9.9.2:$server_ns_multicast_port -o $server_iorfile -m 1 @_";
+ my $args = "-ORBMulticastDiscoveryEndpoint 224.9.9.2:$ns_multicast_port -o $iorfile -m 1 @_";
my $prog = "$startdir/../../Naming_Service/Naming_Service";
-
- $SV = $server->CreateProcess ("$prog", "$args");
+ $NS = new PerlACE::Process ($prog, $args);
- $server->DeleteFile($server_iorfile);
+ unlink $iorfile;
- $SV->Spawn ();
+ $NS->Spawn ();
- if ($server->WaitForFileTimed ($iorfile,
- $server->ProcessStartWaitInterval()) == -1) {
- print STDERR "ERROR: cannot find file <$server_iorfile>\n";
- $SV->Kill (); $SV->TimedWait (1);
- exit 1;
- }
-
- if ($server->GetFile ($iorfile) == -1) {
- print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
- $SV->Kill (); $SV->TimedWait (1);
- exit 1;
- }
- if ($client->PutFile ($iorfile) == -1) {
- print STDERR "ERROR: cannot set file <$client_iorfile>\n";
- $SV->Kill (); $SV->TimedWait (1);
+ if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
+ $NS->Kill ();
exit 1;
}
}
@@ -78,15 +56,14 @@ sub client
my $args = "@_"." ";
my $prog = "$startdir/client";
- $CL = $client->CreateProcess ("$prog", "$args");
+ $CL = new PerlACE::Process ($prog, $args);
- $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
+ $client = $CL->SpawnWaitKill (60);
- if ($client_status != 0) {
- print STDERR "ERROR: client returned $client_status\n";
+ if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
$status = 1;
}
-
}
## The options below have been reordered due to a
@@ -94,22 +71,20 @@ sub client
## that has only been seen on Windows XP.
# Options for all simple tests recognized by the 'client' program.
-@opts = ("-s -ORBInitRef NameService=file://$client_iorfile",
- "-p $persistent_ior_file -ORBInitRef NameService=file://$client_iorfile",
- "-s -ORBInitRef NameService=mcast://224.9.9.2:$client_ns_multicast_port\::/NameService",
- "-t -ORBInitRef NameService=file://$client_iorfile",
- "-i -ORBInitRef NameService=file://$client_iorfile",
- "-e -ORBInitRef NameService=file://$client_iorfile",
- "-y -ORBInitRef NameService=file://$client_iorfile",
- "-c file://$client_persistent_ior_file -ORBInitRef NameService=file://$client_iorfile",
+@opts = ("-s -ORBInitRef NameService=file://$iorfile",
+ "-p $persistent_ior_file -ORBInitRef NameService=file://$iorfile",
+ "-s -ORBInitRef NameService=mcast://224.9.9.2:$ns_multicast_port\::/NameService",
+ "-t -ORBInitRef NameService=file://$iorfile",
+ "-i -ORBInitRef NameService=file://$iorfile",
+ "-e -ORBInitRef NameService=file://$iorfile",
+ "-y -ORBInitRef NameService=file://$iorfile",
+ "-c file://$persistent_ior_file -ORBInitRef NameService=file://$iorfile",
);
-$hostname = $server->HostName ();
-
@server_opts = ("-t 30",
- "-ORBEndpoint iiop://$hostname:$server_ns_orb_port -f $server_persistent_log_file",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
"", "", "", "", "",
- "-ORBEndpoint iiop://$hostname:$server_ns_orb_port -f $server_persistent_log_file",
+ "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
);
@comments = ("Simple Test: \n",
@@ -151,7 +126,7 @@ foreach $o (@opts) {
client ($o);
- $SV->Kill ();
+ $NS->Kill ();
## For some reason, only on Windows XP, we need to
## wait before starting another Naming_Service when
@@ -180,14 +155,14 @@ $fh = \*OLDERR;
name_server ();
-client ("-ORBInitRef NameService=file://$client_iorfile", "-m15");
+client ("-ORBInitRef NameService=file://$iorfile", "-m15");
close (STDERR);
close (STDOUT);
open (STDOUT, ">&OLDOUT");
open (STDERR, ">&OLDERR");
-$SV->Kill ();
+$NS->Kill ();
unlink $iorfile;