diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl')
-rwxr-xr-x | TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl | 84 |
1 files changed, 59 insertions, 25 deletions
diff --git a/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl index 40a74e180fe..ebe91e9334c 100755 --- a/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl +++ b/TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl @@ -1,55 +1,89 @@ 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; -# -*- perl -*- # $Id$ +# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; $status = 0; -$file = PerlACE::LocalFile ("test.ior"); +$debug_level = '0'; +$svc_conf = $PerlACE::svcconf_ext; -unlink $file; - -$status = 0; +foreach $i (@ARGV) { + if ($i eq '-debug') { + $debug_level = '10'; + } +} # Set the SSL environment # This doesn't work on Windows. For some reason, # environment variables aren't propagated to child processes. #$ENV{'SSL_CERT_FILE'} = 'cacert.pem'; -$SV = new PerlACE::Process ("server", - "-o $file -ORBSvcConf server$PerlACE::svcconf_ext"); -$CL = new PerlACE::Process ("client", - "-ORBSvcConf client$PerlACE::svcconf_ext -k file://$file"); +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 " . + "-ORBSvcConf server$svc_conf " . + "-o $server_iorfile "); + +$CL = $client->CreateProcess ("client", + "-ORBSvcConf client$svc_conf " . + "-k file://$client_iorfile"); print STDERR "\n\n==== Running Secure_Invocation test\n"; -$SV->Spawn (); +$server_status = $SV->Spawn (); -if (PerlACE::waitforfile_timed ($file, $PerlACE::wait_interval_for_process_creation) == -1) { - print STDERR "ERROR: cannot find file <$file>\n"; - $SV->Kill (); +if ($server_status != 0) { + print STDERR "ERROR: server returned $server_status\n"; + exit 1; +} + +if ($server->WaitForFileTimed ($iorbase, + $server->ProcessStartWaitInterval()) == -1) { + print STDERR "ERROR: cannot find file <$server_iorfile>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} + +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 ($client->ProcessStartWaitInterval() + 45); -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; +if ($client_status != 0) { + print STDERR "ERROR: client returned $client_status\n"; $status = 1; } -$server = $SV->WaitKill (5); +$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 $file; +$server->DeleteFile($iorbase); +$client->DeleteFile($iorbase); exit $status; |