summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-04-04 13:19:35 -0400
committerGitHub <noreply@github.com>2022-04-04 13:19:35 -0400
commit4f31ade2b251514992dec7cfe9444dd0c62f00b5 (patch)
treeb71846639dc1c0d2b3206c26afbf0fb9f8b507c5 /test
parentaecb2023d240b69690f35721efcee7d724eba3f5 (diff)
parent164b64ea3baa8502a23fc0c7674f4a7e60507aa0 (diff)
downloadpodman-4f31ade2b251514992dec7cfe9444dd0c62f00b5.tar.gz
podman-4f31ade2b251514992dec7cfe9444dd0c62f00b5.tar.bz2
podman-4f31ade2b251514992dec7cfe9444dd0c62f00b5.zip
Merge pull request #13765 from giuseppe/do-not-set-oom-score-adj
specgen: do not set OOMScoreAdj by default
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 a1d04ddee..4c399dc2b 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -614,6 +614,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