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
;
17 } elsif ($i eq '-quick') {
22 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
23 my $client1 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
24 my $client2 = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
25 my $client3 = PerlACE
::TestTarget
::create_target
(4) || die "Create target 4 failed\n";
27 my $iorbase = "server.ior";
28 my $server_iorfile = $server->LocalFile ($iorbase);
29 my $client1_iorfile = $client1->LocalFile ($iorbase);
30 my $client2_iorfile = $client2->LocalFile ($iorbase);
31 my $client3_iorfile = $client3->LocalFile ($iorbase);
32 $server->DeleteFile($iorbase);
33 $client1->DeleteFile($iorbase);
34 $client2->DeleteFile($iorbase);
35 $client3->DeleteFile($iorbase);
37 $SV = $server->CreateProcess ("server",
38 "-ORBdebuglevel $debug_level ".
39 "-ORBdotteddecimaladdresses 1 ".
40 "-o $server_iorfile");
41 $CL1 = $client1->CreateProcess ("client", "-k file://$client1_iorfile");
42 $CL2 = $client2->CreateProcess ("client", "-k file://$client2_iorfile");
43 $CL3 = $client3->CreateProcess ("client", "-k file://$client3_iorfile");
45 $server_status = $SV->Spawn ();
47 if ($server_status != 0) {
48 print STDERR
"ERROR: server returned $server_status\n";
52 if ($server->WaitForFileTimed ($iorbase,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
59 if ($server->GetFile ($iorbase) == -1) {
60 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
64 if ($client1->PutFile ($iorbase) == -1) {
65 print STDERR
"ERROR: cannot set file <$client1_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
69 if ($client2->PutFile ($iorbase) == -1) {
70 print STDERR
"ERROR: cannot set file <$client2_iorfile>\n";
71 $SV->Kill (); $SV->TimedWait (1);
74 if ($client3->PutFile ($iorbase) == -1) {
75 print STDERR
"ERROR: cannot set file <$client3_iorfile>\n";
76 $SV->Kill (); $SV->TimedWait (1);
80 local $start_time = time();
81 local $max_running_time = 300; # 5 minutes
82 local $elapsed = time() - $start_time;
86 $max_running_time = 1;
89 while($elapsed < $max_running_time) {
90 $client_status = $CL1->Spawn ();
91 if ($client_status != 0) {
92 print STDERR
"ERROR: client returned $client_status\n";
93 $SV->Kill (); $SV->TimedWait (1);
97 $client_status = $CL2->Spawn ();
98 if ($client_status != 0) {
99 print STDERR
"ERROR: client returned $client_status\n";
100 $SV->Kill (); $SV->TimedWait (1);
101 $CL1->Kill (); $CL1->TimedWait (1);
105 $client_status = $CL3->Spawn ();
106 if ($client_status != 0) {
107 print STDERR
"ERROR: client returned $client_status\n";
108 $SV->Kill (); $SV->TimedWait (1);
109 $CL1->Kill (); $CL1->TimedWait (1);
110 $CL2->Kill (); $CL2->TimedWait (1);
114 $client_status = $CL1->WaitKill ($client1->ProcessStopWaitInterval() + 15, {self_crash
=> 1});
115 if ($client_status != 0) {
116 print STDERR
"ERROR: client returned $client_status\n";
117 $SV->Kill (); $SV->TimedWait (1);
118 $CL2->Kill (); $CL2->TimedWait (1);
119 $CL3->Kill (); $CL3->TimedWait (1);
123 $client_status = $CL2->WaitKill ($client2->ProcessStopWaitInterval() + 15, {self_crash
=> 1});
124 if ($client_status != 0) {
125 print STDERR
"ERROR: client returned $client_status\n";
126 $SV->Kill (); $SV->TimedWait (1);
127 $CL3->Kill (); $CL3->TimedWait (1);
131 $client_status = $CL3->WaitKill ($client3->ProcessStopWaitInterval() + 15, {self_crash
=> 1});
132 if ($client_status != 0) {
133 print STDERR
"ERROR: client returned $client_status\n";
134 $SV->Kill (); $SV->TimedWait (1);
138 $elapsed = time() - $start_time;
141 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
143 if ($server_status != 0) {
144 print STDERR
"ERROR: server returned $server_status\n";
148 $server->DeleteFile($iorbase);
149 $client1->DeleteFile($iorbase);
150 $client2->DeleteFile($iorbase);
151 $client3->DeleteFile($iorbase);