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", "-ORBdebuglevel $debug_level -o $server_iorfile");
38 $CL1 = $client1->CreateProcess ("client", "-k file://$client1_iorfile");
39 $CL2 = $client2->CreateProcess ("client", "-k file://$client2_iorfile");
40 $CL3 = $client3->CreateProcess ("client", "-k file://$client3_iorfile");
42 $server_status = $SV->Spawn ();
44 if ($server_status != 0) {
45 print STDERR
"ERROR: server returned $server_status\n";
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);
56 if ($server->GetFile ($iorbase) == -1) {
57 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
58 $SV->Kill (); $SV->TimedWait (1);
61 if ($client1->PutFile ($iorbase) == -1) {
62 print STDERR
"ERROR: cannot set file <$client1_iorfile>\n";
63 $SV->Kill (); $SV->TimedWait (1);
66 if ($client2->PutFile ($iorbase) == -1) {
67 print STDERR
"ERROR: cannot set file <$client2_iorfile>\n";
68 $SV->Kill (); $SV->TimedWait (1);
71 if ($client3->PutFile ($iorbase) == -1) {
72 print STDERR
"ERROR: cannot set file <$client3_iorfile>\n";
73 $SV->Kill (); $SV->TimedWait (1);
77 local $start_time = time();
78 local $max_running_time = 240; # 4 minutes
79 local $elapsed = time() - $start_time;
83 $max_running_time = 1;
86 while($elapsed < $max_running_time) {
87 $client_status = $CL1->Spawn ();
88 if ($client_status != 0) {
89 print STDERR
"ERROR: client returned $client_status\n";
90 $SV->Kill (); $SV->TimedWait (1);
94 $client_status = $CL2->Spawn ();
95 if ($client_status != 0) {
96 print STDERR
"ERROR: client returned $client_status\n";
97 $SV->Kill (); $SV->TimedWait (1);
98 $CL1->Kill (); $CL1->TimedWait (1);
102 $client_status = $CL3->Spawn ();
103 if ($client_status != 0) {
104 print STDERR
"ERROR: client returned $client_status\n";
105 $SV->Kill (); $SV->TimedWait (1);
106 $CL1->Kill (); $CL1->TimedWait (1);
107 $CL2->Kill (); $CL2->TimedWait (1);
111 $client_status = $CL1->WaitKill ($client1->ProcessStopWaitInterval() + 45, {self_crash
=> 1});
112 if ($client_status != 0) {
113 print STDERR
"ERROR: client 1 returned $client_status\n";
114 $SV->Kill (); $SV->TimedWait (1);
115 $CL2->Kill (); $CL2->TimedWait (1);
116 $CL3->Kill (); $CL3->TimedWait (1);
120 $client_status = $CL2->WaitKill ($client2->ProcessStopWaitInterval() + 45, {self_crash
=> 1});
121 if ($client_status != 0) {
122 print STDERR
"ERROR: client 2 returned $client_status\n";
123 $SV->Kill (); $SV->TimedWait (1);
124 $CL1->Kill (); $CL1->TimedWait (1);
125 $CL3->Kill (); $CL3->TimedWait (1);
129 $client_status = $CL3->WaitKill ($client3->ProcessStopWaitInterval() + 45, {self_crash
=> 1});
130 if ($client_status != 0) {
131 print STDERR
"ERROR: client 3 returned $client_status\n";
132 $SV->Kill (); $SV->TimedWait (1);
133 $CL1->Kill (); $CL1->TimedWait (1);
134 $CL2->Kill (); $CL2->TimedWait (1);
138 $elapsed = time() - $start_time;
141 $SH = $client1->CreateProcess ("shutdown", "-k file://$client1_iorfile");
143 $client_status = $SH->SpawnWaitKill ($client1->ProcessStartWaitInterval());
145 if ($client_status != 0) {
146 print STDERR
"ERROR: client returned $client_status\n";
147 $SV->Kill (); $SV->TimedWait (1);
151 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
153 if ($server_status != 0) {
154 print STDERR
"ERROR: server returned $server_status\n";
158 $server->DeleteFile($iorbase);
159 $client1->DeleteFile($iorbase);
160 $client2->DeleteFile($iorbase);
161 $client3->DeleteFile($iorbase);