Add pause status check for --kernel-memory

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
This commit is contained in:
Yuan Sun 2016-04-01 10:32:46 +08:00
parent 4a7bd7eaef
commit 16dfb38fb8
1 changed files with 7 additions and 2 deletions

View File

@ -116,8 +116,7 @@ func (s *DockerSuite) TestUpdateContainerWithoutFlags(c *check.C) {
}
func (s *DockerSuite) TestUpdateKernelMemory(c *check.C) {
testRequires(c, DaemonIsLinux)
testRequires(c, kernelMemorySupport)
testRequires(c, DaemonIsLinux, kernelMemorySupport)
name := "test-update-container"
dockerCmd(c, "run", "-d", "--name", name, "--kernel-memory", "50M", "busybox", "top")
@ -128,6 +127,12 @@ func (s *DockerSuite) TestUpdateKernelMemory(c *check.C) {
// Update kernel memory to a running container with failure should not change HostConfig
c.Assert(inspectField(c, name, "HostConfig.KernelMemory"), checker.Equals, "52428800")
dockerCmd(c, "pause", name)
_, _, err = dockerCmdWithError("update", "--kernel-memory", "100M", name)
c.Assert(err, check.NotNil)
c.Assert(inspectField(c, name, "HostConfig.KernelMemory"), checker.Equals, "52428800")
dockerCmd(c, "unpause", name)
dockerCmd(c, "stop", name)
dockerCmd(c, "update", "--kernel-memory", "100M", name)
dockerCmd(c, "start", name)