containerd/sys
Sebastiaan van Stijn 3d20fa9309
fix TestSetOOMScoreBoundaries
(this was introduced in 44240116aa)

Setting the oom-score-adj to -1000 is only possible if the parent process
either has no score set, or if the score is set to -1000.

However, the current implementation of GetOOMScoreAdj conflates situations
where either _no_ oom-score is set, _or_ oom-score is set, but set to 0.

In the latter case, the test would fail:

    --- FAIL: TestSetOOMScoreBoundaries (0.01s)
        oom_linux_test.go:79: assertion failed: 0 (adjustment int) != -1000 (OOMScoreAdjMin int)
    FAIL

To prevent failures in this situation, skip that part of the test in the
above situation.

Also update the description of GetOOMScoreAdj to clarify its behavior.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-08 13:14:04 +02:00
..
reaper Integrate sys.SetSubreaper, sys.GetSubreaper in sys/reaper package 2020-05-04 08:44:02 +02:00
epoll.go sys: deprecate EpollCreate1, EpollCtl, EpollWait 2020-03-09 13:15:07 +01:00
fds.go Licence header added 2018-02-19 10:32:26 +09:00
filesys_unix.go Windows:Create root/state with ACL 2019-03-21 18:47:34 -07:00
filesys_windows.go Clean up WCOW layers after tests in the correct order 2021-03-25 05:26:24 +11:00
filesys.go Move isFifo from process/io to sys/ and make public 2020-03-25 10:44:17 -04:00
mount_linux_test.go sys: un-export runningPrivileged(), remove runningUnprivileged() 2021-04-07 19:16:49 +02:00
mount_linux.go sys/mount_linux: use pipe for communicating mount result 2020-04-09 09:50:41 +10:00
oom_linux_test.go fix TestSetOOMScoreBoundaries 2021-04-08 13:14:04 +02:00
oom_linux.go fix TestSetOOMScoreBoundaries 2021-04-08 13:14:04 +02:00
oom_unsupported.go sys: add AdjustOOMScore() utility 2021-04-07 19:16:56 +02:00
socket_unix.go sys: mkdirAs: do chown if dir already exists 2019-12-18 14:19:19 +09:00
socket_windows.go Licence header added 2018-02-19 10:32:26 +09:00
stat_bsd.go Add support for NetBSD 2020-09-22 20:03:50 +02:00
stat_openbsd.go Bring OpenBSD support 2021-01-04 14:43:48 +01:00
stat_unix.go Licence header added 2018-02-19 10:32:26 +09:00
subprocess_unsafe_linux.go Support >= 128 layers in overlayfs snapshots 2018-08-07 10:59:36 +08:00
subprocess_unsafe_linux.s Support >= 128 layers in overlayfs snapshots 2018-08-07 10:59:36 +08:00
userns_deprecated.go Move RunningInUserNS() to its own package 2021-03-23 11:29:53 +01:00