diff options
author | Hironori Shiina <shiina.hironori@jp.fujitsu.com> | 2021-11-11 11:27:05 -0500 |
---|---|---|
committer | Hironori Shiina <shiina.hironori@jp.fujitsu.com> | 2021-11-12 13:20:20 -0500 |
commit | 9226ccb59f5967f5c784280b993711530615dcd7 (patch) | |
tree | b706751e55c134039957a3a94f707cfb8feab6da /test/e2e/run_memory_test.go | |
parent | 0aecacb8655d65cb55ec09a9629a358236e6af73 (diff) | |
download | podman-9226ccb59f5967f5c784280b993711530615dcd7.tar.gz podman-9226ccb59f5967f5c784280b993711530615dcd7.tar.bz2 podman-9226ccb59f5967f5c784280b993711530615dcd7.zip |
Enable 'podman run --memory-swappiness=0'
'--memory-swappiness=0' used to work. This patch fixes the regression
issue, which was caused by the change of infra container creation
process.
Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
Diffstat (limited to 'test/e2e/run_memory_test.go')
-rw-r--r-- | test/e2e/run_memory_test.go | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/test/e2e/run_memory_test.go b/test/e2e/run_memory_test.go index e2f2937ba..04952bb03 100644 --- a/test/e2e/run_memory_test.go +++ b/test/e2e/run_memory_test.go @@ -1,6 +1,7 @@ package integration import ( + "fmt" "os" "strconv" @@ -67,13 +68,17 @@ var _ = Describe("Podman run memory", func() { Expect(session.OutputToString()).To(Equal("41943040")) }) - It("podman run memory-swappiness test", func() { - SkipIfCgroupV2("memory-swappiness not supported on cgroupV2") - session := podmanTest.Podman([]string{"run", "--memory-swappiness=15", ALPINE, "cat", "/sys/fs/cgroup/memory/memory.swappiness"}) - session.WaitWithDefaultTimeout() - Expect(session).Should(Exit(0)) - Expect(session.OutputToString()).To(Equal("15")) - }) + for _, limit := range []string{"0", "15", "100"} { + limit := limit // Keep this value in a proper scope + testName := fmt.Sprintf("podman run memory-swappiness test(%s)", limit) + It(testName, func() { + SkipIfCgroupV2("memory-swappiness not supported on cgroupV2") + session := podmanTest.Podman([]string{"run", fmt.Sprintf("--memory-swappiness=%s", limit), ALPINE, "cat", "/sys/fs/cgroup/memory/memory.swappiness"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.OutputToString()).To(Equal(limit)) + }) + } It("podman run kernel-memory test", func() { if podmanTest.Host.Distribution == "ubuntu" { |