mirror of
https://github.com/containers/podman.git
synced 2025-12-03 11:49:18 +08:00
Merge pull request #17207 from danishprakash/add-systemd-shm-size
add support for limiting tmpfs size for systemd-specific mnts
This commit is contained in:
@@ -1193,4 +1193,24 @@ ENTRYPOINT ["sleep","99999"]
|
||||
podJSON := podInspect.InspectPodToJSON()
|
||||
Expect(podJSON.InfraConfig).To(HaveField("UtsNS", ns))
|
||||
})
|
||||
|
||||
It("podman pod create --shm-size-systemd", func() {
|
||||
podName := "testShmSizeSystemd"
|
||||
session := podmanTest.Podman([]string{"pod", "create", "--name", podName, "--shm-size-systemd", "10mb"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
|
||||
// add container to pod
|
||||
ctrRun := podmanTest.Podman([]string{"run", "-d", "--pod", podName, SYSTEMD_IMAGE, "/sbin/init"})
|
||||
ctrRun.WaitWithDefaultTimeout()
|
||||
Expect(ctrRun).Should(Exit(0))
|
||||
|
||||
run := podmanTest.Podman([]string{"exec", ctrRun.OutputToString(), "mount"})
|
||||
run.WaitWithDefaultTimeout()
|
||||
Expect(run).Should(Exit(0))
|
||||
t, strings := run.GrepString("tmpfs on /run/lock")
|
||||
Expect(t).To(BeTrue())
|
||||
Expect(strings[0]).Should(ContainSubstring("size=10240k"))
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@@ -2053,4 +2053,22 @@ WORKDIR /madethis`, BB)
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.ErrorToString()).To(ContainSubstring("Trying to pull"))
|
||||
})
|
||||
|
||||
It("podman run --shm-size-systemd", func() {
|
||||
ctrName := "testShmSizeSystemd"
|
||||
run := podmanTest.Podman([]string{"run", "--name", ctrName, "--shm-size-systemd", "10mb", "-d", SYSTEMD_IMAGE, "/sbin/init"})
|
||||
run.WaitWithDefaultTimeout()
|
||||
Expect(run).Should(Exit(0))
|
||||
|
||||
logs := podmanTest.Podman([]string{"logs", ctrName})
|
||||
logs.WaitWithDefaultTimeout()
|
||||
Expect(logs).Should(Exit(0))
|
||||
|
||||
mount := podmanTest.Podman([]string{"exec", ctrName, "mount"})
|
||||
mount.WaitWithDefaultTimeout()
|
||||
Expect(mount).Should(Exit(0))
|
||||
t, strings := mount.GrepString("tmpfs on /run/lock")
|
||||
Expect(t).To(BeTrue())
|
||||
Expect(strings[0]).Should(ContainSubstring("size=10240k"))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user