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
;
19 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
22 my $iorbase = "ior.ior";
23 my $iogrbase = "iogr.ior";
24 my $server_iorfile = $server->LocalFile ($iorbase);
25 my $client_iorfile = $client->LocalFile ($iorbase);
26 $server->DeleteFile($iorbase);
27 $client->DeleteFile($iorbase);
29 my $server_iogrfile = $server->LocalFile ($iogrbase);
30 my $client_iogrfile = $client->LocalFile ($iogrbase);
32 $server->DeleteFile($iogrbase);
33 $client->DeleteFile($iogrbase);
35 $SV = $server->CreateProcess ("server",
36 "-ORBdebuglevel $debug_level " .
37 "-o $server_iorfile " .
38 "-p $server_iogrfile");
40 $CL = $client->CreateProcess ("client",
41 "-k file://$client_iorfile " .
42 "-l file://$client_iogrfile ");
44 $server_status = $SV->Spawn ();
46 if ($server_status != 0) {
47 print STDERR
"ERROR: server returned $server_status\n";
51 if ($server->WaitForFileTimed ($iorbase,
52 $server->ProcessStartWaitInterval()) == -1) {
53 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
54 $SV->Kill (); $SV->TimedWait (1);
58 if ($server->WaitForFileTimed ($iogrbase,
59 $server->ProcessStartWaitInterval()) == -1) {
60 print STDERR
"ERROR: cannot find file <$server_iogrfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
65 if ($server->GetFile ($iorbase) == -1) {
66 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
70 if ($client->PutFile ($iorbase) == -1) {
71 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
72 $SV->Kill (); $SV->TimedWait (1);
75 if ($server->GetFile ($iogrbase) == -1) {
76 print STDERR
"ERROR: cannot retrieve file <$server_iogrfile>\n";
77 $SV->Kill (); $SV->TimedWait (1);
81 if ($client->PutFile ($iogrbase) == -1) {
82 print STDERR
"ERROR: cannot set file <$client_iogrfile>\n";
83 $SV->Kill (); $SV->TimedWait (1);
87 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
89 if ($client_status != 0) {
90 print STDERR
"ERROR: client returned $client_status\n";
94 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
96 if ($server_status != 0) {
97 print STDERR
"ERROR: server returned $server_status\n";
101 $server->DeleteFile($iorbase);
102 $client->DeleteFile($iorbase);
103 $server->DeleteFile($iogrbase);
104 $client->DeleteFile($iogrbase);