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
;
22 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
23 my $client1 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
24 my $client2 = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
26 my $ior1file = "if_repo.ior";
28 #Files which used by server1
29 my $server_ior1file = $server->LocalFile ($ior1file);
30 $server->DeleteFile($ior1file);
32 #Files which used by client1
33 my $client1_ior1file = $client1->LocalFile ($ior1file);
34 $client1->DeleteFile($ior1file);
36 #Files which used by client2
37 my $client2_ior1file = $client2->LocalFile ($ior1file);
38 $client2->DeleteFile($ior1file);
40 $SV = $server->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/IFR_Service/tao_ifr_service",
41 "-ORBdebuglevel $debug_level " .
43 "-o $server_ior1file " .
46 $CL1 = $client1->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_ifr",
47 "-ORBdebuglevel $debug_level " .
48 "-ORBInitRef InterfaceRepository=file://$client1_ior1file b1.idl");
50 $CL2 = $client2->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_ifr",
51 "-ORBdebuglevel $debug_level " .
52 "-ORBInitRef InterfaceRepository=file://$client2_ior1file b2.idl");
56 ********** IMPORTANT NOTE ***********
57 While it is easy to confirm this failure via inspection of
58 output from tao_ifr, at the time of committing this test tao_ifr
59 did not consistently exit with a non-zero return code when hitting
60 an error, making automatic detection of success/failure difficult.
62 If/when this behavior of tao_ifr changes, this test driver can be
63 updated so that it properly detects success/failure of tao_ifr.
64 ******************************************************************
67 $server_status = $SV->Spawn ();
69 if ($server_status != 0) {
70 print STDERR
"ERROR: server returned $server_status\n";
74 if ($server->WaitForFileTimed ($ior1file,
75 $server->ProcessStartWaitInterval()) == -1) {
76 print STDERR
"ERROR: cannot find file <$server_ior1file>\n";
77 $SV->Kill (); $SV->TimedWait (1);
81 if ($server->GetFile ($ior1file) == -1) {
82 print STDERR
"ERROR: cannot retrieve file <$server_ior1file>\n";
83 $SV->Kill (); $SV->TimedWait (1);
87 if ($client1->PutFile ($ior1file) == -1) {
88 print STDERR
"ERROR: cannot set file <$client1_ior1file>\n";
89 $SV->Kill (); $SV->TimedWait (1);
93 if ($client2->PutFile ($ior1file) == -1) {
94 print STDERR
"ERROR: cannot set file <$client2_ior1file>\n";
95 $SV->Kill (); $SV->TimedWait (1);
99 $client_status = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 45);
101 if ($client_status != 0) {
102 print STDERR
"ERROR: client returned $client_status\n";
106 $client_status = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 45);
108 if ($client_status != 0) {
109 print STDERR
"ERROR: client returned $client_status\n";
113 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
115 if ($server_status != 0) {
116 print STDERR
"ERROR: server returned $server_status\n";
120 $server->DeleteFile($ior1file);
121 $client1->DeleteFile($ior1file);
122 $client2->DeleteFile($ior1file);