1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
9 use lib
"$ENV{ACE_ROOT}/bin";
10 use PerlACE
::TestTarget
;
12 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
13 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 my $iorbase1 = "test1.ior";
16 my $iorbase2 = "test2.ior";
18 my $server1_iorfile = $server->LocalFile ($iorbase1);
19 my $server2_iorfile = $server->LocalFile ($iorbase2);
20 my $client1_iorfile = $client->LocalFile ($iorbase1);
21 my $client2_iorfile = $client->LocalFile ($iorbase2);
23 $server->DeleteFile ($iorbase1);
24 $server->DeleteFile ($iorbase2);
25 $client->DeleteFile ($iorbase1);
26 $client->DeleteFile ($iorbase2);
28 my $SV = $server->CreateProcess ("server", "-o $server1_iorfile -o $server2_iorfile");
29 my $CL = $client->CreateProcess ("client", "-k file://$client1_iorfile -k file://$client2_iorfile");
33 print STDERR
"\n\n==== Running PortableInterceptor::ForwardRequest test\n";
37 if ($server->WaitForFileTimed ($iorbase1,
38 $server->ProcessStartWaitInterval()) == -1) {
39 print STDERR
"ERROR: cannot find file <$server1_iorfile>\n";
40 $SV->Kill (); $SV->TimedWait (1);
44 if ($server->WaitForFileTimed ($iorbase2,
45 $server->ProcessStartWaitInterval()) == -1) {
46 print STDERR
"ERROR: cannot find file <$server2_iorfile>\n";
47 $SV->Kill (); $SV->TimedWait (1);
51 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
53 if ($client_status != 0) {
54 print STDERR
"ERROR: client returned $client_status\n";
58 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
60 if ($server_status != 0) {
61 print STDERR
"ERROR: server returned $server_status\n";
65 $server->DeleteFile ($iorbase1);
66 $server->DeleteFile ($iorbase2);
67 $client->DeleteFile ($iorbase1);
68 $client->DeleteFile ($iorbase2);