diff options
Diffstat (limited to 'TAO/tests/Portable_Interceptors/Bug_3582/run_test.pl')
-rwxr-xr-x | TAO/tests/Portable_Interceptors/Bug_3582/run_test.pl | 69 |
1 files changed, 41 insertions, 28 deletions
diff --git a/TAO/tests/Portable_Interceptors/Bug_3582/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_3582/run_test.pl index b35f2687020..de707d44f51 100755 --- a/TAO/tests/Portable_Interceptors/Bug_3582/run_test.pl +++ b/TAO/tests/Portable_Interceptors/Bug_3582/run_test.pl @@ -2,57 +2,70 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' & eval 'exec perl -S $0 $argv:q' if 0; -# -*- perl -*- -# # $Id$ - +# -*- perl -*- use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; +use PerlACE::TestTarget; -$file1base = "test.ior"; -$file1 = PerlACE::LocalFile ("$file1base"); +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"; -unlink $file1; +my $iorbase = "server.ior"; +my $server_iorfile = $server->LocalFile ($iorbase); +my $client_iorfile = $client->LocalFile ($iorbase); +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); -if (PerlACE::is_vxworks_test()) { -$SV1 = new PerlACE::ProcessVX ("server", "-o $file1base -n 1"); -} -else { -$SV1 = new PerlACE::Process ("server", "-o $file1 -n 1"); -} -$CL = new PerlACE::Process ("client", "-p file://$file1"); - -$status = 0; +$SV = $server->CreateProcess ("server", "-o $server_iorfile -n 1"); +$CL = $client->CreateProcess ("client", "-p file://$client_iorfile"); print STDERR "\n\n==== Running PortableInterceptor::Redirection test\n"; -$SV1->Spawn (); +$server_status = $SV->Spawn (); + +if ($server->WaitForFileTimed ($iorbase, + $server->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} -if (PerlACE::waitforfile_timed ($file1, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$file1>\n"; - $SV1->Kill (); +if ($server->GetFile ($iorbase) == -1) { + print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} +if ($client->PutFile ($iorbase) == -1) { + print STDERR "ERROR: cannot set file <$client_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); exit 1; } -$client = $CL->SpawnWaitKill (60); +$client_status = $CL->SpawnWaitKill (60); -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; +if ($client_status != 0) { + print STDERR "ERROR: client returned $client_status\n"; $status = 1; } -$SV1->WaitKill (5); +$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval()); + +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; + $status = 1; +} print "Restarting Client to provoke TRANSIENT exception\n"; -$client = $CL->SpawnWaitKill (60); +$client_status = $CL->SpawnWaitKill (60); -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; +if ($client_status != 0) { + print STDERR "ERROR: client returned $client_status\n"; $status = 1; } -unlink $file1; +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); exit $status; |