blob: 25aa493ff3bf75e38b0174769087e2927a596ce5 (
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
|
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
# $Id$
# -*- perl -*-
$usage = "run_tests.pl [-l suppress -ORBGIOPlite] [-n iterations] [-r, for thread-per-rate] [-t low priority threads]\n";
use lib "../../../../../bin";
require ACEutils;
$iorfile = "mtcubit.ior";
$sleeptime = 3;
$gioplite = '-ORBSvcConf iiop_lite.conf';
$iterations = 1000;
$low_priority_threads = 1;
$thread_per_rate = '';
####
#### Process command line args.
####
while ($#ARGV >= $[ && $ARGV[0] =~ /^-/) {
if ($ARGV[0] eq '-l') {
$gioplite = '';
} elsif ($ARGV[0] eq '-n') {
if ($ARGV[1] =~ /^[\da-zA-Z]+$/) {
$iterations = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -n option\n";
die $usage;
}
} elsif ($ARGV[0] eq '-r') {
$thread_per_rate = '-r';
} elsif ($ARGV[0] eq '-t') {
if ($ARGV[1] =~ /^[\da-zA-Z]+$/) {
$low_priority_threads = $ARGV[1]; shift;
} else {
print STDERR "$0: must provide argument for -n option\n";
die $usage;
}
} elsif ($ARGV[0] eq '-?') {
print "$usage";
exit;
} else {
print STDERR "$0: unknown option $ARGV[0]\n";
die $usage;
}
shift;
}
$threads = $low_priority_threads + 1;
# Make sure the file is gone, so we can wait on it.
unlink $iorfile;
$SV = Process::Create ('.' . $DIR_SEPARATOR . "server" . $EXE_EXT,
" $gioplite $thread_per_rate -f $iorfile -t $threads");
sleep $sleeptime;
if (ACE::waitforfile_timed ($iorfile, 10) == -1) {
print STDERR "ERROR: cannot find file <$iorfile>\n";
$SV->Kill (); $SV->TimedWait (1);
exit 1;
}
$CL = Process::Create ('.' . $DIR_SEPARATOR . "client" . $EXE_EXT .
" $gioplite $thread_per_rate " .
"-f $iorfile -n $iterations -t $threads");
$client = $CL->TimedWait (120);
if ($client == -1) {
print STDERR "ERROR: client timedout\n";
$CL->Kill (); $CL->TimedWait (1);
}
$SV->Terminate (); $server = $SV->TimedWait (10);
if ($server == -1) {
print STDERR "ERROR: server could not be terminated\n";
$SV->Kill (); $SV->TimedWait (1);
}
unlink $iorfile;
exit $client == 0 ? 0 : 1;
|