rt-tests / cyclictest: Make cyclictest fail if it cannot run with requested priority.

Currently if a non-root user requests a priority higher than the soft limit in
/etc/security/limits.conf
the call to sched_setscheduler will silently fail and the user will be running
with priority of 0. Cyclictest will not complain, and display the
requested priority resulting in seemingly poor results.

The following patch fixes this by doing two things.

1. If the requested priority is higher than the soft limit but lower than the
hard limit, it will raise the soft limit to the requested priority.

2. If the requested priority is higher than the hard limit, it will fail with a
warning.

The patch should not affect privileged users.

Reported-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: John Kacur <jkacur@redhat.com>
1 file changed
tree: 69b5e047828fbc17e0a256710dc23e5ab70ff836
  1. .gitignore
  2. COPYING
  3. Makefile
  4. doc/
  5. rt-tests.spec-in
  6. scripts/
  7. src/