xref: /freebsd/bin/pkill/tests/pkill-_g_test.sh (revision 7431dfd4580e850375fe5478d92ec770344db098)
1#!/bin/sh
2# $FreeBSD$
3
4base=`basename $0`
5
6echo "1..2"
7
8name="pkill -G <gid>"
9rgid=`id -gr`
10sleep=$(pwd)/sleep.txt
11ln -sf /bin/sleep $sleep
12$sleep 5 &
13sleep 0.3
14pkill -f -G $rgid $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 -G <group>"
27rgid=`id -grn`
28sleep=$(pwd)/sleep.txt
29ln -sf /bin/sleep $sleep
30$sleep 5 &
31sleep 0.3
32pkill -f -G $rgid $sleep
33ec=$?
34case $ec in
350)
36	echo "ok 2 - $name"
37	;;
38*)
39	echo "not ok 2 - $name"
40	;;
41esac
42rm -f $sleep
43