summaryrefslogtreecommitdiffstats
path: root/bin/pkill/tests/pgrep-x_test.sh
diff options
context:
space:
mode:
authorjmmv <jmmv@FreeBSD.org>2014-04-27 01:15:10 +0000
committerjmmv <jmmv@FreeBSD.org>2014-04-27 01:15:10 +0000
commit1e4589b921fdaa1b1d2fc6b6ed016f1e0a01cb8f (patch)
tree94c86cf13dedabad5bdc68f6f227b843a5161343 /bin/pkill/tests/pgrep-x_test.sh
parent5b12da65bf9d40526ac9ca480d639bad3cd39cf6 (diff)
downloadFreeBSD-src-1e4589b921fdaa1b1d2fc6b6ed016f1e0a01cb8f.zip
FreeBSD-src-1e4589b921fdaa1b1d2fc6b6ed016f1e0a01cb8f.tar.gz
MFC various moves of tools/regressions/ tests to the new infrastructure.
- r263220 Migrate tools/regression/sbin/ to the new tests layout. - r263222 Add Makefile missed in r263220. - r263226 Migrate tools/regression/{usr.bin/lastcomm,usr.sbin}/ to the new tests layout. - r263227 Migrate most of tools/regression/usr.bin/ to the new tests layout. - r263345 Expand tabs that sneaked in into spaces. - r263346 Migrate tools/regression/usr.bin/make/ to the new tests layout. - r263348 Add Makefiles missed in r263346. - r263351 Migrate tools/regression/usr.bin/pkill/ to the new tests layout. - r263388 Mark multi_test as requiring /usr/share/dict/words. - r263814 Fix path to the run.pl script to let these tests run. - r264742 Prevent building tests when bootstrapping make. This is 'make tinderbox' clean.
Diffstat (limited to 'bin/pkill/tests/pgrep-x_test.sh')
-rw-r--r--bin/pkill/tests/pgrep-x_test.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/pkill/tests/pgrep-x_test.sh b/bin/pkill/tests/pgrep-x_test.sh
new file mode 100644
index 0000000..1defde2
--- /dev/null
+++ b/bin/pkill/tests/pgrep-x_test.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# $FreeBSD$
+
+base=`basename $0`
+
+echo "1..4"
+
+name="pgrep -x"
+sleep=$(pwd)/sleep.txt
+ln -sf /bin/sleep $sleep
+$sleep 5 &
+sleep 0.3
+pid=$!
+if [ ! -z "`pgrep -x sleep | egrep '^'"$pid"'$'`" ]; then
+ echo "ok 1 - $name"
+else
+ echo "not ok 1 - $name"
+fi
+if [ -z "`pgrep -x slee | egrep '^'"$pid"'$'`" ]; then
+ echo "ok 2 - $name"
+else
+ echo "not ok 2 - $name"
+fi
+name="pgrep -x -f"
+if [ ! -z "`pgrep -x -f ''"$sleep"' 5' | egrep '^'"$pid"'$'`" ]; then
+ echo "ok 3 - $name"
+else
+ echo "not ok 3 - $name"
+fi
+if [ -z "`pgrep -x -f ''"$sleep"' ' | egrep '^'"$pid"'$'`" ]; then
+ echo "ok 4 - $name"
+else
+ echo "not ok 4 - $name"
+fi
+kill $pid
+rm -f $sleep
OpenPOWER on IntegriCloud