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
;
11 $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
12 $gateway = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
13 $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 $iorbase = "server.ior";
16 $gwbase = "gateway.ior";
18 $server_iorfile = $server->LocalFile ($iorbase);
19 $gateway_iorfile = $server->LocalFile ($iorbase);
20 $gateway_gwfile = $server->LocalFile ($gwbase);
21 $client_gwfile = $client->LocalFile ($gwbase);
23 $server->DeleteFile ($iorbase);
24 $gateway->DeleteFile ($iorbase);
25 $gateway->DeleteFile ($gwbase);
26 $client->DeleteFile ($gwbase);
30 $SV = $server->CreateProcess ("server", "-o $server_iorfile");
31 $GW = $gateway->CreateProcess ("gateway", "-k file://$gateway_iorfile -o $gateway_gwfile");
32 $CL = $client->CreateProcess ("client", "-k file://$client_gwfile -x -i 100");
34 $server_status = $SV->Spawn ();
36 if ($server_status != 0) {
37 print STDERR
"ERROR: server returned $server_status\n";
41 if ($server->WaitForFileTimed ($iorbase,
42 $server->ProcessStartWaitInterval()) == -1) {
43 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
44 $SV->Kill (); $SV->TimedWait (1);
50 if ($gateway->WaitForFileTimed ($gwbase,
51 $gateway->ProcessStartWaitInterval()) == -1) {
52 print STDERR
"ERROR: cannot find file <$gateway_gwfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
54 $GW->Kill (); $GW->TimedWait (1);
58 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
60 if ($client_status != 0) {
61 print STDERR
"ERROR: client returned $client_status\n";
65 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
67 if ($server_status != 0) {
68 print STDERR
"ERROR: server returned $server_status\n";
72 $gateway_status = $GW->WaitKill ($gateway->ProcessStopWaitInterval());
74 if ($gateway_status != 0) {
75 print STDERR
"ERROR: gateway returned $gateway_status\n";
79 $server->DeleteFile ($iorbase);
80 $gateway->DeleteFile ($iorbase);
81 $gateway->DeleteFile ($gwbase);
82 $client->DeleteFile ($gwbase);