Fix message and add additional check to TestBuildContainerWithCgroupParent

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-07-29 11:46:33 -07:00
parent 9d3ad6d892
commit 0d09439ace
1 changed files with 6 additions and 1 deletions

View File

@ -5284,7 +5284,7 @@ func (s *DockerSuite) TestBuildContainerWithCgroupParent(c *check.C) {
selfCgroupPaths := parseCgroupPaths(string(data))
_, found := selfCgroupPaths["memory"]
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.Stdin = strings.NewReader(`
@ -5296,6 +5296,11 @@ RUN cat /proc/self/cgroup
if err != nil {
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) {