Date: Sun, 9 Mar 2014 22:14:20 +0000 (UTC) From: Julio Merino <jmmv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262961 - head/tools/regression/usr.bin/pkill Message-ID: <201403092214.s29MEKPi085158@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403092214.s29MEKPi085158>