aboutsummaryrefslogtreecommitdiff
path: root/bin/pkill/tests/pkill-j_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pkill/tests/pkill-j_test.sh')
-rw-r--r--bin/pkill/tests/pkill-j_test.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/bin/pkill/tests/pkill-j_test.sh b/bin/pkill/tests/pkill-j_test.sh
index 26e185fc8988..0af24cfc86fa 100644
--- a/bin/pkill/tests/pkill-j_test.sh
+++ b/bin/pkill/tests/pkill-j_test.sh
@@ -14,7 +14,7 @@ if [ `id -u` -ne 0 ]; then
exit 0
fi
-echo "1..3"
+echo "1..4"
sleep=$(pwd)/sleep.txt
ln -sf /bin/sleep $sleep
@@ -90,5 +90,31 @@ else
fi 2>/dev/null
[ -f ${PWD}/${base}_3_1.pid ] && kill $(cat ${base}_3_1.pid)
[ -f ${PWD}/${base}_3_2.pid ] && kill $(cat ${base}_3_2.pid)
+wait
+
+# test 4 is like test 1 except with jname instead of jid.
+name="pkill -j <jname>"
+sleep_amount=8
+jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount &
+
+jail -c path=/ name=${base}_4_2 ip4.addr=127.0.0.1 \
+ command=daemon -p ${PWD}/${base}_4_2.pid $sleep $sleep_amount &
+
+$sleep $sleep_amount &
+
+sleep 0.5
+
+jname="${base}_4_1,${base}_4_2"
+if pkill -f -j "$jname" $sleep && sleep 0.5 &&
+ ! -f ${PWD}/${base}_4_1.pid &&
+ ! -f ${PWD}/${base}_4_2.pid ; then
+ echo "ok 4 - $name"
+else
+ echo "not ok 4 - $name"
+fi 2>/dev/null
+[ -f ${PWD}/${base}_4_1.pid ] && kill $(cat ${PWD}/${base}_4_1.pid)
+[ -f ${PWD}/${base}_4_2.pid ] && kill $(cat ${PWD}/${base}_4_2.pid)
+wait
rm -f $sleep