diff options
Diffstat (limited to 'TAO/tests/RTCORBA/Bug_3382_Regression/run_test.pl')
-rwxr-xr-x | TAO/tests/RTCORBA/Bug_3382_Regression/run_test.pl | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/TAO/tests/RTCORBA/Bug_3382_Regression/run_test.pl b/TAO/tests/RTCORBA/Bug_3382_Regression/run_test.pl index cfa55dc34cf..cf568688b34 100755 --- a/TAO/tests/RTCORBA/Bug_3382_Regression/run_test.pl +++ b/TAO/tests/RTCORBA/Bug_3382_Regression/run_test.pl @@ -6,61 +6,54 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib '../../../../bin'; -use PerlACE::Run_Test; +use PerlACE::TestTarget; -$status = 0; +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"; -$iorfile = PerlACE::LocalFile ("test.ior"); +$iorbase = "test.ior"; -unlink $iorfile; +$server_iorfile = $server->LocalFile ($iorbase); +$client_iorfile = $client->LocalFile ($iorbase); -if (PerlACE::is_vxworks_test()) { - $TEST = new PerlACE::ProcessVX ("simple_client", , "-ORBSvcConfDirective \"static RT_ORB_Loader '-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping continuous'\""); -} -else { - $TEST = new PerlACE::Process ("simple_client", , "-ORBSvcConfDirective \"static RT_ORB_Loader '-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping continuous'\""); -} +$server->DeleteFile ($iorbase); +$client->DeleteFile ($iorbase); + + +$status = 0; -$test = $TEST->SpawnWaitKill (60); +$PROC = $server->CreateProcess ("simple_client", , "-ORBSvcConfDirective \"static RT_ORB_Loader '-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping continuous'\""); -if ($test != 0) +$proc_status = $PROC->SpawnWaitKill ($server->ProcessStartWaitInterval ()); + +if ($proc_status != 0) { - print STDERR "ERROR: simple_client returned $test\n"; + print STDERR "ERROR: simple_client returned $proc_status\n"; $status = 1; } -if (PerlACE::is_vxworks_test()) { - $TEST = new PerlACE::ProcessVX ("simple_client", , "-ORBSvcConfDirective \"static RT_ORB_Loader '-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping linear'\""); -} -else { - $TEST = new PerlACE::Process ("simple_client", , "-ORBSvcConfDirective \"static RT_ORB_Loader '-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping linear'\""); -} +$PROC = $server->CreateProcess ("simple_client", , "-ORBSvcConfDirective \"static RT_ORB_Loader '-ORBSchedPolicy SCHED_FIFO -ORBScopePolicy SYSTEM -ORBPriorityMapping linear'\""); -$test = $TEST->SpawnWaitKill (60); +$proc_status = $PROC->SpawnWaitKill ($server->ProcessStartWaitInterval ()); -if ($test != 0) +if ($proc_status != 0) { - print STDERR "ERROR: simple_client returned $test\n"; + print STDERR "ERROR: simple_client returned $proc_status\n"; $status = 1; } - print STDERR "\n RTCORBA CLIENT_PROPAGATED Linear Priority Mapping Unit Test\n\n"; -if (PerlACE::is_vxworks_test()) { - $SV = new PerlACE::ProcessVX ("server", , "-o test.ior"); -} -else { - $SV = new PerlACE::Process ("server", , "-o $iorfile"); -} -$CL = new PerlACE::Process ("client", "-k file://$iorfile"); +$SV = $server->CreateProcess ("server", , "-o $server_iorfile"); +$CL = $client->CreateProcess ("client", "-k file://$client_iorfile"); $SV->Spawn (); -if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) +if ($server->WaitForFileTimed ($iorbase, + $server->ProcessStartWaitInterval()) == -1) { - $server = $SV->TimedWait (1); - if ($server == 2) + $server_status = $SV->TimedWait (1); + if ($server_status == 2) { # Mark as no longer running to avoid errors on exit. $SV->{RUNNING} = 0; @@ -68,28 +61,29 @@ if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) } else { - print STDERR "ERROR: cannot find file <$iorfile>\n"; + print STDERR "ERROR: cannot find file <$server_iorfile>\n"; $SV->Kill (); exit 1; } } -$client = $CL->SpawnWaitKill (60); +$client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ()); -if ($client != 0) +if ($client_status != 0) { - print STDERR "ERROR: client returned $client\n"; + print STDERR "ERROR: client returned $client_status\n"; $status = 1; } -$server = $SV->WaitKill (60); +$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ()); -if ($server != 0) +if ($server_status != 0) { - print STDERR "ERROR: server returned $server\n"; + print STDERR "ERROR: server returned $server_status\n"; $status = 1; } -unlink $iorfile; +$server->DeleteFile ($iorbase); +$client->DeleteFile ($iorbase); exit $status; |