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
;
21 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
22 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
24 my $iorbase = "server.ior";
25 my $done_file = "client_done.ior";
26 my $server_iorfile = $server->LocalFile ($iorbase);
27 my $client_iorfile = $client->LocalFile ($iorbase);
29 my $client_done_file = $client->LocalFile ($done_file);
31 $server->DeleteFile($iorbase);
32 $client->DeleteFile($iorbase);
34 $client->DeleteFile($done_file);
36 $SV = $server->CreateProcess ("server",
37 "-ORBdebuglevel $debug_level " .
38 "-o $server_iorfile " .
39 "-s $client_done_file");
41 $CL = $client->CreateProcess ("client",
42 "-k file://$client_iorfile " .
43 "-d $data_bytes -i $iterations -x");
45 $server_status = $SV->Spawn ();
47 if ($server_status != 0) {
48 print STDERR
"ERROR: server returned $server_status\n";
52 if ($server->WaitForFileTimed ($iorbase,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
59 if ($server->GetFile ($iorbase) == -1) {
60 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
64 if ($client->PutFile ($iorbase) == -1) {
65 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
70 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 185);
72 if ($client_status != 0) {
74 print STDERR
"ERROR: client returned $client_status at $time\n";
78 open (FILE
, ">$client_done_file");
79 print FILE
"Client Done !\n";
83 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 390);
85 if ($server_status != 0) {
87 print STDERR
"ERROR: server returned $server_status at $time\n";
91 $server->DeleteFile($iorbase);
92 $client->DeleteFile($iorbase);
93 $client->DeleteFile($done_file);