logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

nice.sh (653B)


  1. #!/bin/sh
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. WD="$(dirname "$0")/../"
  5. target="${WD}/cmd/nice"
  6. getprio="${WD}/test-cmd/getpriority"
  7. plans=4
  8. if ! test -f "${getprio}"; then
  9. echo '1..0 # SKIP: missing executable: ' "${getprio}"
  10. exit 0
  11. fi
  12. curr_nice=$("${getprio}")
  13. if [ "$curr_nice" != "getpriority: 0" ]; then
  14. echo '1..0 # SKIP: need 0 nice value, got: ' "${curr_nice}"
  15. exit 0
  16. fi
  17. . "${WD}/test-cmd/tap.sh"
  18. t noargs ''
  19. t_args noadj 'getpriority: 0
  20. ' "$getprio"
  21. t_args adj:0 'getpriority: 0
  22. ' -n 0 "$getprio"
  23. t_args adj:10 'getpriority: 10
  24. ' -n 10 "$getprio"