summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Simple_Naming
diff options
context:
space:
mode:
authordbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-10 14:55:15 +0000
committerdbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-10 14:55:15 +0000
commit700ea534efb30aadcb3047d29ce2224b0a8fc33b (patch)
tree491459741233b96ab8e99ce236ecdd0e6e613a6d /TAO/orbsvcs/tests/Simple_Naming
parent57bd63125871db38d1f4977a0deb00e4d54db018 (diff)
downloadATCD-700ea534efb30aadcb3047d29ce2224b0a8fc33b.tar.gz
Thu Dec 10 14:54:27 UTC 2009 Denis Budko <denis.budko@remedy.nl>
* orbsvcs/tests/Simple_Naming/run_test_ipv6.pl: * orbsvcs/tests/Simple_Naming/run_test_ffp.pl: * orbsvcs/tests/Simple_Naming/run_test.pl: * orbsvcs/tests/Security/ssliop_corbaloc/run_test.pl: * orbsvcs/tests/Redundant_Naming/run_test.pl: * orbsvcs/tests/ImplRepo/Bug_689_Regression/run_test.pl: * orbsvcs/tests/ImplRepo/NameService/run_test.pl: * orbsvcs/tests/Bug_3444_Regression/run_test_ipv6.pl: * orbsvcs/tests/Bug_3444_Regression/run_test.pl: * orbsvcs/examples/ImR/Advanced/TestServer.cpp: * orbsvcs/examples/ImR/Advanced/server_main.cpp: * orbsvcs/examples/ImR/Advanced/TestServer.h: * orbsvcs/examples/ImR/Advanced/TestClient.cpp: * orbsvcs/examples/ImR/Advanced/manager_main.cpp: * orbsvcs/examples/ImR/Advanced/TestClient.h: * orbsvcs/examples/ImR/Advanced/run_test.pl: * tests/Bug_1635_Regression/run_test.pl: * tests/Bug_1628_Regression/run_test.pl: Tests are converted to use new test framework and added to fuzz build.
Diffstat (limited to 'TAO/orbsvcs/tests/Simple_Naming')
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test.pl129
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl100
-rwxr-xr-xTAO/orbsvcs/tests/Simple_Naming/run_test_ipv6.pl129
3 files changed, 192 insertions, 166 deletions
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
index 1faec988917..99274a33e35 100755
--- a/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test.pl
@@ -10,10 +10,12 @@ 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::Run_Test;
+use PerlACE::TestTarget;
use Cwd;
## Save the starting directory
+$status = 0;
+$multicast = '224.9.9.2';
$startdir = getcwd();
$quiet = 0;
@@ -23,30 +25,46 @@ if ($ARGV[0] eq '-q') {
$quiet = 1;
}
+my $test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
# Variables for command-line arguments to client and server
# executables.
-$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");
+$ns_multicast_port = 10001 + $test->RandomPort(); # Can not be 10000 on Chorus 4.0
+$ns_orb_port = 12000 + $test->RandomPort();
-$status = 0;
+$iorfile = "ns.ior";
+$persistent_ior_file = "pns.ior";
+$persistent_log_file = "test_log";
+
+$data_file = "test_run.data";
+
+$test_log = $test->LocalFile ($data_file);
+$test->DeleteFile ($data_file);
+
+#Files which used by test
+my $test_iorfile = $test->LocalFile ($iorfile);
+my $test_persistent_log_file = $test->LocalFile ($persistent_log_file);
+my $test_persistent_ior_file = $test->LocalFile ($persistent_ior_file);
+
+$test->DeleteFile($persistent_ior_file);
+$test->DeleteFile($iorfile);
+$test->DeleteFile($persistent_log_file);
sub name_server
{
- my $args = "-ORBMulticastDiscoveryEndpoint 224.9.9.2:$ns_multicast_port -o $iorfile -m 1 @_";
+ my $args = "-ORBMulticastDiscoveryEndpoint $multicast:$ns_multicast_port -o $test_iorfile -m 1 @_";
my $prog = "$startdir/../../Naming_Service/Naming_Service";
- $NS = new PerlACE::Process ($prog, $args);
- unlink $iorfile;
+ $SV = $test->CreateProcess ("$prog", "$args");
- $NS->Spawn ();
+ $test->DeleteFile($iorfile);
- if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
- $NS->Kill ();
+ $SV->Spawn ();
+
+ if ($test->WaitForFileTimed ($iorfile,
+ $test->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$test_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
exit 1;
}
}
@@ -56,14 +74,15 @@ sub client
my $args = "@_"." ";
my $prog = "$startdir/client";
- $CL = new PerlACE::Process ($prog, $args);
+ $CL = $test->CreateProcess ("$prog", "$args");
- $client = $CL->SpawnWaitKill (60);
+ $client_status = $CL->SpawnWaitKill ($test->ProcessStartWaitInterval() + 45);
- if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
+ if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
$status = 1;
}
+
}
## The options below have been reordered due to a
@@ -71,20 +90,22 @@ 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://$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",
+@opts = ("-s -ORBInitRef NameService=file://$test_iorfile",
+ "-p $test_persistent_ior_file -ORBInitRef NameService=file://$test_iorfile",
+ "-s -ORBInitRef NameService=mcast://$multicast:$ns_multicast_port\::/NameService",
+ "-t -ORBInitRef NameService=file://$test_iorfile",
+ "-i -ORBInitRef NameService=file://$test_iorfile",
+ "-e -ORBInitRef NameService=file://$test_iorfile",
+ "-y -ORBInitRef NameService=file://$test_iorfile",
+ "-c file://$test_persistent_ior_file -ORBInitRef NameService=file://$test_iorfile",
);
+$hostname = $test->HostName ();
+
@server_opts = ("-t 30",
- "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
+ "-ORBEndpoint iiop://$hostname:$ns_orb_port -f $test_persistent_log_file",
"", "", "", "", "",
- "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
+ "-ORBEndpoint iiop://$hostname:$ns_orb_port -f $test_persistent_log_file",
);
@comments = ("Simple Test: \n",
@@ -106,17 +127,15 @@ $test_number = 0;
## directory is NFS mounted from a system that does not properly support
## locking.
foreach my $possible ($ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP}) {
- if (defined $possible && -d $possible) {
- if (chdir($possible)) {
- last;
+ if (defined $possible && -d $possible) {
+ if (chdir($possible)) {
+ last;
+ }
}
- }
}
print "INFO: Running the test in ", getcwd(), "\n";
-unlink ($persistent_ior_file, $persistent_log_file);
-
# Run server and client for each of the tests. Client uses ior in a
# file to bootstrap to the server.
foreach $o (@opts) {
@@ -126,7 +145,7 @@ foreach $o (@opts) {
client ($o);
- $NS->Kill ();
+ $SV->Kill ();
## For some reason, only on Windows XP, we need to
## wait before starting another Naming_Service when
@@ -134,59 +153,43 @@ foreach $o (@opts) {
if ($^O eq "MSWin32") {
sleep(1);
}
-
$test_number++;
}
-unlink ($persistent_ior_file, $persistent_log_file);
+$test->DeleteFile($persistent_ior_file);
+$test->DeleteFile($persistent_log_file);
+$test->DeleteFile($iorfile);
# Now run the multithreaded test, sending output to the file.
print STDERR "\n Multithreaded Test:\n";
-unlink $data_file;
-
-open (OLDOUT, ">&STDOUT");
-open (STDOUT, ">$data_file") or die "can't redirect stdout: $!";
-open (OLDERR, ">&STDERR");
-open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!";
-
-# just here to quiet warnings
-$fh = \*OLDOUT;
-$fh = \*OLDERR;
+$test->DeleteFile ($data_file);
name_server ();
+client ("-ORBInitRef NameService=file://$test_iorfile -ORBLogFile $test_log", "-m15");
-client ("-ORBInitRef NameService=file://$iorfile", "-m15");
-
-close (STDERR);
-close (STDOUT);
-open (STDOUT, ">&OLDOUT");
-open (STDERR, ">&OLDERR");
-
-$NS->Kill ();
-
-unlink $iorfile;
+$SV->Kill ();
-$errors = system ("perl $startdir/process-m-output.pl $data_file 15") >> 8;
+$errors = system ("perl $startdir/process-m-output.pl $test_log 15") >> 8;
if ($errors > 0) {
$status = 1;
if (!$quiet) {
print STDERR "Errors Detected, printing output\n";
- if (open (DATA, "<$data_file")) {
+ if (open (DATA, "<$test_log")) {
print STDERR "================================= Begin\n";
print STDERR <DATA>;
print STDERR "================================= End\n";
close (DATA);
}
else {
- print STDERR "ERROR: Could not open $data_file\n";
+ print STDERR "ERROR: Could not open $test_log\n";
}
- unlink $data_file;
+ $test->DeleteFile ($data_file);
}
}
-unlink $iorfile;
+$test->DeleteFile($iorfile);
exit $status;
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
index fc085c22c60..75d04a4e2fa 100755
--- a/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl
@@ -5,13 +5,15 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# $Id$
# -*- perl -*-
-# This is a Perl script that runs additional Naming Service tests.
+# This is a Perl script that runs additional Naming Service tests.
# It runs all the tests that will *not* run with min CORBA.
# It starts all the servers and clients as necessary.
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
+## Save the starting directory
+$status = 0;
$quiet = 0;
# check for -q flag
@@ -19,28 +21,41 @@ if ($ARGV[0] eq '-q') {
$quiet = 1;
}
+my $test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
# Variables for command-line arguments to client and server
# executables.
-$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");
-$file_persistent_ior_file = PerlACE::LocalFile ("fpns.ior");
+$ns_multicast_port = 10001 + $test->RandomPort(); # Can not be 10000 on Chorus 4.0
+$ns_orb_port = 12000 + $test->RandomPort();
-$status = 0;
+$iorfile = "ns.ior";
+$persistent_ior_file = "fpns.ior";
+
+
+$iorfile = "ns.ior";
+$persistent_ior_file = "pns.ior";
+
+my $test_iorfile = $test->LocalFile ($iorfile);
+my $test_persistent_ior_file = $test->LocalFile ($persistent_ior_file);
+
+$test->DeleteFile($iorfile);
+$test->DeleteFile($persistent_ior_file);
sub name_server
{
- my $args = "-ORBNameServicePort $ns_multicast_port -o $iorfile -m 1 @_";
+ my $args = "-ORBNameServicePort $ns_multicast_port -o $test_iorfile -m 1 @_";
my $prog = "../../Naming_Service/Naming_Service";
- $NS = new PerlACE::Process ($prog, $args);
- unlink $iorfile;
+ $SV = $test->CreateProcess ("$prog", "$args");
- $NS->Spawn ();
+ $test->DeleteFile($iorfile);
- if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
- $NS->Kill ();
+ $SV->Spawn ();
+
+ if ($test->WaitForFileTimed ($iorfile,
+ $test->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$test_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
exit 1;
}
}
@@ -50,12 +65,12 @@ sub client
my $args = "@_"." ";
my $prog = "client";
- $CL = new PerlACE::Process ($prog, $args);
+ $CL = $test->CreateProcess ("$prog", "$args");
- $client = $CL->SpawnWaitKill (60);
+ $client_status = $CL->SpawnWaitKill ($test->ProcessStartWaitInterval() + 45);
- if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
+ if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
$status = 1;
}
}
@@ -65,13 +80,16 @@ sub client
## that has only been seen on Windows XP.
# Options for all simple tests recognized by the 'client' program.
-@opts = ("-p $file_persistent_ior_file -ORBInitRef NameService=file://$iorfile",
- "-c file://$file_persistent_ior_file -ORBInitRef NameService=file://$iorfile",
- "-l file://$file_persistent_ior_file -ORBInitRef NameService=file://$iorfile");
+@opts = ("-p $test_persistent_ior_file -ORBInitRef NameService=file://$test_iorfile",
+ "-c file://$test_persistent_ior_file -ORBInitRef NameService=file://$test_iorfile",
+ "-l file://$test_persistent_ior_file -ORBInitRef NameService=file://$test_iorfile");
+
+$hostname = $test->HostName ();
-@server_opts = ("-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -u NameService",
- "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -u NameService",
- "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -u NameService");
+@server_opts = ("-ORBEndpoint iiop://$hostname:$ns_orb_port -u NameService",
+ "-ORBEndpoint iiop://$hostname:$ns_orb_port -u NameService",
+ "-ORBEndpoint iiop://$hostname:$ns_orb_port -u NameService"
+ );
@comments = ("Flat File Persistent Test (Part 1): \n",
"Flat File Persistent Test (Part 2): \n",
@@ -79,20 +97,21 @@ sub client
$test_number = 0;
-unlink ($file_persistent_ior_file);
+$test->DeleteFile($test_persistent_ior_file);
if ( ! -d "NameService" ) {
- mkdir (NameService, 0777);
- }
+ mkdir (NameService, 0777);
+}
else {
- chdir "NameService";
- opendir(THISDIR, ".");
- @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
- closedir(THISDIR);
- unlink @allfiles;
- chdir "..";
- }
-
+ chdir "NameService";
+ opendir(THISDIR, ".");
+ @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
+ closedir(THISDIR);
+ foreach $tmp (@allfiles){
+ $test->DeleteFile ($tmp);
+ }
+ chdir "..";
+}
# Run server and client for each of the tests. Client uses ior in a
# file to bootstrap to the server.
@@ -103,7 +122,7 @@ foreach $o (@opts) {
client ($o);
- $NS->Kill ();
+ $SV->Kill ();
## For some reason, only on Windows XP, we need to
## wait before starting another Naming_Service when
@@ -115,16 +134,17 @@ foreach $o (@opts) {
$test_number++;
}
-unlink ($file_persistent_ior_file);
-
chdir "NameService";
opendir(THISDIR, ".");
@allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
closedir(THISDIR);
-unlink @allfiles;
+foreach $tmp (@allfiles){
+ $test->DeleteFile ($tmp);
+}
chdir "..";
rmdir "NameService";
-unlink $iorfile;
+$test->DeleteFile($persistent_ior_file);
+$test->DeleteFile($iorfile);
exit $status;
diff --git a/TAO/orbsvcs/tests/Simple_Naming/run_test_ipv6.pl b/TAO/orbsvcs/tests/Simple_Naming/run_test_ipv6.pl
index 129a20a081a..78a1742d6a7 100755
--- a/TAO/orbsvcs/tests/Simple_Naming/run_test_ipv6.pl
+++ b/TAO/orbsvcs/tests/Simple_Naming/run_test_ipv6.pl
@@ -10,10 +10,12 @@ 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::Run_Test;
+use PerlACE::TestTarget;
use Cwd;
## Save the starting directory
+$status = 0;
+$multicast = "[ff01::ff01:1]";
$startdir = getcwd();
$quiet = 0;
@@ -23,30 +25,46 @@ if ($ARGV[0] eq '-q') {
$quiet = 1;
}
+my $test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
# Variables for command-line arguments to client and server
# executables.
-$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");
+$ns_multicast_port = 10001 + $test->RandomPort(); # Can not be 10000 on Chorus 4.0
+$ns_orb_port = 12000 + $test->RandomPort();
-$status = 0;
+$iorfile = "ns.ior";
+$persistent_ior_file = "pns.ior";
+$persistent_log_file = "test_log";
+
+$data_file = "test_run.data";
+
+$test_log = $test->LocalFile ($data_file);
+$test->DeleteFile ($data_file);
+
+#Files which used by test
+my $test_iorfile = $test->LocalFile ($iorfile);
+my $test_persistent_log_file = $test->LocalFile ($persistent_log_file);
+my $test_persistent_ior_file = $test->LocalFile ($persistent_ior_file);
+
+$test->DeleteFile($iorfile);
+$test->DeleteFile($persistent_log_file);
+$test->DeleteFile($persistent_ior_file);
sub name_server
{
- my $args = "-ORBMulticastDiscoveryEndpoint [ff01::ff01:1]:$ns_multicast_port -o $iorfile -m 1 @_";
+ my $args = "-ORBMulticastDiscoveryEndpoint $multicast:$ns_multicast_port -o $test_iorfile -m 1 @_";
my $prog = "$startdir/../../Naming_Service/Naming_Service";
- $NS = new PerlACE::Process ($prog, $args);
- unlink $iorfile;
+ $SV = $test->CreateProcess ("$prog", "$args");
- $NS->Spawn ();
+ $test->DeleteFile($iorfile);
- if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find IOR file <$iorfile>\n";
- $NS->Kill ();
+ $SV->Spawn ();
+
+ if ($test->WaitForFileTimed ($iorfile,
+ $test->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$test_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
exit 1;
}
}
@@ -56,14 +74,15 @@ sub client
my $args = "@_"." ";
my $prog = "$startdir/client";
- $CL = new PerlACE::Process ($prog, $args);
+ $CL = $test->CreateProcess ("$prog", "$args");
- $client = $CL->SpawnWaitKill (60);
+ $client_status = $CL->SpawnWaitKill ($test->ProcessStartWaitInterval() + 45);
- if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
+ if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
$status = 1;
}
+
}
## The options below have been reordered due to a
@@ -71,20 +90,22 @@ 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://$iorfile",
- "-p $persistent_ior_file -ORBInitRef NameService=file://$iorfile",
- "-s -ORBInitRef NameService=mcast://[ff01::ff01:1]:$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",
+@opts = ("-s -ORBInitRef NameService=file://$test_iorfile",
+ "-p $test_persistent_ior_file -ORBInitRef NameService=file://$test_iorfile",
+ "-s -ORBInitRef NameService=mcast://$multicast:$ns_multicast_port\::/NameService",
+ "-t -ORBInitRef NameService=file://$test_iorfile",
+ "-i -ORBInitRef NameService=file://$test_iorfile",
+ "-e -ORBInitRef NameService=file://$test_iorfile",
+ "-y -ORBInitRef NameService=file://$test_iorfile",
+ "-c file://$test_persistent_ior_file -ORBInitRef NameService=file://$test_iorfile",
);
+$hostname = $test->HostName ();
+
@server_opts = ("-t 30",
- "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
+ "-ORBEndpoint iiop://$hostname:$ns_orb_port -f $test_persistent_log_file",
"", "", "", "", "",
- "-ORBEndpoint iiop://$TARGETHOSTNAME:$ns_orb_port -f $persistent_log_file",
+ "-ORBEndpoint iiop://$hostname:$ns_orb_port -f $test_persistent_log_file",
);
@comments = ("Simple Test: \n",
@@ -106,17 +127,15 @@ $test_number = 0;
## directory is NFS mounted from a system that does not properly support
## locking.
foreach my $possible ($ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP}) {
- if (defined $possible && -d $possible) {
- if (chdir($possible)) {
- last;
+ if (defined $possible && -d $possible) {
+ if (chdir($possible)) {
+ last;
+ }
}
- }
}
print "INFO: Running the test in ", getcwd(), "\n";
-unlink ($persistent_ior_file, $persistent_log_file);
-
# Run server and client for each of the tests. Client uses ior in a
# file to bootstrap to the server.
foreach $o (@opts) {
@@ -126,7 +145,7 @@ foreach $o (@opts) {
client ($o);
- $NS->Kill ();
+ $SV->Kill ();
## For some reason, only on Windows XP, we need to
## wait before starting another Naming_Service when
@@ -134,59 +153,43 @@ foreach $o (@opts) {
if ($^O eq "MSWin32") {
sleep(1);
}
-
$test_number++;
}
-unlink ($persistent_ior_file, $persistent_log_file);
+$test->DeleteFile($persistent_ior_file);
+$test->DeleteFile($persistent_log_file);
+$test->DeleteFile($iorfile);
# Now run the multithreaded test, sending output to the file.
print STDERR "\n Multithreaded Test:\n";
-unlink $data_file;
-
-open (OLDOUT, ">&STDOUT");
-open (STDOUT, ">$data_file") or die "can't redirect stdout: $!";
-open (OLDERR, ">&STDERR");
-open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!";
-
-# just here to quiet warnings
-$fh = \*OLDOUT;
-$fh = \*OLDERR;
+$test->DeleteFile ($data_file);
name_server ();
+client ("-ORBInitRef NameService=file://$test_iorfile -ORBLogFile $test_log", "-m15");
-client ("-ORBInitRef NameService=file://$iorfile", "-m15");
-
-close (STDERR);
-close (STDOUT);
-open (STDOUT, ">&OLDOUT");
-open (STDERR, ">&OLDERR");
-
-$NS->Kill ();
-
-unlink $iorfile;
+$SV->Kill ();
-$errors = system ("perl $startdir/process-m-output.pl $data_file 15") >> 8;
+$errors = system ("perl $startdir/process-m-output.pl $test_log 15") >> 8;
if ($errors > 0) {
$status = 1;
if (!$quiet) {
print STDERR "Errors Detected, printing output\n";
- if (open (DATA, "<$data_file")) {
+ if (open (DATA, "<$test_log")) {
print STDERR "================================= Begin\n";
print STDERR <DATA>;
print STDERR "================================= End\n";
close (DATA);
}
else {
- print STDERR "ERROR: Could not open $data_file\n";
+ print STDERR "ERROR: Could not open $test_log\n";
}
- unlink $data_file;
+ $test->DeleteFile ($data_file);
}
}
-unlink $iorfile;
+$test->DeleteFile($iorfile);
exit $status;