Browse code

Fix message and add additional check to TestBuildContainerWithCgroupParent

Signed-off-by: Alexander Morozov <lk4d4@docker.com>

Alexander Morozov authored on 2015/07/30 03:46:33
Showing 1 changed files
... ...
@@ -5284,7 +5284,7 @@ func (s *DockerSuite) TestBuildContainerWithCgroupParent(c *check.C) {
5284 5284
 	selfCgroupPaths := parseCgroupPaths(string(data))
5285 5285
 	_, found := selfCgroupPaths["memory"]
5286 5286
 	if !found {
5287
-		c.Fatalf("unable to find self cpu cgroup path. CgroupsPath: %v", selfCgroupPaths)
5287
+		c.Fatalf("unable to find self memory cgroup path. CgroupsPath: %v", selfCgroupPaths)
5288 5288
 	}
5289 5289
 	cmd := exec.Command(dockerBinary, "build", "--cgroup-parent", cgroupParent, "-")
5290 5290
 	cmd.Stdin = strings.NewReader(`
... ...
@@ -5296,6 +5296,11 @@ RUN cat /proc/self/cgroup
5296 5296
 	if err != nil {
5297 5297
 		c.Fatalf("unexpected failure when running container with --cgroup-parent option - %s\n%v", string(out), err)
5298 5298
 	}
5299
+	m, err := regexp.MatchString(fmt.Sprintf("memory:.*/%s/.*", cgroupParent), out)
5300
+	c.Assert(err, check.IsNil)
5301
+	if !m {
5302
+		c.Fatalf("There is no expected memory cgroup with parent /%s/: %s", cgroupParent, out)
5303
+	}
5299 5304
 }
5300 5305
 
5301 5306
 func (s *DockerSuite) TestBuildNoDupOutput(c *check.C) {