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. doc/
  2. scripts/
  3. src/
  4. .gitignore
  5. COPYING
  6. Makefile
  7. rt-tests.spec-in