blob: 5cb0311582bff3e8226bfc33d7ce999f20f750ff (
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
|
#!/bin/sh
# $FreeBSD$
base=`basename $0`
echo "1..3"
name="pkill -j <jid>"
if [ `id -u` -eq 0 ]; then
sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
ln -sf /bin/sleep $sleep
jail / $base-1 127.0.0.1 $sleep 5 &
chpid=$!
jail / $base-2 127.0.0.1 $sleep 5 &
chpid2=$!
$sleep 5 &
chpid3=$!
sleep 0.5
jid=`jls | awk "/127\\.0\\.0\\.1.*${base}-1/ {print \$1}"`
if pkill -f -j $jid $sleep && sleep 0.5 &&
! kill $chpid && kill $chpid2 $chpid3; then
echo "ok 1 - $name"
else
echo "not ok 1 - $name"
fi 2>/dev/null
rm -f $sleep
else
echo "ok 1 - $name # skip Test needs uid 0."
fi
name="pkill -j any"
if [ `id -u` -eq 0 ]; then
sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
ln -sf /bin/sleep $sleep
jail / $base-1 127.0.0.1 $sleep 5 &
chpid=$!
jail / $base-2 127.0.0.1 $sleep 5 &
chpid2=$!
$sleep 5 &
chpid3=$!
sleep 0.5
if pkill -f -j any $sleep && sleep 0.5 &&
! kill $chpid && ! kill $chpid2 && kill $chpid3; then
echo "ok 2 - $name"
else
echo "not ok 2 - $name"
fi 2>/dev/null
rm -f $sleep
else
echo "ok 2 - $name # skip Test needs uid 0."
fi
name="pkill -j none"
if [ `id -u` -eq 0 ]; then
sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
ln -sf /bin/sleep $sleep
$sleep 5 &
chpid=$!
jail / $base 127.0.0.1 $sleep 5 &
chpid2=$!
sleep 0.5
if pkill -f -j none $sleep && sleep 0.5 &&
! kill $chpid && kill $chpid2; then
echo "ok 3 - $name"
else
echo "not ok 3 - $name"
fi 2>/dev/null
rm -f $sleep
else
echo "ok 3 - $name # skip Test needs uid 0."
fi
|