renice: Force /bin/sh usage on su calls for the regression tests.

If the root account is configured to use a different shell than sh,
it fails to retreive the pid of the background process.

Approved by:	des
Obtained from:	chs
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D36930
This commit is contained in:
Olivier Cochard 2022-10-13 17:23:54 +02:00
parent 63f6075fcf
commit 07b1ea961a

View File

@ -97,7 +97,7 @@ renice_abs_user_head() {
}
renice_abs_user_body() {
local user pid nice incr
pid=$(su -m $TEST_USER -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
@ -112,7 +112,7 @@ renice_rel_user_head() {
}
renice_rel_user_body() {
local user pid nice incr
pid=$(su -m $TEST_USER -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