skip test for blkio.weight when kernel does not support it

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude
2018-12-20 08:58:20 -06:00
parent 65c5883f5c
commit 1f3726f2cf
2 changed files with 15 additions and 12 deletions

View File

@ -24,22 +24,22 @@ var (
},
}
rmiCommand = cli.Command{
Name: "rmi",
Usage: "Removes one or more images from local storage",
Description: rmiDescription,
Action: rmiCmd,
ArgsUsage: "IMAGE-NAME-OR-ID [...]",
Flags: sortFlags(rmiFlags),
Name: "rmi",
Usage: "Removes one or more images from local storage",
Description: rmiDescription,
Action: rmiCmd,
ArgsUsage: "IMAGE-NAME-OR-ID [...]",
Flags: sortFlags(rmiFlags),
UseShortOptionHandling: true,
OnUsageError: usageErrorHandler,
}
rmImageCommand = cli.Command{
Name: "rm",
Usage: "removes one or more images from local storage",
Description: rmiDescription,
Action: rmiCmd,
ArgsUsage: "IMAGE-NAME-OR-ID [...]",
Flags: rmiFlags,
Name: "rm",
Usage: "removes one or more images from local storage",
Description: rmiDescription,
Action: rmiCmd,
ArgsUsage: "IMAGE-NAME-OR-ID [...]",
Flags: rmiFlags,
UseShortOptionHandling: true,
OnUsageError: usageErrorHandler,
}

View File

@ -253,6 +253,9 @@ var _ = Describe("Podman run", func() {
})
It("podman run blkio-weight test", func() {
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.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))