xref: /freebsd/bin/pkill/tests/pkill-s_test.sh (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1#!/bin/sh
2
3base=`basename $0`
4
5echo "1..2"
6
7name="pkill -s <sid>"
8sid=`ps -o tsid -p $$ | tail -1`
9sleep=$(pwd)/sleep.txt
10ln -sf /bin/sleep $sleep
11$sleep 5 &
12sleep 0.3
13pkill -f -s $sid $sleep
14ec=$?
15case $ec in
160)
17	echo "ok 1 - $name"
18	;;
19*)
20	echo "not ok 1 - $name"
21	;;
22esac
23rm -f $sleep
24
25name="pkill -s 0"
26sleep=$(pwd)/sleep.txt
27ln -sf /bin/sleep $sleep
28$sleep 5 &
29sleep 0.3
30pkill -f -s 0 $sleep
31ec=$?
32case $ec in
330)
34	echo "ok 2 - $name"
35	;;
36*)
37	echo "not ok 2 - $name"
38	;;
39esac
40rm -f $sleep
41