Page MenuHomeFreeBSD

renice: fix renice_abs_user and renice_rel_user if root user configured with other shell as sh
ClosedPublic

Authored by olivier on Oct 11 2022, 12:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 11:48 PM
Unknown Object (File)
Oct 8 2024, 4:48 PM
Unknown Object (File)
Oct 7 2024, 9:30 PM
Unknown Object (File)
Oct 6 2024, 5:56 PM
Unknown Object (File)
Oct 5 2024, 3:37 PM
Unknown Object (File)
Oct 4 2024, 2:14 PM
Unknown Object (File)
Sep 28 2024, 3:32 AM
Unknown Object (File)
Sep 27 2024, 6:12 PM
Subscribers

Details

Summary

renice_abs_user and renice_rel_user regression tests imply a root account configured with /bin/sh.
In case of other shell like csh, it will fail to retrieve the pid because csh already display job and process id when send to background.

Test Plan

Without the patch:

root@dev:/usr/tests # chsh -s /bin/csh
chsh: user information updated
root@dev:/usr/tests # kyua test usr.bin/renice/
usr.bin/renice/renice_test:renice_abs_pgid  ->  passed  [0.022s]
usr.bin/renice/renice_test:renice_abs_pid  ->  passed  [0.018s]
usr.bin/renice/renice_test:renice_abs_user  ->  failed: 3 !=  (3 != )  [0.084s]
usr.bin/renice/renice_test:renice_delim  ->  passed  [0.062s]
usr.bin/renice/renice_test:renice_rel_pgid  ->  passed  [0.024s]
usr.bin/renice/renice_test:renice_rel_pid  ->  passed  [0.026s]
usr.bin/renice/renice_test:renice_rel_user  ->  failed: 6 !=  (6 != )  [0.025s]

With the patch:

root@dev:/usr/tests # chsh -s /bin/csh
chsh: user information updated
root@dev:/usr/tests # kyua test usr.bin/renice/
usr.bin/renice/renice_test:renice_abs_pgid  ->  passed  [0.011s]
usr.bin/renice/renice_test:renice_abs_pid  ->  passed  [0.011s]
usr.bin/renice/renice_test:renice_abs_user  ->  passed  [0.018s]
usr.bin/renice/renice_test:renice_delim  ->  passed  [0.036s]
usr.bin/renice/renice_test:renice_rel_pgid  ->  passed  [0.014s]
usr.bin/renice/renice_test:renice_rel_pid  ->  passed  [0.016s]
usr.bin/renice/renice_test:renice_rel_user  ->  passed  [0.020s]

Results file id is usr_tests.20221010-235631-717371
Results saved to /root/.kyua/store/results.usr_tests.20221010-235631-717371.db

7/7 passed (0 failed)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable