diff options
author | pjd <pjd@FreeBSD.org> | 2005-03-20 12:38:08 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-03-20 12:38:08 +0000 |
commit | a0488b02202fad7c12b3c512e94b59e6cc92d46c (patch) | |
tree | 74ea844b0d1e87607cc5747c3ee6b81e6d65a13d /tools/regression/usr.bin/pkill/pgrep-t.t | |
parent | 1fbe41652e0c5f8551a51c98fa3b7be18774b9cc (diff) | |
download | FreeBSD-src-a0488b02202fad7c12b3c512e94b59e6cc92d46c.zip FreeBSD-src-a0488b02202fad7c12b3c512e94b59e6cc92d46c.tar.gz |
Add regression tests for pkill/pgrep.
MFC after: 3 days
Diffstat (limited to 'tools/regression/usr.bin/pkill/pgrep-t.t')
-rw-r--r-- | tools/regression/usr.bin/pkill/pgrep-t.t | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/pkill/pgrep-t.t b/tools/regression/usr.bin/pkill/pgrep-t.t new file mode 100644 index 0000000..7fb580d --- /dev/null +++ b/tools/regression/usr.bin/pkill/pgrep-t.t @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..1" + +name="pgrep -t <tty>" +tty=`ps -o tty -p $$ | tail -1` +if [ "$tty" = "??" ]; then + tty="-" +fi +sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +ln -sf /bin/sleep $sleep +$sleep 5 & +sleep 0.3 +chpid=$! +pid=`pgrep -f -t $tty $sleep` +if [ "$pid" = "$chpid" ]; then + echo "ok - $name" +else + echo "not ok - $name" +fi +kill $chpid +rm -f $sleep |