summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Event_Latency/run_test.pl
blob: 05dc50eaf6725dc0e255c7208bd5650920b33757 (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
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

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

unshift @INC, '../../../../bin';
require Process;
require ACEutils;

$NS_ior = "NameService.ior";
$sleeptime = 3;
$status = 0;

$NS = Process::Create ("..".$DIR_SEPARATOR
		       ."..".$DIR_SEPARATOR
		       ."Naming_Service".$DIR_SEPARATOR
		       ."Naming_Server".$EXE_EXT,
		       " -o $NS_ior ");

if (ACE::waitforfile_timed ($NS_ior, 5) == -1) {
  print STDERR "ERROR: waiting for naming service IOR file\n";
  $NS->Kill (); $NS->TimedWait (1);
  exit 1;
}

$ES = Process::Create ("..".$DIR_SEPARATOR
		       ."..".$DIR_SEPARATOR
		       ."Event_Service".$DIR_SEPARATOR
		       ."Event_Service".$EXE_EXT,
		       "-ORBNameServiceIOR file://$NS_ior -t new");

sleep $sleeptime;

$TEST = Process::Create (".".$DIR_SEPARATOR."Event_Latency".$EXE_EXT,
			 "-ORBNameServiceIOR file://$NS_ior"
			 ." -j -m 100");

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


$NS->Terminate();
$ES->Terminate();
if ($NS->TimedWait (5) == -1 || $ES->TimedWait (5) == -1) {
  print STDERR "ERROR: couldn't terminate the services nicely\n";
  $NS->Kill (); $NS->TimedWait (1);
  $ES->Kill (); $ES->TimedWait (1);
  $status = 1;
}

unlink $NS_ior;

# @@ Capture any errors from the server too.
exit $status;