]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/oom/test-oomd-util.c
oomd: fix unreachable test case in test-oomd-util 25509/head
authorNick Rosbrook <nick.rosbrook@canonical.com>
Tue, 22 Nov 2022 16:30:03 +0000 (11:30 -0500)
committerNick Rosbrook <nick.rosbrook@canonical.com>
Wed, 23 Nov 2022 20:45:54 +0000 (15:45 -0500)
commitf05bcc18941eef5c2f93cfa06660eb06e0dc4c55
tree219ebe2f89730c2581cf85c03a46e59e54850311
parent89186093485b52ca957d17842fc1f7c87958454a
oomd: fix unreachable test case in test-oomd-util

This conditional with !empty_or_root(ctx->path) always returns false
because the most recent oomd_cgroup_context_acquire() call was with the
root cgroup. Make sure this test case can be reached by checking cgroup
instead of ctx->path.

While here, use an unused uid (61183) instead of the nobody uid so the
test case does not fail in unprivileged LXD containers.
src/oom/test-oomd-util.c