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