xref: /freebsd/bin/pkill/tests/pkill-x_test.sh (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1*65c3cfc1SJulio Merino#!/bin/sh
2*65c3cfc1SJulio Merino
3*65c3cfc1SJulio Merinobase=`basename $0`
4*65c3cfc1SJulio Merino
5*65c3cfc1SJulio Merinoecho "1..4"
6*65c3cfc1SJulio Merino
7*65c3cfc1SJulio Merinoname="pkill -x"
8*65c3cfc1SJulio Merinosleep=$(pwd)/sleep.txt
9*65c3cfc1SJulio Merinoln -sf /bin/sleep $sleep
10*65c3cfc1SJulio Merino$sleep 5 &
11*65c3cfc1SJulio Merinosleep 0.3
12*65c3cfc1SJulio Merinopkill -x slee -P $$
13*65c3cfc1SJulio Merinoif [ $? -ne 0 ]; then
14*65c3cfc1SJulio Merino	echo "ok 1 - $name"
15*65c3cfc1SJulio Merinoelse
16*65c3cfc1SJulio Merino	echo "not ok 1 - $name"
17*65c3cfc1SJulio Merinofi
18*65c3cfc1SJulio Merinopkill -x sleep -P $$
19*65c3cfc1SJulio Merinoif [ $? -eq 0 ]; then
20*65c3cfc1SJulio Merino	echo "ok 2 - $name"
21*65c3cfc1SJulio Merinoelse
22*65c3cfc1SJulio Merino	echo "not ok 2 - $name"
23*65c3cfc1SJulio Merinofi
24*65c3cfc1SJulio Merinorm -f $sleep
25*65c3cfc1SJulio Merino
26*65c3cfc1SJulio Merinoname="pkill -x -f"
27*65c3cfc1SJulio Merinosleep=$(pwd)/sleep.txt
28*65c3cfc1SJulio Merinoln -sf /bin/sleep $sleep
29*65c3cfc1SJulio Merino$sleep 5 &
30*65c3cfc1SJulio Merinosleep 0.3
31*65c3cfc1SJulio Merinopkill -x -f "$sleep " -P $$
32*65c3cfc1SJulio Merinoif [ $? -ne 0 ]; then
33*65c3cfc1SJulio Merino	echo "ok 3 - $name"
34*65c3cfc1SJulio Merinoelse
35*65c3cfc1SJulio Merino	echo "not ok 3 - $name"
36*65c3cfc1SJulio Merinofi
37*65c3cfc1SJulio Merinopkill -x -f "$sleep 5" -P $$
38*65c3cfc1SJulio Merinoif [ $? -eq 0 ]; then
39*65c3cfc1SJulio Merino	echo "ok 4 - $name"
40*65c3cfc1SJulio Merinoelse
41*65c3cfc1SJulio Merino	echo "not ok 4 - $name"
42*65c3cfc1SJulio Merinofi
43*65c3cfc1SJulio Merinorm -f $sleep
44