Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / InterfaceRepo / Persistence_Test / run_test.pl
blob8b3b7c79dd4c65193849e9ee7be07df29832a6a9
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 $persistent = "-p";
11 $status = 0;
13 $debug = "";
14 $query_opt = "-q";
15 $other = "";
17 for ($i = 0; $i <= $#ARGV; $i++) {
18 if ($ARGV[$i] eq "-d") {
19 $debug = "-d";
21 else {
22 $other .= $ARGV[$i];
26 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
27 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
29 my $iorbase = "if_repo.ior";
30 my $backing_file = "ifr_default_backing_store";
33 my $server_iorfile = $server->LocalFile ($iorbase);
34 my $server_backing_file = $server->LocalFile ($backing_file);
35 my $client_iorfile = $client->LocalFile ($iorbase);
36 $server->DeleteFile($iorbase);
37 $server->DeleteFile($backing_file);
38 $client->DeleteFile($iorbase);
40 $SV = $server->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/IFR_Service/tao_ifr_service",
41 " -o $server_iorfile " .
42 " $persistent");
44 $CL = $client->CreateProcess ("Persistence_Test",
45 "-ORBInitRef InterfaceRepository=file://$client_iorfile");
47 $server_status = $SV->Spawn ();
49 if ($server_status != 0) {
50 print STDERR "ERROR: server returned $server_status\n";
51 exit 1;
54 if ($server->WaitForFileTimed ($iorbase,
55 $server->ProcessStartWaitInterval()) == -1) {
56 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
58 $server->DeleteFile($backing_file);
59 exit 1;
62 if ($server->GetFile ($iorbase) == -1) {
63 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
65 $server->DeleteFile($backing_file);
66 exit 1;
68 if ($client->PutFile ($iorbase) == -1) {
69 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
70 $SV->Kill (); $SV->TimedWait (1);
71 $server->DeleteFile($backing_file);
72 exit 1;
75 print "Starting Persistence_Test 1\n";
77 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
79 if ($client_status != 0) {
80 print STDERR "ERROR: client returned $client_status\n";
81 $status = 1;
84 print "Terminating IFR_Service\n";
85 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
87 if ($server_status != 0) {
88 print STDERR "ERROR: server returned $server_status\n";
89 $status = 1;
92 $server->DeleteFile($iorbase);
93 $client->DeleteFile($iorbase);
95 $CL->Arguments ("-ORBInitRef InterfaceRepository=file://$client_iorfile $debug $query_opt");
97 $server_status = $SV->Spawn ();
99 if ($server_status != 0) {
100 print STDERR "ERROR: server returned $server_status\n";
101 exit 1;
104 if ($server->WaitForFileTimed ($iorbase,
105 $server->ProcessStartWaitInterval()) == -1) {
106 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
107 $SV->Kill (); $SV->TimedWait (1);
108 $server->DeleteFile($backing_file);
109 exit 1;
112 if ($server->GetFile ($iorbase) == -1) {
113 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
114 $SV->Kill (); $SV->TimedWait (1);
115 $server->DeleteFile($backing_file);
116 exit 1;
118 if ($client->PutFile ($iorbase) == -1) {
119 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
120 $SV->Kill (); $SV->TimedWait (1);
121 $server->DeleteFile($backing_file);
122 exit 1;
125 print "Starting Persistence_Test 2\n";
127 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
129 if ($client_status != 0) {
130 print STDERR "ERROR: client returned $client_status\n";
131 $status = 1;
134 print "Terminating IFR_Service\n";
135 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
137 if ($server_status != 0) {
138 print STDERR "ERROR: server returned $server_status\n";
139 $status = 1;
142 $server->DeleteFile($iorbase);
143 $client->DeleteFile($iorbase);
144 $server->DeleteFile($backing_file);
146 exit $status;