diff --git a/usr.bin/renice/tests/renice_test.sh b/usr.bin/renice/tests/renice_test.sh --- a/usr.bin/renice/tests/renice_test.sh +++ b/usr.bin/renice/tests/renice_test.sh @@ -14,8 +14,9 @@ atf_check_nice_value() { local pid=$1 - local nice=$2 - atf_check test "$(ps -o nice= -p $pid)" -eq "$nice" + local expected=$2 + local actual="$(ps -o nice= -p $pid)" + atf_check test "$actual" -eq "$expected" } atf_test_case renice_abs_pid @@ -57,7 +58,7 @@ renice_abs_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours - pid=$(sh -mc "sleep 60 >/dev/null & echo \$!") + pid="$(sh -mc "sleep 60 >/dev/null & echo \$!")" pgid="$(ps -o pgid= -p $pid)" nice="$(ps -o nice= -p $pid)" incr=3 @@ -73,7 +74,7 @@ renice_rel_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours - pid=$(sh -mc "sleep 60 >/dev/null & echo \$!") + pid="$(sh -mc "sleep 60 >/dev/null & echo \$!")" pgid="$(ps -o pgid= -p $pid)" nice="$(ps -o nice= -p $pid)" incr=3 @@ -90,7 +91,7 @@ } renice_abs_user_body() { local user pid nice incr - pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'") + pid="$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")" nice="$(ps -o nice= -p $pid)" incr=3 _renice $((nice+incr)) -u $TEST_USER @@ -105,7 +106,7 @@ } renice_rel_user_body() { local user pid nice incr - pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'") + pid="$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")" nice="$(ps -o nice= -p $pid)" incr=3 _renice -u -n $incr $TEST_USER