summaryrefslogtreecommitdiff
path: root/trunk/TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl
blob: 52b391783e5cec4541e92a1369a22f7ad1bc4b71 (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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
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;

PerlACE::check_privilege_group();

$ior = PerlACE::LocalFile ("supplier.ior");
$namingior = PerlACE::LocalFile ("naming.ior");
$notifyior = PerlACE::LocalFile ("notify.ior");
$notify_conf = PerlACE::LocalFile ("notify$PerlACE::svcconf_ext");
$status = 0;

$port = PerlACE::uniqueid () + 10001;
$NS = new PerlACE::Process ("../../../../Naming_Service/Naming_Service",
                            "-ORBEndpoint iiop://localhost:$port " .
                            "-o $namingior");
$TS = new PerlACE::Process ("../../../../Notify_Service/Notify_Service",
                            "-ORBInitRef NameService=iioploc://" .
                            "localhost:$port/NameService " .
                            "-IORoutput $notifyior -ORBSvcConf " .
                            "$notify_conf");
$STS = new PerlACE::Process ("Structured_Supplier",
                             "-ORBInitRef NameService=iioploc://" .
                             "localhost:$port/NameService");
$STC = new PerlACE::Process ("Structured_Consumer");

$SES = new PerlACE::Process ("Sequence_Supplier",
                             "-ORBInitRef NameService=iioploc://" .
                             "localhost:$port/NameService");
$SEC = new PerlACE::Process ("Sequence_Consumer");

unlink $ior;
unlink $notifyior;
unlink $namingior;

$client_args = "-ORBInitRef NameService=iioploc://localhost:" .
               "$port/NameService";
               
$NS->Spawn ();
if (PerlACE::waitforfile_timed ($namingior, 20) == -1) {
      print STDERR "ERROR: waiting for the naming service to start\n";
      $NS->Kill ();
      exit 1;
}

$TS->Spawn ();
if (PerlACE::waitforfile_timed ($notifyior, 20) == -1) {
    print STDERR "ERROR: waiting for the notify service to start\n";
    $TS->Kill ();
    $NS->Kill ();
    exit 1;
}

######################################################################
print "**** Structured Supplier -> 2 Structured Consumers ****\n";
$STS->Spawn ();
if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
    print STDERR "ERROR: waiting for the supplier to start\n";
    $STS->Kill ();
    $TS->Kill ();
    $NS->Kill ();
    exit 1;
}

$STC->Arguments($client_args);
print $STC->CommandLine ()."\n";
$client = $STC->SpawnWaitKill (300);
print "\n";
if ($client != 0) {
    $STS->Kill ();
    $TS->Kill ();
    $NS->Kill ();
    exit 1;
}
$server = $STS->WaitKill(5);
if ($server != 0) {
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}


######################################################################
print "**** Structured Supplier -> Structured Consumer (filtered) ****\n";

unlink $ior;
$STS->Spawn ();
if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
    print STDERR "ERROR: waiting for the supplier to start\n";
    $STS->Kill ();
    $TS->Kill ();
    $NS->Kill ();
    exit 1;
}

$STC->Arguments($client_args . " -f -c 1");
$client = $STC->SpawnWaitKill (60);
print "\n";
if ($client != 0) {
    $STS->Kill ();
    $TS->Kill ();
    $NS->Kill ();
    exit 1;
}
$server = $STS->WaitKill(5);
if ($server != 0) {
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}

######################################################################
print "**** Structured Supplier -> Sequence Consumer (filtered) ****\n";

unlink $ior;
$STS->Spawn ();
if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
  print STDERR "ERROR: waiting for the supplier to start\n";
  $STS->Kill ();
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}

$SEC->Arguments($client_args . " -f -c 1");
$client = $SEC->SpawnWaitKill (60);
print "\n";
if ($client != 0) {
  $STS->Kill ();
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}
$server = $STS->WaitKill(5);
if ($server != 0) {
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}

######################################################################
print "**** Sequence Supplier -> 2 Sequence Consumers ****\n";

unlink $ior;
$SES->Spawn ();
if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
    print STDERR "ERROR: waiting for the supplier to start\n";
    $SES->Kill ();
    $TS->Kill ();
    $NS->Kill ();
    exit 1;
}

$SEC->Arguments($client_args);
$client = $SEC->SpawnWaitKill (60);
print "\n";
if ($client != 0) {
  $SES->Kill ();
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}
$server = $SES->WaitKill(5);
if ($server != 0) {
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}

######################################################################
print "**** Sequence Supplier -> Sequence Consumer (filtered) ****\n";

unlink $ior;
$SES->Spawn ();
if (PerlACE::waitforfile_timed ($ior, 20) == -1) {
  print STDERR "ERROR: waiting for the supplier to start\n";
  $SES->Kill ();
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}

$SEC->Arguments($client_args . " -f -c 1");
$client = $SEC->SpawnWaitKill (60);
print "\n";
if ($client != 0) {
  $SES->Kill ();
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}
$server = $SES->WaitKill(5);
if ($server != 0) {
  $TS->Kill ();
  $NS->Kill ();
  exit 1;
}

$TS->Kill ();
$NS->Kill ();

unlink $ior;
unlink $notifyior;
unlink $namingior;


exit $status;