summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/InterfaceRepo/Bug_2962_Regression/run_test.pl
blob: bff7dd8e2c4fda11b7a39eaa9274d8cb1fdce798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
     & eval 'exec perl -S $0 $argv:q'
     if 0;

# $Id$
# -*- perl -*-

use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;

$status = 0;
my $exec_extn="";
if ($^O eq "MSWin32") {
  $exec_extn=".exe";
}
$ifr_service= "$ENV{ACE_ROOT}/bin/IFR_Service";
if (! -e $ifr_service . $exec_extn ) {
    $ifr_service= "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/IFR_Service";
    if (! -e $ifr_service . $exec_extn ) {
      $ifr_service = "$ENV{TAO_ROOT}/orbsvcs/IFR_Service/Release/IFR_Service";
      if (! -e $ifr_service . $exec_extn ) {
            print STDERR "ERROR: IFR_Service not found.\n";
            exit 1;
        }
    }
}
$iorfile = PerlACE::LocalFile ("ifr.ior");
unlink $iorfile;

print STDERR "\n\n==== Running Recursive Array length corruption test\n";

if (PerlACE::is_vxworks_test()) {
    $SV = new PerlACE::ProcessVX ("$ifr_service", "-o $iorfile");
}
else {
    $SV = new PerlACE::Process ("$ifr_service", "-o $iorfile");
}

print STDERR "Starting IFR Service\n";
$SV->Spawn ();
if (PerlACE::waitforfile_timed ($iorfile,
     $PerlACE::wait_interval_for_process_creation) == -1) {
    print STDERR "ERROR: cannot find file <$iorfile>\n";
    $SV->Kill (); $SV->TimedWait (1);
    exit 1;
}

$LOADER = new PerlACE::Process ("$PerlACE::ACE_ROOT/bin/tao_ifr",
                                "-ORBInitRef InterfaceRepository=file://$iorfile test.idl");
print STDERR "Loading test.idl into IFR service\n";
$status = $LOADER->SpawnWaitKill (15);
if ($status != 0) {
   print STDERR "ERROR: IFR Loading returned $status\n";
}
else {
   print STDERR "Starting Test\n";
   $CL = new PerlACE::Process ("client");
   $status = $CL->SpawnWaitKill (30);
   if ($status != 0) {
      print STDERR "ERROR: client returned $status\n";
   }
}

$SV->Kill(); $SV->TimedWait (1);
unlink $iorfile;

exit $status;