Browse code

Add pause status check for --kernel-memory

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>

Yuan Sun authored on 2016/04/01 11:32:46
Showing 1 changed files
... ...
@@ -116,8 +116,7 @@ func (s *DockerSuite) TestUpdateContainerWithoutFlags(c *check.C) {
116 116
 }
117 117
 
118 118
 func (s *DockerSuite) TestUpdateKernelMemory(c *check.C) {
119
-	testRequires(c, DaemonIsLinux)
120
-	testRequires(c, kernelMemorySupport)
119
+	testRequires(c, DaemonIsLinux, kernelMemorySupport)
121 120
 
122 121
 	name := "test-update-container"
123 122
 	dockerCmd(c, "run", "-d", "--name", name, "--kernel-memory", "50M", "busybox", "top")
... ...
@@ -128,6 +127,12 @@ func (s *DockerSuite) TestUpdateKernelMemory(c *check.C) {
128 128
 	// Update kernel memory to a running container with failure should not change HostConfig
129 129
 	c.Assert(inspectField(c, name, "HostConfig.KernelMemory"), checker.Equals, "52428800")
130 130
 
131
+	dockerCmd(c, "pause", name)
132
+	_, _, err = dockerCmdWithError("update", "--kernel-memory", "100M", name)
133
+	c.Assert(err, check.NotNil)
134
+	c.Assert(inspectField(c, name, "HostConfig.KernelMemory"), checker.Equals, "52428800")
135
+	dockerCmd(c, "unpause", name)
136
+
131 137
 	dockerCmd(c, "stop", name)
132 138
 	dockerCmd(c, "update", "--kernel-memory", "100M", name)
133 139
 	dockerCmd(c, "start", name)