Skip blkio-weight test when no kernel BFQ support

Namely the Ubuntu 21.04 Kernel does not support BFQ.  Regardless of the
distro. skip this test if the required cgroup node doesn't exist.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich 2021-04-27 10:22:56 -04:00
parent 3148e01651
commit 7e90bcbb9a
No known key found for this signature in database
GPG Key ID: 03EDC70FD578067F
1 changed files with 3 additions and 0 deletions

View File

@ -582,6 +582,9 @@ USER bin`, BB)
if _, err := os.Stat("/sys/fs/cgroup/io.stat"); os.IsNotExist(err) {
Skip("Kernel does not have io.stat")
}
if _, err := os.Stat("/sys/fs/cgroup/system.slice/io.bfq.weight"); os.IsNotExist(err) {
Skip("Kernel does not support BFQ IO scheduler")
}
session := podmanTest.Podman([]string{"run", "--rm", "--blkio-weight=15", ALPINE, "sh", "-c", "cat /sys/fs/cgroup/io.bfq.weight"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))