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:
commit
b71cf69380
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue