Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / Security / mixed_security_test / run_test.pl
blob4d907756d6a7bf0a78acd0ffed1b5f46f2296188
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 $ior_restricted = "restricted.ior";
23 my $ior_permitted = "permitted.ior";
25 my $server_conf = "server$PerlACE::svcconf_ext";
26 my $client_conf = "client$PerlACE::svcconf_ext";
28 my $server_iorfile_restricted = $server->LocalFile ($ior_restricted);
29 my $server_iorfile_permitted = $server->LocalFile ($ior_permitted);
30 my $client_iorfile_restricted = $client->LocalFile ($ior_restricted);
31 my $client_iorfile_permitted = $client->LocalFile ($ior_permitted);
32 $server->DeleteFile($ior_restricted);
33 $server->DeleteFile($ior_permitted);
34 $client->DeleteFile($ior_restricted);
35 $client->DeleteFile($ior_permitted);
37 # Set the SSL environment
38 # This doesn't work on Windows. For some reason,
39 # environment variables aren't propagated to child processes.
40 #$ENV{'SSL_CERT_FILE'} = 'cacert.pem';
42 $SV = $server->CreateProcess ("server", "-ORBSvcConf $server_conf");
43 $CL = $client->CreateProcess ("client", "-ORBSvcConf $client_conf");
45 print STDOUT "\n\n==== Running mixed_security_test test\n";
47 $server_status = $SV->Spawn ();
49 if ($server_status != 0) {
50 print STDERR "ERROR: server returned $server_status\n";
51 exit 1;
54 if ($server->WaitForFileTimed ($ior_permitted,
55 $server->ProcessStartWaitInterval()) == -1) {
56 print STDERR "ERROR: cannot find file <$ior_permitted>\n";
57 $SV->Kill (); $SV->TimedWait (1);
58 exit 1;
61 if ($server->WaitForFileTimed ($ior_restricted,
62 $server->ProcessStartWaitInterval()) == -1) {
63 print STDERR "ERROR: cannot find file <$ior_restricted>\n";
64 $SV->Kill (); $SV->TimedWait (1);
65 exit 1;
68 if ($server->GetFile ($ior_permitted) == -1) {
69 print STDERR "ERROR: cannot retrieve file <$server_iorfile_permitted>\n";
70 $SV->Kill (); $SV->TimedWait (1);
71 exit 1;
74 if ($client->PutFile ($ior_restricted) == -1) {
75 print STDERR "ERROR: cannot set file <$client_iorfile_restricted>\n";
76 $SV->Kill (); $SV->TimedWait (1);
77 exit 1;
80 if ($server->GetFile ($ior_restricted) == -1) {
81 print STDERR "ERROR: cannot retrieve file <$server_iorfile_restricted>\n";
82 $SV->Kill (); $SV->TimedWait (1);
83 exit 1;
86 if ($client->PutFile ($ior_permitted) == -1) {
87 print STDERR "ERROR: cannot set file <$client_iorfile_permitted>\n";
88 $SV->Kill (); $SV->TimedWait (1);
89 exit 1;
92 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
94 if ($client_status != 0) {
95 print STDERR "ERROR: client returned $client_status\n";
96 $status = 1;
99 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
101 if ($server_status != 0) {
102 print STDERR "ERROR: server returned $server_status\n";
103 $status = 1;
106 $server->DeleteFile($ior_restricted);
107 $client->DeleteFile($ior_permitted);
108 $server->DeleteFile($ior_restricted);
109 $client->DeleteFile($ior_permitted);
111 exit $status;