Merge pull request #14625 from cdoern/podShm

podman pod create --shm-size
This commit is contained in:
openshift-ci[bot]
2022-06-21 17:57:24 +00:00
committed by GitHub
11 changed files with 85 additions and 10 deletions

View File

@@ -138,4 +138,21 @@ var _ = Describe("Podman pod clone", func() {
Expect(data.Mounts[0]).To(HaveField("Name", volName))
})
It("podman pod clone --shm-size", func() {
podCreate := podmanTest.Podman([]string{"pod", "create"})
podCreate.WaitWithDefaultTimeout()
Expect(podCreate).Should(Exit(0))
podClone := podmanTest.Podman([]string{"pod", "clone", "--shm-size", "10mb", podCreate.OutputToString()})
podClone.WaitWithDefaultTimeout()
Expect(podClone).Should(Exit(0))
run := podmanTest.Podman([]string{"run", "-it", "--pod", podClone.OutputToString(), ALPINE, "mount"})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))
t, strings := run.GrepString("shm on /dev/shm type tmpfs")
Expect(t).To(BeTrue())
Expect(strings[0]).Should(ContainSubstring("size=10240k"))
})
})

View File

@@ -1134,4 +1134,27 @@ ENTRYPOINT ["sleep","99999"]
Expect(session.OutputToString()).Should(ContainSubstring("/vol2"))
})
It("podman pod create --shm-size", func() {
podCreate := podmanTest.Podman([]string{"pod", "create", "--shm-size", "10mb"})
podCreate.WaitWithDefaultTimeout()
Expect(podCreate).Should(Exit(0))
run := podmanTest.Podman([]string{"run", "-it", "--pod", podCreate.OutputToString(), ALPINE, "mount"})
run.WaitWithDefaultTimeout()
Expect(run).Should(Exit(0))
t, strings := run.GrepString("shm on /dev/shm type tmpfs")
Expect(t).To(BeTrue())
Expect(strings[0]).Should(ContainSubstring("size=10240k"))
})
It("podman pod create --shm-size and --ipc=host conflict", func() {
podCreate := podmanTest.Podman([]string{"pod", "create", "--shm-size", "10mb"})
podCreate.WaitWithDefaultTimeout()
Expect(podCreate).Should(Exit(0))
run := podmanTest.Podman([]string{"run", "-dt", "--pod", podCreate.OutputToString(), "--ipc", "host", ALPINE})
run.WaitWithDefaultTimeout()
Expect(run).ShouldNot(Exit(0))
})
})