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
;
10 $includes = "-I ../../../.. -I ../../../../orbsvcs";
25 my $server1 = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
26 my $server2 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
27 my $client = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
29 my $ior1file = "ifr.ior";
31 #Files which used by server1
32 my $server1_ior1file = $server1->LocalFile ($ior1file);
33 $server1->DeleteFile($ior1file);
35 #Files which used by server2
36 my $server2_ior1file = $server2->LocalFile ($ior1file);
37 $server2->DeleteFile($ior1file);
39 #Files which used by client
40 my $client_ior1file = $client->LocalFile ($ior1file);
41 $client->DeleteFile($ior1file);
44 $SV1 = $server1->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/IFR_Service/tao_ifr_service",
45 "-ORBdebuglevel $debug_level " .
46 "-o $server1_ior1file");
48 $SV2 = $server2->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_ifr",
49 "-ORBdebuglevel $debug_level " .
50 "-ORBInitRef InterfaceRepository=file://$server1_ior1file $includes test.idl");
52 $CL = $client->CreateProcess ("IDL3_Test",
53 "-ORBInitRef InterfaceRepository=file://$client_ior1file " .
56 $server_status = $SV1->Spawn ();
58 if ($server_status != 0) {
59 print STDERR
"ERROR: server returned $server_status\n";
63 if ($server1->WaitForFileTimed ($ior1file,
64 $server1->ProcessStartWaitInterval()) == -1) {
65 print STDERR
"ERROR: cannot find file <$server1_ior1file>\n";
66 $SV1->Kill (); $SV1->TimedWait (1);
70 if ($server1->GetFile ($ior1file) == -1) {
71 print STDERR
"ERROR: cannot retrieve file <$server1_ior1file>\n";
72 $SV1->Kill (); $SV1->TimedWait (1);
76 if ($server2->PutFile ($ior1file) == -1) {
77 print STDERR
"ERROR: cannot set file <$server2_ior1file>\n";
78 $SV1->Kill (); $SV1->TimedWait (1);
82 if ($client->PutFile ($ior1file) == -1) {
83 print STDERR
"ERROR: cannot set file <$client_ior1file>\n";
84 $SV1->Kill (); $SV1->TimedWait (1);
88 $server_status = $SV2->SpawnWaitKill ($server2->ProcessStartWaitInterval());
90 if ($server_status != 0) {
91 print STDERR
"ERROR: server returned $server_status\n";
95 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
97 if ($client_status != 0) {
98 print STDERR
"ERROR: client returned $client_status\n";
102 $server_status = $SV1->TerminateWaitKill ($server1->ProcessStopWaitInterval());
104 if ($server_status != 0) {
105 print STDERR
"ERROR: server returned $server_status\n";
109 $server1->DeleteFile($ior1file);
110 $server2->DeleteFile($ior1file);
111 $client->DeleteFile($ior1file);