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

Merge pull request #11512 from vishh/parent-cgroup

Update --cgroup-parent cli integration test to use "memory" cgroup instead of "cpu"
This commit is contained in:
Michael Crosby 2015-03-19 21:28:59 -07:00
commit 385d4beaa5

View file

@ -114,7 +114,7 @@ func getCgroupPaths(test string) map[string]string {
for _, line := range strings.Split(test, "\n") { for _, line := range strings.Split(test, "\n") {
parts := strings.Split(line, ":") parts := strings.Split(line, ":")
if len(parts) != 3 { if len(parts) != 3 {
fmt.Printf("unexpected file format for /proc/self/cgroup - %q", line) fmt.Printf("unexpected file format for /proc/self/cgroup - %q\n", line)
continue continue
} }
cgroupPaths[parts[1]] = parts[2] cgroupPaths[parts[1]] = parts[2]
@ -132,7 +132,7 @@ func TestRunContainerWithCgroupParent(t *testing.T) {
t.Fatalf("failed to read '/proc/self/cgroup - %v", err) t.Fatalf("failed to read '/proc/self/cgroup - %v", err)
} }
selfCgroupPaths := getCgroupPaths(string(data)) selfCgroupPaths := getCgroupPaths(string(data))
selfCpuCgroup, found := selfCgroupPaths["cpu"] selfCpuCgroup, found := selfCgroupPaths["memory"]
if !found { if !found {
t.Fatalf("unable to find self cpu cgroup path. CgroupsPath: %v", selfCgroupPaths) t.Fatalf("unable to find self cpu cgroup path. CgroupsPath: %v", selfCgroupPaths)
} }