Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / InterfaceRepo / Bug_3200_Regression / run_test.pl
blobad82c01980f193ac210e427e86b0540a697d88f4
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '0';
13 $nice = "";
14 $locking = "";
16 foreach $i (@ARGV) {
17 if ($i eq '-debug') {
18 $debug_level = '10';
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 " .
42 "$nice " .
43 "-o $server_ior1file " .
44 "$locking");
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");
55 print <<EOF;
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 ******************************************************************
65 EOF
67 $server_status = $SV->Spawn ();
69 if ($server_status != 0) {
70 print STDERR "ERROR: server returned $server_status\n";
71 exit 1;
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);
78 exit 1;
81 if ($server->GetFile ($ior1file) == -1) {
82 print STDERR "ERROR: cannot retrieve file <$server_ior1file>\n";
83 $SV->Kill (); $SV->TimedWait (1);
84 exit 1;
87 if ($client1->PutFile ($ior1file) == -1) {
88 print STDERR "ERROR: cannot set file <$client1_ior1file>\n";
89 $SV->Kill (); $SV->TimedWait (1);
90 exit 1;
93 if ($client2->PutFile ($ior1file) == -1) {
94 print STDERR "ERROR: cannot set file <$client2_ior1file>\n";
95 $SV->Kill (); $SV->TimedWait (1);
96 exit 1;
99 $client_status = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 45);
101 if ($client_status != 0) {
102 print STDERR "ERROR: client returned $client_status\n";
103 $status = 1;
106 $client_status = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 45);
108 if ($client_status != 0) {
109 print STDERR "ERROR: client returned $client_status\n";
110 $status = 1;
113 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
115 if ($server_status != 0) {
116 print STDERR "ERROR: server returned $server_status\n";
117 $status = 1;
120 $server->DeleteFile($ior1file);
121 $client1->DeleteFile($ior1file);
122 $client2->DeleteFile($ior1file);
124 exit $status;