blob: e557bdb3ddc7724f4fe5af3b7bb38f5d374ab98f (
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
|
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;
use Cwd;
$cwd = getcwd();
$ior = "$cwd$DIR_SEPARATOR" . "trading.ior";
$ready_file = "$cwd$DIR_SEPARATOR" . "export_test_ready";
$sleeptime = 20;
$status = 0;
unlink $ior;
unlink $ready_file;
ACE::checkForTarget($cwd);
$TS = Process::Create ($EXEPREFIX."..".$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,
"-ORBInitRef TradingService=file://$ior"
. " -quiet");
if (ACE::waitforfile_timed ($ready_file, 120) == -1) {
print STDERR "ERROR: waiting for the export test to finish\n";
$E->Kill (); $E->TimedWait (1);
$TS->Kill (); $TS->TimedWait (1);
exit 1;
}
$I = Process::Create ($EXEPREFIX."import_test".$EXE_EXT,
"-ORBInitRef TradingService=file://$ior"
. " -quiet");
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;
unlink $ready_file;
exit $status;
|