summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-04-04 13:14:35 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2022-04-04 15:40:12 +0200
commit164b64ea3baa8502a23fc0c7674f4a7e60507aa0 (patch)
tree88e060255b3869822171c1eb200f3afaf1740ebd /test
parentd1f3a2d6a82ed66d4dab5be62821bc59bfb84dd8 (diff)
downloadpodman-164b64ea3baa8502a23fc0c7674f4a7e60507aa0.tar.gz
podman-164b64ea3baa8502a23fc0c7674f4a7e60507aa0.tar.bz2
podman-164b64ea3baa8502a23fc0c7674f4a7e60507aa0.zip
specgen: do not set OOMScoreAdj by default
do not force a value of OOMScoreAdj=0 if it is wasn't specified by the user. Closes: https://github.com/containers/podman/issues/13731 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_test.go7
-rw-r--r--test/system/030-run.bats6
2 files changed, 13 insertions, 0 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index 1a93296b7..6f3aabd3f 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -609,6 +609,13 @@ USER bin`, BB)
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(Equal("111"))
+
+ currentOOMScoreAdj, err := ioutil.ReadFile("/proc/self/oom_score_adj")
+ Expect(err).To(BeNil())
+ session = podmanTest.Podman([]string{"run", "--rm", fedoraMinimal, "cat", "/proc/self/oom_score_adj"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).To(Equal(strings.TrimRight(string(currentOOMScoreAdj), "\n")))
})
It("podman run limits host test", func() {
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index ec85ef166..72e4a2bc8 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -815,4 +815,10 @@ EOF
run_podman run --uidmap 0:10001:10002 --rm --hostname ${HOST} $IMAGE grep ${HOST} /etc/hosts
is "${lines[0]}" ".*${HOST}.*"
}
+
+@test "podman run doesn't override oom-score-adj" {
+ current_oom_score_adj=$(cat /proc/self/oom_score_adj)
+ run_podman run --rm $IMAGE cat /proc/self/oom_score_adj
+ is "$output" "$current_oom_score_adj" "different oom_score_adj in the container"
+}
# vim: filetype=sh