Commit Graph

4 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
ace1912bba
sys: use assert for error checks in OOM tests
Slightly easier to read, and we were already using assert in this file

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:53 +02:00
Sebastiaan van Stijn
6e72715226
sys: add missing pre-condition checks in tests
SetOOMScore requires both privileged (root) and non-user namespace,
for negative values, so adjust the pre-conditions accordingly.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:51 +02:00
Sebastiaan van Stijn
badd60d3f6
sys: un-export runningPrivileged(), remove runningUnprivileged()
These are currently only used inside this package, so we might
as well un-export them until we need them elsewhere.

Also updated SetOOMScore() to first check for privileged; check for privileged
looks to be the "faster" path, and checking it first could (in case of non-
privileged) save having to read and parse /proc/self/uid_map.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-07 19:16:49 +02:00
Maksym Pavlenko
eb7c7c71e2 Fix oom tests on non Linux
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-23 11:57:24 -07:00