mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Migrate integration test to new method
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
parent
a8dfafc986
commit
9dbe12b792
1 changed files with 6 additions and 7 deletions
|
@ -5252,20 +5252,20 @@ func (s *DockerSuite) TestBuildEmptyStringVolume(c *check.C) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildContainerWithCgroupParent(t *testing.T) {
|
func (s *DockerSuite) TestBuildContainerWithCgroupParent(c *check.C) {
|
||||||
testRequires(t, NativeExecDriver)
|
testRequires(c, NativeExecDriver)
|
||||||
testRequires(t, SameHostDaemon)
|
testRequires(c, SameHostDaemon)
|
||||||
defer deleteImages()
|
defer deleteImages()
|
||||||
|
|
||||||
cgroupParent := "test"
|
cgroupParent := "test"
|
||||||
data, err := ioutil.ReadFile("/proc/self/cgroup")
|
data, err := ioutil.ReadFile("/proc/self/cgroup")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to read '/proc/self/cgroup - %v", err)
|
c.Fatalf("failed to read '/proc/self/cgroup - %v", err)
|
||||||
}
|
}
|
||||||
selfCgroupPaths := parseCgroupPaths(string(data))
|
selfCgroupPaths := parseCgroupPaths(string(data))
|
||||||
_, found := selfCgroupPaths["memory"]
|
_, found := selfCgroupPaths["memory"]
|
||||||
if !found {
|
if !found {
|
||||||
t.Fatalf("unable to find self cpu cgroup path. CgroupsPath: %v", selfCgroupPaths)
|
c.Fatalf("unable to find self cpu 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(`
|
||||||
|
@ -5275,7 +5275,6 @@ RUN cat /proc/self/cgroup
|
||||||
|
|
||||||
out, _, err := runCommandWithOutput(cmd)
|
out, _, err := runCommandWithOutput(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.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)
|
||||||
}
|
}
|
||||||
logDone("build - cgroup parent")
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue