summaryrefslogtreecommitdiff
path: root/TAO/tests/RTCORBA/Banded_Connections/run_test.pl
blob: 4ee9d6717861c40337bfbbce09eff4c69491e8f5 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

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

unshift @INC, '../../../../bin';
require ACEutils;
use Cwd;

$cwd = getcwd();
$iorfile1 = "$cwd$DIR_SEPARATOR" . "test1.ior";
$iorfile2 = "$cwd$DIR_SEPARATOR" . "test2.ior";

ACE::checkForTarget($cwd);

print STDERR "\n********** RTCORBA Priority Banded Connections Unit Test\n";

unlink $iorfile1;
unlink $iorfile2;

# CORBA priorities 66, 75 and 80, etc. are for the SCHED_OTHER class on
# Solaris.  May need to use different values for other platforms
# depending on their native priorities scheme, i.e., based on the
# available range.

$server_args =
    "-n $iorfile1 -o $iorfile2 -b bands.unix -ORBSvcConf server.conf "
    ."-ORBdebuglevel 1 -p 67 -w 78 "
    ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=66 "
    ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=75 "
    ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=80 ";

$client_args =
    "-n file://$iorfile1 -o file://$iorfile2 "
    ."-a 76 -b 80 -c 64";

if ($^O eq "MSWin32")
{
    $server_args =
        "-n $iorfile1 -o $iorfile2 -b bands.nt -ORBSvcConf server.conf "
            ."-ORBdebuglevel 1 -p 1 -w 3 "
            ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=2 "
                ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=5 "
                    ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=6 ";

    $client_args =
        "-n file://$iorfile1 -o file://$iorfile2 "
            ."-a 4 -b 6 -c 3";
}

$SV = Process::Create ($EXEPREFIX."server$EXE_EXT ",
                       $server_args);

if (ACE::waitforfile_timed ($iorfile2, 10) == -1) {
  print STDERR "ERROR: cannot find file <$iorfile2>\n";
  $SV->Kill (); $SV->TimedWait (1);
  exit 1;
}

$CL = Process::Create ($EXEPREFIX."client$EXE_EXT ",
                       $client_args);

$client = $CL->TimedWait (60);
if ($client == -1) {
  print STDERR "ERROR: client timedout\n";
  $CL->Kill (); $CL->TimedWait (1);
}

$server = $SV->TimedWait (60);
if ($server == -1) {
  print STDERR "ERROR: server timedout\n";
  $SV->Kill (); $SV->TimedWait (1);
}

unlink $iorfile1;
unlink $iorfile2;

if ($server != 0 || $client != 0) {
  exit 1;
}

exit 0;