mirror of
https://github.com/containers/podman.git
synced 2025-06-25 12:20:42 +08:00
test: check for io.stat existence on cgroup v2
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -576,14 +576,12 @@ USER bin`
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run blkio-weight test", func() {
|
It("podman run blkio-weight test", func() {
|
||||||
SkipIfRootless("FIXME: This is blowing up because of no /sys/fs/cgroup/user.slice/user-14467.slice/user@14467.service/cgroup.subtree_control file")
|
|
||||||
SkipIfRootlessCgroupsV1("Setting blkio-weight not supported on cgroupv1 for rootless users")
|
SkipIfRootlessCgroupsV1("Setting blkio-weight not supported on cgroupv1 for rootless users")
|
||||||
if !CGROUPSV2 {
|
SkipIfRootless("By default systemd doesn't delegate io to rootless users")
|
||||||
if _, err := os.Stat("/sys/fs/cgroup/blkio/blkio.weight"); os.IsNotExist(err) {
|
|
||||||
Skip("Kernel does not support blkio.weight")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if CGROUPSV2 {
|
if CGROUPSV2 {
|
||||||
|
if _, err := os.Stat("/sys/fs/cgroup/io.stat"); os.IsNotExist(err) {
|
||||||
|
Skip("Kernel does not have io.stat")
|
||||||
|
}
|
||||||
session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/io.bfq.weight"})
|
session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/io.bfq.weight"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
@ -592,6 +590,9 @@ USER bin`
|
|||||||
// FIXME: drop "|51" once all the runtimes we test have the fix in place.
|
// FIXME: drop "|51" once all the runtimes we test have the fix in place.
|
||||||
Expect(strings.Replace(session.OutputToString(), "default ", "", 1)).To(MatchRegexp("15|51"))
|
Expect(strings.Replace(session.OutputToString(), "default ", "", 1)).To(MatchRegexp("15|51"))
|
||||||
} else {
|
} else {
|
||||||
|
if _, err := os.Stat("/sys/fs/cgroup/blkio/blkio.weight"); os.IsNotExist(err) {
|
||||||
|
Skip("Kernel does not support blkio.weight")
|
||||||
|
}
|
||||||
session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "cat", "/sys/fs/cgroup/blkio/blkio.weight"})
|
session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "cat", "/sys/fs/cgroup/blkio/blkio.weight"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
Reference in New Issue
Block a user