1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #15132 from LK4D4/improve_test

Fix message and add additional check to test
This commit is contained in:
Arnaud Porterie 2015-07-29 17:36:11 -07:00
commit b71cf69380

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) {