Parcourir la source

Fix message and add additional check to TestBuildContainerWithCgroupParent

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Alexander Morozov il y a 10 ans
Parent
commit
0d09439ace
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      integration-cli/docker_cli_build_test.go

+ 6 - 1
integration-cli/docker_cli_build_test.go

@@ -5284,7 +5284,7 @@ func (s *DockerSuite) TestBuildContainerWithCgroupParent(c *check.C) {
 	selfCgroupPaths := parseCgroupPaths(string(data))
 	selfCgroupPaths := parseCgroupPaths(string(data))
 	_, found := selfCgroupPaths["memory"]
 	_, found := selfCgroupPaths["memory"]
 	if !found {
 	if !found {
-		c.Fatalf("unable to find self cpu cgroup path. CgroupsPath: %v", selfCgroupPaths)
+		c.Fatalf("unable to find self memory cgroup path. CgroupsPath: %v", selfCgroupPaths)
 	}
 	}
 	cmd := exec.Command(dockerBinary, "build", "--cgroup-parent", cgroupParent, "-")
 	cmd := exec.Command(dockerBinary, "build", "--cgroup-parent", cgroupParent, "-")
 	cmd.Stdin = strings.NewReader(`
 	cmd.Stdin = strings.NewReader(`
@@ -5296,6 +5296,11 @@ RUN cat /proc/self/cgroup
 	if err != nil {
 	if err != nil {
 		c.Fatalf("unexpected failure when running container with --cgroup-parent option - %s\n%v", string(out), err)
 		c.Fatalf("unexpected failure when running container with --cgroup-parent option - %s\n%v", string(out), err)
 	}
 	}
+	m, err := regexp.MatchString(fmt.Sprintf("memory:.*/%s/.*", cgroupParent), out)
+	c.Assert(err, check.IsNil)
+	if !m {
+		c.Fatalf("There is no expected memory cgroup with parent /%s/: %s", cgroupParent, out)
+	}
 }
 }
 
 
 func (s *DockerSuite) TestBuildNoDupOutput(c *check.C) {
 func (s *DockerSuite) TestBuildNoDupOutput(c *check.C) {