1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
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_iorfile = $server->LocalFile ($iorbase);
24 my $client_iorfile = $client->LocalFile ($iorbase);
25 $server->DeleteFile($iorbase);
26 $client->DeleteFile($iorbase);
28 my $svcconf = "svc$PerlACE::svcconf_ext";
29 my $server_svcfile = $server->LocalFile ($svcconf);
30 my $client_svcfile = $client->LocalFile ($svcconf);
32 if ($client->PutFile ($svcconf) == -1) {
33 print STDERR
"ERROR: cannot set file <$client_svcfile>\n";
36 if ($server->PutFile ($svcconf) == -1) {
37 print STDERR
"ERROR: cannot set file <$server_svcfile>\n";
42 print STDERR
"==== Server upcall waits for operations on other threads\n";
44 $SV = $server->CreateProcess ("blocking_server",
45 "-ORBdebuglevel $debug_level ".
46 "-ORBSvcConf $server_svcfile -o $server_iorfile");
47 $CL = $client->CreateProcess ("blocking_client",
48 "-ORBSvcConf $client_svcfile ".
49 "-k file://$client_iorfile");
51 $server_status = $SV->Spawn ();
53 if ($server_status != 0) {
54 print STDERR
"ERROR: server returned $server_status\n";
58 if ($server->WaitForFileTimed ($iorbase,
59 $server->ProcessStartWaitInterval()) == -1) {
60 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
65 if ($server->GetFile ($iorbase) == -1) {
66 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
70 if ($client->PutFile ($iorbase) == -1) {
71 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
72 $SV->Kill (); $SV->TimedWait (1);
76 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
78 if ($client_status != 0) {
79 print STDERR
"ERROR: client returned $client_status\n";
83 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
85 if ($server_status != 0) {
86 print STDERR
"ERROR: server returned $server_status\n";
90 $server->DeleteFile($iorbase);
91 $client->DeleteFile($iorbase);
93 print STDERR
"==== Server upcall waits for AMI operations on other threads\n";
95 $SV->Executable ("ami_server");
96 $SV->Arguments ("-ORBdebuglevel $debug_level ".
97 "-ORBSvcConf $server_svcfile -o $server_iorfile");
98 $CL->Arguments ("-ORBSvcConf $client_svcfile ".
99 "-k file://$client_iorfile");
101 $server_status = $SV->Spawn ();
103 if ($server_status != 0) {
104 print STDERR
"ERROR: server returned $server_status\n";
108 if ($server->WaitForFileTimed ($iorbase,
109 $server->ProcessStartWaitInterval()) == -1) {
110 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
111 $SV->Kill (); $SV->TimedWait (1);
115 if ($server->GetFile ($iorbase) == -1) {
116 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
117 $SV->Kill (); $SV->TimedWait (1);
120 if ($client->PutFile ($iorbase) == -1) {
121 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
122 $SV->Kill (); $SV->TimedWait (1);
126 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
128 if ($client_status != 0) {
129 print STDERR
"ERROR: client returned $client_status\n";
133 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
135 if ($server_status != 0) {
136 print STDERR
"ERROR: server returned $server_status\n";
140 $server->DeleteFile($iorbase);
141 $client->DeleteFile($iorbase);
143 print STDERR
"==== AMI Client, Server upcall waits AMI operations\n";
145 $SV->Arguments ("-ORBdebuglevel $debug_level ".
146 "-ORBSvcConf $server_svcfile -o $server_iorfile");
147 $CL->Executable ("ami_client");
148 $CL->Arguments ("-ORBSvcConf $client_svcfile ".
149 "-k file://$client_iorfile");
151 $server_status = $SV->Spawn ();
153 if ($server_status != 0) {
154 print STDERR
"ERROR: server returned $server_status\n";
158 if ($server->WaitForFileTimed ($iorbase,
159 $server->ProcessStartWaitInterval()) == -1) {
160 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
161 $SV->Kill (); $SV->TimedWait (1);
165 if ($server->GetFile ($iorbase) == -1) {
166 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
167 $SV->Kill (); $SV->TimedWait (1);
170 if ($client->PutFile ($iorbase) == -1) {
171 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
172 $SV->Kill (); $SV->TimedWait (1);
176 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
178 if ($client_status != 0) {
179 print STDERR
"ERROR: client returned $client_status\n";
183 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
185 if ($server_status != 0) {
186 print STDERR
"ERROR: server returned $server_status\n";
190 $server->DeleteFile($iorbase);
191 $client->DeleteFile($iorbase);
193 print STDERR
"==== AMI Client, Server upcall waits for operations on other threads\n";
195 $SV->Executable ("blocking_server");
196 $SV->Arguments ("-ORBdebuglevel $debug_level ".
197 "-ORBSvcConf $server_svcfile -o $server_iorfile");
198 $CL->Arguments ("-ORBSvcConf $client_svcfile ".
199 "-k file://$client_iorfile");
201 $server_status = $SV->Spawn ();
203 if ($server_status != 0) {
204 print STDERR
"ERROR: server returned $server_status\n";
208 if ($server->WaitForFileTimed ($iorbase,
209 $server->ProcessStartWaitInterval()) == -1) {
210 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
211 $SV->Kill (); $SV->TimedWait (1);
215 if ($server->GetFile ($iorbase) == -1) {
216 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
217 $SV->Kill (); $SV->TimedWait (1);
220 if ($client->PutFile ($iorbase) == -1) {
221 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
222 $SV->Kill (); $SV->TimedWait (1);
226 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
228 if ($client_status != 0) {
229 print STDERR
"ERROR: client returned $client_status\n";
233 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
235 if ($server_status != 0) {
236 print STDERR
"ERROR: server returned $server_status\n";
240 $server->DeleteFile($iorbase);
241 $client->DeleteFile($iorbase);