Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / HTIOP / BiDirectional / run_test.pl
blobddef9c95c730590160ba954ec14da95f2f7ca11f
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';
12 $iterations = '100';
14 foreach $i (@ARGV) {
15 if ($i eq '-debug') {
16 $debug_level = '10';
20 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
21 my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
23 my $iorbase = "test.ior";
24 my $outside = "outside.conf";
25 my $inside = "inside.conf";
27 my $server_iorfile = $server->LocalFile ($iorbase);
28 my $client_iorfile = $client->LocalFile ($iorbase);
30 my $server_conf = $server->LocalFile ($outside);
31 my $client_conf = $client->LocalFile ($inside);
34 $server->DeleteFile($iorbase);
35 $client->DeleteFile($iorbase);
37 $hostname = $server->HostName();
39 $SV = $server->CreateProcess ("server",
40 "-ORBdebuglevel $debug_level " .
41 "-ORBEndPoint htiop://$hostname: " .
42 "-ORBSvcConf $server_conf " .
43 "-i $iterations " .
44 "-o $server_iorfile");
47 $CL = $client->CreateProcess ("client",
48 "-ORBSvcConf $client_conf " .
49 "-k file://$client_iorfile");
50 $server_status = $SV->Spawn ();
52 if ($server_status != 0) {
53 print STDERR "ERROR: server returned $server_status\n";
54 exit 1;
57 if ($server->WaitForFileTimed ($iorbase,
58 $server->ProcessStartWaitInterval()) == -1) {
59 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
60 $SV->Kill (); $SV->TimedWait (1);
61 exit 1;
64 if ($server->GetFile ($iorbase) == -1) {
65 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
67 exit 1;
69 if ($client->PutFile ($iorbase) == -1) {
70 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
71 $SV->Kill (); $SV->TimedWait (1);
72 exit 1;
75 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 10);
77 if ($client_status != 0) {
78 print STDERR "ERROR: client returned $client_status\n";
79 $status = 1;
82 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 10);
84 if ($server_status != 0) {
85 print STDERR "ERROR: server returned $server_status\n";
86 $status = 1;
89 $server->DeleteFile($iorbase);
90 $client->DeleteFile($iorbase);
92 exit $status;