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
;
18 if ($i eq '-cdebug') {
23 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
24 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
26 my $iorbase = "server.ior";
27 my $server_iorfile = $server->LocalFile ($iorbase);
28 my $client_iorfile = $client->LocalFile ($iorbase);
29 $server->DeleteFile($iorbase);
30 $client->DeleteFile($iorbase);
32 my $port = $server->RandomPort ();
35 my $server_arg = "-ORBListenEndpoints iiop://127.0.0.1:$port -o $server_iorfile";
36 $server_arg .= " -ORBdebuglevel $debug_level" if ($debug_level > 0);
38 my $client_arg = "-ORBIIOPClientPortBase $port -ORBIIOPClientPortSpan $width"
39 . " -k file://$client_iorfile";
40 $client_arg .= " -ORBdebuglevel $cdebug_level" if ($cdebug_level > 0);
42 $SV = $server->CreateProcess ("server", $server_arg);
43 $server_status = $SV->Spawn ();
45 if ($server_status != 0) {
46 print STDERR
"ERROR: server returned $server_status\n";
50 if ($server->WaitForFileTimed ($iorbase,
51 $server->ProcessStartWaitInterval()) == -1) {
52 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
57 if ($server->GetFile ($iorbase) == -1) {
58 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
59 $SV->Kill (); $SV->TimedWait (1);
62 if ($client->PutFile ($iorbase) == -1) {
63 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
68 for ($i = 0; $i <= $width; $i++) {
70 $args .= " -ORBLogFile clt$i" if ($cdebug_level > 0);
72 $CL[$i] = $client->CreateProcess ("client", $args);
76 for ($i = 0; $i <= $width; $i++) {
77 $client_status = $CL[$i]->WaitKill ($client->ProcessStopWaitInterval());
79 if ($client_status == 100) {
80 print STDERR
"ERROR: client returned $client_status\n";
83 elsif ($client_status == 1) {
84 print STDERR
"client $i caught expected transient\n";
89 if ($transient == 0) {
93 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
95 if ($server_status != 0) {
96 print STDERR
"ERROR: server returned $server_status\n";
100 $server->DeleteFile($iorbase);
101 $client->DeleteFile($iorbase);