File: alarm.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 (23 lines) | stat: -rw-r--r-- 590 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

# Test#1
# Bug in 2.11 release.  The frontend blocks sigalarms, but fails to unblock
# them after forking the backend, making alarms unusable in the backend.

# Test#2
# Alarms that occur after perl exits should have no effect on the backend.

print "1..2\n";

# Test 1 - just print something
my $line = `$ENV{SPEEDY} t/scripts/alarm`;
print ($line =~ /fail/ ? "not ok\n" : "ok\n");

# Test 2 -
my $pid1 = 0 + `$ENV{SPEEDY} t/scripts/alarm 1`;
sleep(2);
my $pid2 = 0 + `$ENV{SPEEDY} t/scripts/alarm 1`;
if ($pid1 > 0 && $pid1 == $pid2) {
    print "ok\n";
} else {
    print "not ok\n";
}