summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Trading/run_test.pl
blob: e520d88327a7b85450d05252f84fb20bf02e6be2 (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
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;
require Process;

$ior = "trading.ior";
$sleeptime = 20;
$status = 0;

$TS = Process::Create ("..".$DIR_SEPARATOR.
                       "..".$DIR_SEPARATOR.
                       "Trading_Service".$DIR_SEPARATOR.
                       "Trading_Service".$EXE_EXT,
                       " -TSdumpior $ior ");

if (ACE::waitforfile_timed ($ior, $sleeptime) == -1) {
  print STDERR "ERROR: waiting for trading service IOR file\n";
  $TS->Kill (); $TS->TimedWait (1);
  exit 1;
}

$E = Process::Create ($EXEPREFIX."export_test".$EXE_EXT,
		      "-ORBTradingServiceIOR file://$ior");

sleep $sleeptime;

$I = Process::Create ($EXEPREFIX."import_test".$EXE_EXT,
		      "-ORBTradingServiceIOR file://$ior");

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

$E->Terminate (); 
if ($E->TimedWait (15) == -1) {
  $status =1;
  print STDERR "ERROR: export test timedout\n";
  $E->Kill (); $E->TimedWait (1);
}

$TS->Terminate();
if ($TS->TimedWait (15) == -1) {
  print STDERR "ERROR: couldn't terminate the trading service nicely\n";
  $TS->Kill (); $TS->TimedWait (1);
  $status = 1;
}

unlink $ior;

exit $status;