Author: jmmv
Date: Sun Mar 9 22:14:20 2014
New Revision: 262961
URL: http://svnweb.freebsd.org/changeset/base/262961
Log:
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.
Modified:
head/tools/regression/usr.bin/pkill/pgrep-_s.t
Modified: head/tools/regression/usr.bin/pkill/pgrep-_s.t
==============================================================================
--- head/tools/regression/usr.bin/pkill/pgrep-_s.t Sun Mar 9 22:05:23
2014 (r262960)
+++ head/tools/regression/usr.bin/pkill/pgrep-_s.t Sun Mar 9 22:14:20
2014 (r262961)
@@ -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"
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"