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
;
23 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
24 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
26 my $iorbase = "test.ior";
27 my $server_iorfile = $server->LocalFile ($iorbase);
28 my $client_iorfile = $client->LocalFile ($iorbase);
29 $server->DeleteFile($iorbase);
30 $client->DeleteFile($iorbase);
33 $SV = $server->CreateProcess ("server",
34 "-ORBdebuglevel $debug_level " .
35 "-ORBEndpoint diop://:$port " .
36 "-o $server_iorfile");
38 $CL = $client->CreateProcess ("client",
39 "-ORBdebuglevel $debug_level " .
40 "-k file://$client_iorfile " .
41 "-t $timeout -i $iterations");
43 $server_status = $SV->Spawn ();
45 if ($server_status != 0) {
46 print STDERR
"ERROR: server returned $server_status\n";
50 if ($server->WaitForFileTimed ($iorbase,
51 $server->ProcessStartWaitInterval()) == -1) {
52 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
57 if ($server->GetFile ($iorbase) == -1) {
58 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
59 $SV->Kill (); $SV->TimedWait (1);
62 if ($client->PutFile ($iorbase) == -1) {
63 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
68 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 75);
70 if ($client_status != 0) {
71 print STDERR
"ERROR: client returned $client_status\n";
75 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
77 if ($server_status != 0) {
78 print STDERR
"ERROR: server returned $server_status\n";
82 $server->DeleteFile($iorbase);
83 $client->DeleteFile($iorbase);