diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl')
-rwxr-xr-x | TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl | 69 |
1 files changed, 32 insertions, 37 deletions
diff --git a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl index 59ccd2b87a4..536258b9a52 100755 --- a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl +++ b/TAO/orbsvcs/tests/Bug_1437_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"); @@ -45,60 +38,62 @@ sub test_body # 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; } - + # Set the activator arguments $activator_arguments = "-o $activator_ior_file -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; } - - # Add the persistent POA name to the IMR - $TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_ior_file &> $log_file add \"\""); + + # Redirect STDERR to a log file so that the ERROR + # message does not get printed to the terminal + open(SAVEERR, ">&STDERR"); + open(STDERR, ">$log_file"); + + # Add the illegal persistent POA name to the IMR + $TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_ior_file add \"\""); $result = $TAO_IMR->SpawnWaitKill (30); - - if (PerlACE::waitforfile_timed ($log_file, 10) == -1) - { - print STDERR "ERROR: cannot find $log_file\n"; - $ACTIVATOR->Kill (); - $LOCATOR->Kill (); - return 1; - } - $match = 0; - open (FILE, $log_file) or return -1; - while (<FILE>) { - $match = /must be at least one character long/; - last if $match; - } - close FILE; + # Close the log file and restore STDERR + close(STDERR); + open(STDERR, ">&SAVEERR"); + + # If the add of an empty string failed, then + # the test of the tao_imr succeeded. + if ($result != 0) { + $result = 0; + } + else { + $result = -1; + } # Tidy up $ACTIVATOR->TerminateWaitKill (5); $LOCATOR->TerminateWaitKill (5); - return $match ? 0 : -1; -} + return $result; +} # Run regression for bug #1437 -$test_result = test_body(); +$test_result = test_body(); if ($test_result != 0) -{ +{ print STDERR "ERROR: Regression test for Bug #1437 failed\n"; } else |