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

Clean more build utils in integration cli

- Remove deprecated buildImage* functions
- Rename buildImageNew to buildImage
- Use *check.C in fakeContext* setup and in getIdByName

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
Vincent Demeester 2017-01-16 11:30:14 +01:00
parent 8c7651998f
commit c10f6ef43f
No known key found for this signature in database
GPG key ID: 083CC6FD6EB699A3
28 changed files with 587 additions and 1194 deletions

View file

@ -25,13 +25,11 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) {
testRequires(c, cpuCfsQuota)
name := "testbuildresourceconstraints"
ctx, err := fakeContext(`
ctx := fakeContext(c, `
FROM hello-world:frozen
RUN ["/hello"]
`, map[string]string{})
c.Assert(err, checker.IsNil)
_, _, err = dockerCmdInDir(c, ctx.Dir, "build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpuset-mems=0", "--cpu-shares=100", "--cpu-quota=8000", "--ulimit", "nofile=42", "-t", name, ".")
_, _, err := dockerCmdInDir(c, ctx.Dir, "build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpuset-mems=0", "--cpu-shares=100", "--cpu-quota=8000", "--ulimit", "nofile=42", "-t", name, ".")
if err != nil {
c.Fatal(err)
}
@ -114,9 +112,7 @@ func (s *DockerSuite) TestBuildAddChangeOwnership(c *check.C) {
defer ctx.Close()
if _, err := buildImageFromContext(name, ctx, true); err != nil {
c.Fatalf("build failed to complete for TestBuildAddChangeOwnership: %v", err)
}
buildImageSuccessfully(c, name, withExternalBuildContext(ctx))
}
// Test that an infinite sleep during a build is killed if the client disconnects.
@ -137,10 +133,7 @@ func (s *DockerSuite) TestBuildCancellationKillsSleep(c *check.C) {
defer observer.Stop()
// (Note: one year, will never finish)
ctx, err := fakeContext("FROM busybox\nRUN sleep 31536000", nil)
if err != nil {
c.Fatal(err)
}
ctx := fakeContext(c, "FROM busybox\nRUN sleep 31536000", nil)
defer ctx.Close()
buildCmd := exec.Command(dockerBinary, "build", "-t", name, ".")