changes some of the test commands to use bash functions
includes some small bug fixes to tests where bugs were
previously not seen due to different plumbing.
- Don't use $UID, use $EUID instead
- Allow user to specify testuser (through RSYSLOG_TESTUSER env variable)
or fall back to various default users
- Validate if user running tests can really impersonate another user
- Test if testuser really exists
Fixes: https://github.com/rsyslog/rsyslog/issues/927
This also introduces a new global setting to permit keep
supplemental groups during privilege drop. This is needed
when we want to run the tests as non-root (what we want).
Sample:
global(privdrop.group.keepsupplemental="on")
The new tests ensure that we catch regressions in the privilege
drop code.
see also https://github.com/rsyslog/rsyslog/issues/889