Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / Security / Callback / run_test.pl
blob979a665f0b8ab4d289b59c224dcf74fe1d4f1286
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '0';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
20 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
22 my $iorbase = "server.ior";
23 my $server_conf = "server$PerlACE::svcconf_ext";
24 my $client_conf = "client$PerlACE::svcconf_ext";
25 my $server_iorfile = $server->LocalFile ($iorbase);
26 my $client_iorfile = $client->LocalFile ($iorbase);
27 $server->DeleteFile($iorbase);
28 $client->DeleteFile($iorbase);
30 # Set the SSL environment
31 # This doesn't work on Windows. For some reason,
32 # environment variables aren't propagated to child processes.
33 #$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
35 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level ".
36 "-o $server_iorfile ".
37 "-ORBSvcConf $server_conf");
38 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile ".
39 "-ORBSvcConf $client_conf");
40 print STDERR "\n\n==== Running SSLIOP Callback test\n";
42 $server_status = $SV->Spawn ();
44 if ($server_status != 0) {
45 print STDERR "ERROR: server returned $server_status\n";
46 exit 1;
49 if ($server->WaitForFileTimed ($iorbase,
50 $server->ProcessStartWaitInterval()) == -1) {
51 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
52 $SV->Kill (); $SV->TimedWait (1);
53 exit 1;
56 if ($server->GetFile ($iorbase) == -1) {
57 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
58 $SV->Kill (); $SV->TimedWait (1);
59 exit 1;
62 if ($client->PutFile ($iorbase) == -1) {
63 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
65 exit 1;
68 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
70 if ($client_status != 0) {
71 print STDERR "ERROR: client returned $client_status\n";
72 $status = 1;
75 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
77 if ($server_status != 0) {
78 print STDERR "ERROR: server returned $server_status\n";
79 $status = 1;
82 $server->DeleteFile($iorbase);
83 $client->DeleteFile($iorbase);
85 exit $status;