diff options
author | jmmv <jmmv@FreeBSD.org> | 2014-03-09 22:14:20 +0000 |
---|---|---|
committer | jmmv <jmmv@FreeBSD.org> | 2014-03-09 22:14:20 +0000 |
commit | 77fe07fd561ce4ffff35b35d63b40c2625c85052 (patch) | |
tree | e66ff4c74b509e1ed95a55b67b59cabfe31cad7f /tools/regression | |
parent | fd557a3f40020015b930fdbc600d2244e63842ef (diff) | |
download | FreeBSD-src-77fe07fd561ce4ffff35b35d63b40c2625c85052.zip FreeBSD-src-77fe07fd561ce4ffff35b35d63b40c2625c85052.tar.gz |
Fix pkill tests so that they run cleanly with prove.
This fixes a pgrep test that assumed that PID 2 was named g_event. This
does not seem to be the case any longer (and I don't know if it ever was
in all possible setups).
Change this test to use the idle loop instead and determine its expected
PID using ps without assuming any specific ID.
Diffstat (limited to 'tools/regression')
-rw-r--r-- | tools/regression/usr.bin/pkill/pgrep-_s.t | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/regression/usr.bin/pkill/pgrep-_s.t b/tools/regression/usr.bin/pkill/pgrep-_s.t index 5ce98e6..ce0bde3 100644 --- a/tools/regression/usr.bin/pkill/pgrep-_s.t +++ b/tools/regression/usr.bin/pkill/pgrep-_s.t @@ -5,15 +5,17 @@ base=`basename $0` echo "1..2" +exp_pid="$(ps ax | grep '\[idle\]' | awk '{print $1}')" + name="pgrep -S" -pid=`pgrep -Sx g_event` -if [ "$pid" = "2" ]; then +pid=`pgrep -Sx idle` +if [ "$pid" = "$exp_pid" ]; then echo "ok 1 - $name" else echo "not ok 1 - $name" fi -pid=`pgrep -x g_event` -if [ "$pid" != "2" ]; then +pid=`pgrep -x idle` +if [ "$pid" != "$exp_pid" ]; then echo "ok 2 - $name" else echo "not ok 2 - $name" |