summaryrefslogtreecommitdiff
path: root/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated
diff options
context:
space:
mode:
authormsmit <msmit@remedy.nl>2009-01-08 09:37:27 +0000
committermsmit <msmit@remedy.nl>2009-01-08 09:37:27 +0000
commitf18bf141bd5daf5a5008114f78d0adc429522d73 (patch)
treec56f7ad0cc0b6b72806be455c9d2514c824dd47f /TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated
parent30c76f7e4b465b708d8e4a69a6a6ba8535e51f1e (diff)
downloadATCD-f18bf141bd5daf5a5008114f78d0adc429522d73.tar.gz
Wed Jan 8 10:30:35 UTC 2009 Marcel Smit <msmit@remedy.nl>
* tests/Portable_Interceptors/Bug_1559/run_test.pl: * tests/Portable_Interceptors/Bug_2510_Regression/run_test.pl: * tests/Portable_Interceptors/Processing_Mode_Policy\Collocated/run_test.pl: Made "fuzz" compliant.
Diffstat (limited to 'TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated')
-rwxr-xr-xTAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl199
1 files changed, 92 insertions, 107 deletions
diff --git a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl
index 94350489e4c..ad7dff6986d 100755
--- a/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl
+++ b/TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl
@@ -6,124 +6,109 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
sub get_test_modes
{
- my $testid = shift;
-
- my $client_mode = "LOCAL_AND_REMOTE";
- my $server_mode = "LOCAL_AND_REMOTE";
-
- # There are Nine Permutations.
- if ($testid == 1)
- {
- $client_mode = "LOCAL_AND_REMOTE";
- $server_mode = "LOCAL_AND_REMOTE";
- }
- elsif ($testid == 2)
- {
- $client_mode = "LOCAL_AND_REMOTE";
- $server_mode = "LOCAL_ONLY";
- }
- elsif ($testid == 3)
- {
- $client_mode = "LOCAL_AND_REMOTE";
- $server_mode = "REMOTE_ONLY";
- }
- elsif ($testid == 4)
- {
- $client_mode = "LOCAL_ONLY";
- $server_mode = "LOCAL_AND_REMOTE";
- }
- elsif ($testid == 5)
- {
- $client_mode = "LOCAL_ONLY";
- $server_mode = "LOCAL_ONLY";
- }
- elsif ($testid == 6)
- {
- $client_mode = "LOCAL_ONLY";
- $server_mode = "REMOTE_ONLY";
- }
- elsif ($testid == 7)
- {
- $client_mode = "REMOTE_ONLY";
- $server_mode = "LOCAL_AND_REMOTE";
- }
- elsif ($testid == 8)
- {
- $client_mode = "REMOTE_ONLY";
- $server_mode = "LOCAL_ONLY";
- }
- elsif ($testid == 9)
- {
- $client_mode = "REMOTE_ONLY";
- $server_mode = "REMOTE_ONLY";
- }
- else
- {
- print STDERR "ERROR: invalid testid: $testid\n";
- exit 1;
- }
-
- return ($client_mode, $server_mode);
+ my $testid = shift;
+
+ my $client_mode = "LOCAL_AND_REMOTE";
+ my $server_mode = "LOCAL_AND_REMOTE";
+
+ # There are Nine Permutations.
+ if ($testid == 1) {
+ $client_mode = "LOCAL_AND_REMOTE";
+ $server_mode = "LOCAL_AND_REMOTE";
+ }
+ elsif ($testid == 2) {
+ $client_mode = "LOCAL_AND_REMOTE";
+ $server_mode = "LOCAL_ONLY";
+ }
+ elsif ($testid == 3) {
+ $client_mode = "LOCAL_AND_REMOTE";
+ $server_mode = "REMOTE_ONLY";
+ }
+ elsif ($testid == 4) {
+ $client_mode = "LOCAL_ONLY";
+ $server_mode = "LOCAL_AND_REMOTE";
+ }
+ elsif ($testid == 5) {
+ $client_mode = "LOCAL_ONLY";
+ $server_mode = "LOCAL_ONLY";
+ }
+ elsif ($testid == 6) {
+ $client_mode = "LOCAL_ONLY";
+ $server_mode = "REMOTE_ONLY";
+ }
+ elsif ($testid == 7) {
+ $client_mode = "REMOTE_ONLY";
+ $server_mode = "LOCAL_AND_REMOTE";
+ }
+ elsif ($testid == 8) {
+ $client_mode = "REMOTE_ONLY";
+ $server_mode = "LOCAL_ONLY";
+ }
+ elsif ($testid == 9) {
+ $client_mode = "REMOTE_ONLY";
+ $server_mode = "REMOTE_ONLY";
+ }
+ else {
+ print STDERR "ERROR: invalid testid: $testid\n";
+ exit 1;
+ }
+
+ return ($client_mode, $server_mode);
}
my $status = 0;
-my $file = PerlACE::LocalFile ("test.ior");
+
+my $process = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
+my $iorfile = "test.ior";
+my $process_iorfile = $process->LocalFile ($iorfile);
+$process->DeleteFile($iorfile);
my $testid;
-for ($testid = 1; $testid <= 9; ++$testid)
-{
- unlink $file;
-
- my $client_mode;
- my $server_mode;
-
- ($client_mode, $server_mode) = get_test_modes($testid);
-
- my $SV;
- if (PerlACE::is_vxworks_test()) {
- $SV = new PerlACE::ProcessVX ("PI_ProcMode_Collocated_Test",
- "-c $client_mode " .
- "-s $server_mode " .
- "-ORBobjrefstyle url");
- }
- else {
- $SV = new PerlACE::Process ("PI_ProcMode_Collocated_Test",
- "-c $client_mode " .
- "-s $server_mode " .
- "-ORBobjrefstyle url");
- }
-
- print STDERR "\n\n==== Starting test variant #$testid\n\n";
-
- $SV->Spawn ();
-
- if (PerlACE::waitforfile_timed ($file, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$file>\n";
- $SV->Kill ();
- exit 1;
- }
-
- my $collocated = $SV->WaitKill (5);
-
- if ($collocated != 0) {
- print STDERR "ERROR: PI_ProcMode_Collocated_Test returned $collocated\n";
- print STDERR "ERROR: For client-side mode [$client_mode],\n";
- print STDERR "ERROR: and server-side mode [$server_mode].\n";
- $status = 1;
- print STDERR "\nTest variant #$testid of 9 failed!\n\n";
- }
- else {
- print STDERR "\nTest variant #$testid of 9 passed!\n\n";
- }
+for ($testid = 1; $testid <= 9; ++$testid) {
+
+ my $client_mode;
+ my $server_mode;
+
+ ($client_mode, $server_mode) = get_test_modes($testid);
+
+ my $SV;
+
+ $SV = $process->CreateProcess ("PI_ProcMode_Collocated_Test",
+ "-c $client_mode " .
+ "-s $server_mode " .
+ "-ORBobjrefstyle url");
+
+ print STDERR "\n\n==== Starting test variant #$testid\n\n";
+
+ $SV->Spawn ();
+
+ if ($process->WaitForFileTimed ($iorfile,
+ $process->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$process_iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+ }
+
+ my $collocated = $SV->WaitKill ($process->ProcessStopWaitInterval());
+
+ if ($collocated != 0) {
+ print STDERR "ERROR: PI_ProcMode_Collocated_Test returned $collocated\n";
+ print STDERR "ERROR: For client-side mode [$client_mode],\n";
+ print STDERR "ERROR: and server-side mode [$server_mode].\n";
+ $status = 1;
+ print STDERR "\nTest variant #$testid of 9 failed!\n\n";
+ }
+ else {
+ print STDERR "\nTest variant #$testid of 9 passed!\n\n";
+ }
}
-unlink $file;
-
if ($status == 0) {
print STDERR "\n==== All 9 test variants were successful!\n";
}