add blkio.weight support

We can use this to control block IO weight of a container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: f133f11a7d25e6262558dd733afaa95ddd1c7aee
Component: engine
This commit is contained in:
Qiang Huang
2015-05-07 11:55:58 +08:00
parent 35594b63f9
commit 4f3515319b
13 changed files with 65 additions and 1 deletions
@@ -1158,6 +1158,20 @@ func (s *DockerSuite) TestRunWithCpusetMems(c *check.C) {
}
}
func (s *DockerSuite) TestRunWithBlkioWeight(c *check.C) {
cmd := exec.Command(dockerBinary, "run", "--blkio-weight", "300", "busybox", "true")
if code, err := runCommand(cmd); err != nil || code != 0 {
c.Fatalf("container should run successfully with blkio-weight of 300: %s", err)
}
}
func (s *DockerSuite) TestRunWithBlkioInvalidWeight(c *check.C) {
cmd := exec.Command(dockerBinary, "run", "--blkio-weight", "5", "busybox", "true")
if _, err := runCommand(cmd); err == nil {
c.Fatalf("run with invalid blkio-weight should failed")
}
}
func (s *DockerSuite) TestRunDeviceNumbers(c *check.C) {
cmd := exec.Command(dockerBinary, "run", "busybox", "sh", "-c", "ls -l /dev/null")
out, _, err := runCommandWithOutput(cmd)