summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog13
-rw-r--r--TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp10
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl92
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl4
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl4
5 files changed, 76 insertions, 47 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 403b5efc217..c2e497e374d 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,16 @@
+Fri Dec 17 13:03:03 2004 Chad Elliott <elliott_c@ociweb.com>
+
+ * orbsvcs/tests/Bug_1395_Regression/Test_i.cpp:
+ * orbsvcs/tests/Bug_1395_Regression/run_test.pl:
+
+ Fixed this test to restart the server after restarting the
+ locator so that the server can find the locator's new IOR.
+
+ * orbsvcs/tests/Bug_1436_Regression/run_test.pl:
+ * orbsvcs/tests/Bug_1437_Regression/run_test.pl:
+
+ Fixed some bugs in my file handle dup'ing code.
+
Fri Dec 17 10:38:53 2004 Chad Elliott <elliott_c@ociweb.com>
* orbsvcs/tests/Bug_1436_Regression/run_test.pl:
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp b/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp
index a95c59b5348..80c9d22d553 100644
--- a/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/Test_i.cpp
@@ -54,6 +54,15 @@ Test_i::try_and_create_POA (ACE_ENV_SINGLE_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
}
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ // A transient exception exception may be expected,
+ // so we won't print out the word exception but we
+ // will let the user know that a transient exception occurred
+ ACE_DEBUG ((LM_DEBUG,
+ "CORBA::TRANSIENT in Test_i::try_and_create_POA\n"));
+ return 1;
+ }
ACE_CATCHANY
{
ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
@@ -61,7 +70,6 @@ Test_i::try_and_create_POA (ACE_ENV_SINGLE_ARG_DECL)
return 1;
}
ACE_ENDTRY;
- ACE_CHECK_RETURN (1);
return 0;
}
diff --git a/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
index 26d9a6aed1c..caaa4a2f5b0 100755
--- a/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl
@@ -11,15 +11,8 @@ use PerlACE::Run_Test;
# The location of the implementation repository binaries
$imr_bin_path = "../../ImplRepo_Service";
-# The location of the tao_imr IMR utility
-if ($^O eq "MSWin32")
-{
- $tao_imr_bin_path = "../../../../bin";
-}
-else
-{
- $tao_imr_bin_path = $imr_bin_path;
-}
+# The location of the tao_imr IMR utility
+$tao_imr_bin_path = "../../../../bin";
# IOR file names
$imr_ior_file = PerlACE::LocalFile("impl.ior");
@@ -41,32 +34,32 @@ sub test_body
unlink $imr_ior_file;
unlink $activator_ior_file;
unlink $server_ior_file;
-
+
# Start the IMR locator to generate an IOR file for the server to use...
$LOCATOR->Arguments("-o $imr_ior_file -ORBEndpoint iiop://:$port");
$LOCATOR->Spawn ();
-
- if (PerlACE::waitforfile_timed ($imr_ior_file, 10) == -1)
+
+ if (PerlACE::waitforfile_timed ($imr_ior_file, 10) == -1)
{
print STDERR "ERROR: cannot find $imr_ior_file\n";
$LOCATOR->Kill ();
return 1;
}
-
- # ...then shut it down so that the server will not be able to contact it
+
+ # ...then shut it down so that the server will not be able to contact it
$LOCATOR->TerminateWaitKill (5);
-
- if ($imr_locator != 0)
+
+ if ($imr_locator != 0)
{
print STDERR "ERROR: IMR returned $imr_locator\n";
$status = 1;
}
-
+
# Start our server
$SERVER->Arguments("-o $server_ior_file -ORBInitRef ImplRepoService=file://$imr_ior_file -ORBUseIMR 1");
$SERVER->Spawn ();
-
- if (PerlACE::waitforfile_timed ($server_ior_file, 10) == -1)
+
+ if (PerlACE::waitforfile_timed ($server_ior_file, 10) == -1)
{
print STDERR "ERROR: cannot find $server_ior_file\n";
$ACTIVATOR->Kill ();
@@ -74,31 +67,31 @@ sub test_body
$SERVER->Kill ();
return 1;
}
-
+
# Use the client to ask the server to try and create a persitent POA
# We expect this to 'fail' as the IMR is dead
$CLIENT->Arguments("-k file://$server_ior_file");
$result = $CLIENT->SpawnWaitKill (30);
-
- if ($result == 0)
+
+ if ($result == 0)
{
print STDERR "ERROR: First create POA attempt succeeded when it shouldn't have done\n";
$SERVER->Kill ();
return 1;
}
-
+
# Now we restart the IMR locator
unlink $imr_ior_file;
$LOCATOR->Arguments("-o $imr_ior_file -ORBEndpoint iiop://:$port");
$LOCATOR->Spawn ();
-
- if (PerlACE::waitforfile_timed ($imr_ior_file, 10) == -1)
+
+ if (PerlACE::waitforfile_timed ($imr_ior_file, 10) == -1)
{
print STDERR "ERROR: cannot find $imr_ior_file\n";
$LOCATOR->Kill ();
return 1;
}
-
+
# Work out the IMR activator command line.
# Use the '-a' switch if this is a regression for bug #1394, else not
if ($use_tao_imr_util != 0)
@@ -106,22 +99,37 @@ sub test_body
$activator_arguments = "-o $activator_ior_file -ORBInitRef ImplRepoService=file://$imr_ior_file";
}
else
- {
+ {
$activator_arguments = "-o $activator_ior_file -a -ORBInitRef ImplRepoService=file://$imr_ior_file";
}
-
+
# Start up the activator
$ACTIVATOR->Arguments ($activator_arguments);
$ACTIVATOR->Spawn ();
-
- if (PerlACE::waitforfile_timed ($activator_ior_file, 10) == -1)
+
+ if (PerlACE::waitforfile_timed ($activator_ior_file, 10) == -1)
{
print STDERR "ERROR: cannot find $activator_ior_file\n";
$ACTIVATOR->Kill ();
$LOCATOR->Kill ();
return 1;
}
-
+
+ ## Since we have restarted the locator, we need to restart
+ ## the server so that it can pick up the new locator IOR
+ unlink($server_ior_file);
+ $SERVER->Kill ();
+ $SERVER->Spawn ();
+
+ if (PerlACE::waitforfile_timed ($server_ior_file, 10) == -1)
+ {
+ print STDERR "ERROR: cannot find $server_ior_file\n";
+ $ACTIVATOR->Kill ();
+ $LOCATOR->Kill ();
+ $SERVER->Kill ();
+ return 1;
+ }
+
# If this is just a regression for bug #1395 we need to register the POA
# If it is a regression for enhancement bug #1394, we don't need to.
if ($use_tao_imr_util != 0)
@@ -129,8 +137,8 @@ sub test_body
# Add the persistent POA name to the IMR
$TAO_IMR->Arguments("add MyPoa -ORBInitRef ImplRepoService=file://$imr_ior_file");
$result = $TAO_IMR->SpawnWaitKill (30);
-
- if ($result != 0)
+
+ if ($result != 0)
{
print STDERR "ERROR: tao_imr returned $result\n";
$ACTIVATOR->Kill ();
@@ -138,12 +146,12 @@ sub test_body
return 1;
}
}
-
+
# Use the client to tell the server to attempt to create the POA again
$CLIENT->Arguments("-k file://$server_ior_file");
$result = $CLIENT->SpawnWaitKill (30);
-
- if ($result != 0)
+
+ if ($result != 0)
{
print STDERR "ERROR: Second create POA attempt failed when it should have succeeded\n";
$SERVER->Kill ();
@@ -151,17 +159,17 @@ sub test_body
$LOCATOR->Kill ();
return 1;
}
-
+
# Tidy up
$SERVER->TerminateWaitKill (5);
$ACTIVATOR->TerminateWaitKill (5);
$LOCATOR->TerminateWaitKill (5);
return 0;
-}
+}
# Run regression for bug #1395
$use_tao_imr_util = 1;
-$test_result = test_body();
+$test_result = test_body();
if ($test_result != 0)
{
print STDERR "ERROR: Regression test for Bug #1395 failed\n";
@@ -175,13 +183,13 @@ if ($test_result != 0)
# Uncomment the following to activate regression after submission and ..
# Run regression for bug #1394
#$use_tao_imr_util = 0;
-#$test_result = test_body();
+#$test_result = test_body();
#if ($test_result != 0)
#{
-# print STDERR "ERROR: Regression test for Bug #1394 failed\n";
+# print STDERR "ERROR: Regression test for Bug #1394 failed\n";
#}
unlink $imr_ior_file;
unlink $activator_ior_file;
-unlink $server_ior_file;
+unlink $server_ior_file;
exit $test_result;
diff --git a/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
index d151187c6a4..3f1ec813550 100755
--- a/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
@@ -43,7 +43,7 @@ sub test_body
# Redirect STDERR to a log file so that
# we can make sure that we got a warning
- open(STDERR, '>&SAVEERR');
+ open(SAVEERR, ">&STDERR");
open(STDERR, ">$result_file");
$TAO_IFR->Arguments("-ORBInitRef InterfaceRepository=file://$ifr_ior_file -Cw $idl_file");
@@ -51,7 +51,7 @@ sub test_body
# Close the log file and restore STDERR
close(STDERR);
- open(SAVEERR, '>&STDERR');
+ open(STDERR, ">&SAVEERR");
if (! -r $result_file) {
print STDERR "ERROR: cannot find $result_file\n";
diff --git a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
index e3c0a7306a6..536258b9a52 100755
--- a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
@@ -63,7 +63,7 @@ sub test_body
# Redirect STDERR to a log file so that the ERROR
# message does not get printed to the terminal
- open(SAVEERR, '>&STDERR');
+ open(SAVEERR, ">&STDERR");
open(STDERR, ">$log_file");
# Add the illegal persistent POA name to the IMR
@@ -72,7 +72,7 @@ sub test_body
# Close the log file and restore STDERR
close(STDERR);
- open(STDERR, '>&SAVEERR');
+ open(STDERR, ">&SAVEERR");
# If the add of an empty string failed, then
# the test of the tao_imr succeeded.