File: maxbackend.t

package info (click to toggle)
speedy-cgi-perl 2.22-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,128 kB
  • ctags: 890
  • sloc: ansic: 4,487; sh: 1,105; perl: 945; makefile: 89
file content (32 lines) | stat: -rwxr-xr-x 546 bytes parent folder | download | duplicates (4)
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

# Check to see if the maxbackends limit is in effect

print "1..1\n";

my $scr = 't/scripts/maxbackend';
utime time, time, $scr;
sleep 1;

my $cmd = "$ENV{SPEEDY} -- -M2 $scr </dev/null |";

open (RUN1, $cmd);
sleep 1;
open (RUN2, $cmd);
sleep 1;
open (RUN3, $cmd);

$pid1 = <RUN1>; chop $pid1;
$pid2 = <RUN2>; chop $pid2;
$pid3 = <RUN3>; chop $pid3;

close(RUN1);
close(RUN2);
close(RUN3);

my $ok =  $pid1 && ($pid3 == $pid1 || $pid2 == $pid1); 

foreach my $p ($pid1, $pid2, $pid3) {
    $p && kill 9, $p;
}

print $ok ? "ok\n" : "not ok\n";