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
;
10 $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
11 $gateway = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
12 $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
14 $iorbase = "server.ior";
15 $gwbase = "gateway.ior";
17 $server_iorfile = $server->LocalFile ($iorbase);
18 $gateway_iorfile = $server->LocalFile ($iorbase);
19 $gateway_gwfile = $server->LocalFile ($gwbase);
20 $client_gwfile = $client->LocalFile ($gwbase);
22 $server->DeleteFile ($iorbase);
23 $gateway->DeleteFile ($iorbase);
24 $gateway->DeleteFile ($gwbase);
25 $client->DeleteFile ($gwbase);
29 $SV = $server->CreateProcess ("server", "-o $server_iorfile");
30 $GW = $gateway->CreateProcess ("gateway", "-k file://$gateway_iorfile -o $gateway_gwfile");
31 $CL = $gateway->CreateProcess ("client", "-k file://$client_gwfile -u");
33 $server_status = $SV->Spawn ();
35 if ($server_status != 0) {
36 print STDERR
"ERROR: server returned $server_status\n";
40 if ($server->WaitForFileTimed ($iorbase,
41 $server->ProcessStartWaitInterval()) == -1) {
42 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
43 $SV->Kill (); $SV->TimedWait (1);
49 if ($gateway->WaitForFileTimed ($gwbase,
50 $gateway->ProcessStartWaitInterval()) == -1) {
51 print STDERR
"ERROR: cannot find file <$gateway_gwfile>\n";
52 $SV->Kill (); $SV->TimedWait (1);
53 $GW->Kill (); $GW->TimedWait (1);
57 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
59 if ($client_status != 0) {
60 print STDERR
"ERROR: client returned $client_status\n";
64 $CL = $client->CreateProcess ("client", "-k file://$client_gwfile -s");
66 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
68 if ($client_status != 0) {
69 print STDERR
"ERROR: client returned $client_status\n";
73 $server_status = $SV->Kill ();
75 if ($server_status != 0) {
76 print STDERR
"ERROR: server returned $server_status\n";
80 $gateway_status = $GW->Kill ();
82 if ($gateway_status != 0) {
83 print STDERR
"ERROR: gateway returned $gateway_status\n";
87 $server->DeleteFile ($iorbase);
88 $gateway->DeleteFile ($iorbase);
89 $gateway->DeleteFile ($gwbase);
90 $client->DeleteFile ($gwbase);