Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / HTIOP / AMI / run_test.pl
blob7cdc8f8fde5d5469045e84ec868955fb0af4a956
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 my $clnt_conf = "muxed$PerlACE::svcconf_ext";
15 foreach $i (@ARGV) {
16 if ($i eq '-mux') {
17 # $clnt_conf = "muxed$PerlACE::svcconf_ext";
19 elsif ($i eq '-debug') {
20 $debug_level = '10';
22 elsif ($i eq '-exclusive') {
23 $clnt_conf = "exclusive$PerlACE::svcconf_ext";
27 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
28 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
30 my $iterations = '1';
31 my $host = $server->HostName();
33 my $iorbase = "server.ior";
34 my $client_clnt_conf = $client->LocalFile($clnt_conf);
35 my $server_iorfile = $server->LocalFile ($iorbase);
36 my $client_iorfile = $client->LocalFile ($iorbase);
37 $server->DeleteFile($iorbase);
38 $client->DeleteFile($iorbase);
40 $SV = $server->CreateProcess ("server", "-ORBEndpoint htiop://$host: -ORBdebuglevel $debug_level ".
41 "-d -o $server_iorfile");
42 $CL = $client->CreateProcess ("simple_client", "-ORBsvcconf $client_clnt_conf -ORBdebuglevel $debug_level ".
43 "-k file://$client_iorfile -i $iterations -x -d");
45 $server_status = $SV->Spawn ();
47 if ($server_status != 0) {
48 print STDERR "ERROR: server returned $server_status\n";
49 exit 1;
52 if ($server->WaitForFileTimed ($iorbase,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
56 exit 1;
59 if ($server->GetFile ($iorbase) == -1) {
60 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
62 exit 1;
65 if ($client->PutFile ($iorbase) == -1) {
66 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
68 exit 1;
71 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
73 if ($client_status != 0) {
74 print STDERR "ERROR: client returned $client_status\n";
75 $status = 1;
78 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
80 if ($server_status != 0) {
81 print STDERR "ERROR: server returned $server_status\n";
82 $status = 1;
85 $server->DeleteFile($iorbase);
86 $client->DeleteFile($iorbase);
88 exit $status;