xref: /freebsd/bin/pkill/tests/pkill-_u_test.sh (revision fee65b7e21eeeb625dcaba8cf2b9e0cf5af83498)
1#!/bin/sh
2# $FreeBSD$
3
4base=`basename $0`
5
6echo "1..2"
7
8name="pkill -U <uid>"
9ruid=`id -ur`
10sleep=$(pwd)/sleep.txt
11ln -sf /bin/sleep $sleep
12$sleep 5 &
13sleep 0.3
14pkill -f -U $ruid $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 -U <user>"
27ruid=`id -urn`
28sleep=$(pwd)/sleep.txt
29ln -sf /bin/sleep $sleep
30$sleep 5 &
31sleep 0.3
32pkill -f -U $ruid $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