summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_memory_test.go19
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" {