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
;
13 my $target1 = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
14 my $target2 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 my $host = $target1->HostName();
16 my $port = $target1->RandomPort ();
17 $synchfile = $target1->LocalFile ("$synchbase");
19 my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile");
21 $target1->DeleteFile ($synchbase);
22 $target2->DeleteFile ($synchbase);
24 $server_status = $SV->Spawn ();
26 if ($server_status != 0) {
27 print STDERR
"ERROR: server returned $server_status\n";
31 if ($target1->WaitForFileTimed ($synchbase,
32 $target1->ProcessStartWaitInterval()) == -1) {
33 print STDERR
"ERROR: cannot find file <$synchfile>\n";
34 $SV->Kill (); $SV->TimedWait (1);
38 $target1->DeleteFile ($synchbase);
40 my $CL = $target2->CreateProcess ("client", " -h $host -p $port");
42 $client = $CL->SpawnWaitKill ($target2->ProcessStartWaitInterval() + 285);
45 print STDERR
"ERROR: client returned $client\n";
49 $server = $SV->WaitKill ($target1->ProcessStopWaitInterval());
52 print STDERR
"ERROR: server returned $server\n";
56 $target1->GetStderrLog();
57 $target2->GetStderrLog();
59 $target1->DeleteFile ($synchbase);
60 $target2->DeleteFile ($synchbase);