diff options
Diffstat (limited to 'TAO/examples/PluggableUDP/tests/Performance/run_test.pl')
-rwxr-xr-x | TAO/examples/PluggableUDP/tests/Performance/run_test.pl | 82 |
1 files changed, 55 insertions, 27 deletions
diff --git a/TAO/examples/PluggableUDP/tests/Performance/run_test.pl b/TAO/examples/PluggableUDP/tests/Performance/run_test.pl index 344296fdfa5..cfc8408e88a 100755 --- a/TAO/examples/PluggableUDP/tests/Performance/run_test.pl +++ b/TAO/examples/PluggableUDP/tests/Performance/run_test.pl @@ -1,54 +1,82 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; + & eval 'exec perl -S $0 $argv:q' + if 0; # $Id$ # -*- perl -*- use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; +use PerlACE::TestTarget; $status = 0; -$iorbase = "test.ior"; -$iorfile = PerlACE::LocalFile ("$iorbase"); +$debug_level = '0'; +$port_server = '12345'; +$port_client = '12346'; -unlink $iorfile; - -if (PerlACE::is_vxworks_test()) { - $TARGETHOSTNAME = $ENV{'ACE_RUN_VX_TGTHOST'}; - $SV = new PerlACE::ProcessVX ("server", "-ORBEndpoint diop://$TARGETHOSTNAME:12345 -o $iorbase"); -} -else { - $SV = new PerlACE::Process ("server", "-ORBEndpoint diop://:12345 -o $iorfile"); +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } } -$CL = new PerlACE::Process ("client", "-k file://$iorfile -ORBEndpoint diop://:12346"); -$server = $SV->Spawn (); +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"; + +my $iorbase = "test.ior"; +my $server_iorfile = $server->LocalFile ($iorbase); +my $client_iorfile = $client->LocalFile ($iorbase); +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); + +$SV = $server->CreateProcess ("server", + "-ORBdebuglevel $debug_level " . + "-ORBEndpoint diop://:$port_server " . + "-o $server_iorfile"); + +$CL = $client->CreateProcess ("client", + "-ORBEndpoint diop://:$port_client " . + "-k file://$client_iorfile"); + +$server_status = $SV->Spawn (); -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; exit 1; } -if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: could not find file <$iorfile>\n"; - $SV->Kill (); +if ($server->WaitForFileTimed ($iorbase, + $server->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); exit 1; } -$client = $CL->SpawnWaitKill (90); -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; +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_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 75); + +if ($client_status != 0) { + print STDERR "ERROR: client returned $client_status\n"; $status = 1; } -$server = $SV->WaitKill (10); +$server_status = $SV->WaitKill ($server->ProcessStopWaitInterval()); -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; $status = 1; } -unlink $iorfile; +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); exit $status; |